Skip to content

Commit 1931176

Browse files
authored
Merge pull request #133 from pedrogamez/develop
Fix proj params. Issue #127
2 parents d58890e + 4a96029 commit 1931176

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/wrf/projection.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def _cf_params(self):
531531
_cf_params["standard_parallel"] = self._std_parallels
532532
_cf_params["longitude_of_central_meridian"] = self.stand_lon
533533
_cf_params["latitude_of_projection_origin"] = self.moad_cen_lat
534-
_cf_params["semi_major_axis"] = Constants.WRF_EARTH_RADIUS
534+
_cf_params["earth_radius"] = Constants.WRF_EARTH_RADIUS
535535

536536
return _cf_params
537537

@@ -602,7 +602,7 @@ def _proj4(self):
602602
if _ismissing(self.truelat2)
603603
else self.truelat2)
604604

605-
_proj4 = ("+proj=lcc +units=meters +a={} +b={} +lat_1={} "
605+
_proj4 = ("+proj=lcc +units=m +a={} +b={} +lat_1={} "
606606
"+lat_2={} +lat_0={} +lon_0={} +nadgrids=@null".format(
607607
Constants.WRF_EARTH_RADIUS,
608608
Constants.WRF_EARTH_RADIUS,
@@ -654,6 +654,7 @@ def _cf_params(self):
654654
_cf_params["grid_mapping_name"] = "mercator"
655655
_cf_params["longitude_of_projection_origin"] = self.stand_lon
656656
_cf_params["standard_parallel"] = self.truelat1
657+
_cf_params["earth_radius"] = Constants.WRF_EARTH_RADIUS
657658

658659
return _cf_params
659660

@@ -714,7 +715,7 @@ def _cartopy(self):
714715

715716
def _proj4(self):
716717

717-
_proj4 = ("+proj=merc +units=meters +a={} +b={} "
718+
_proj4 = ("+proj=merc +units=m +a={} +b={} "
718719
"+lon_0={} +lat_ts={} +nadgrids=@null".format(
719720
Constants.WRF_EARTH_RADIUS,
720721
Constants.WRF_EARTH_RADIUS,
@@ -762,6 +763,7 @@ def _cf_params(self):
762763
self.stand_lon)
763764
_cf_params["standard_parallel"] = self.truelat1
764765
_cf_params["latitude_of_projection_origin"] = self._hemi
766+
_cf_params["earth_radius"] = Constants.WRF_EARTH_RADIUS
765767

766768
return _cf_params
767769

@@ -821,7 +823,7 @@ def _cartopy(self):
821823
return _cartopy
822824

823825
def _proj4(self):
824-
_proj4 = ("+proj=stere +units=meters +a={} +b={} "
826+
_proj4 = ("+proj=stere +units=m +a={} +b={} "
825827
"+lat0={} +lon_0={} +lat_ts={} +nadgrids=@null".format(
826828
Constants.WRF_EARTH_RADIUS,
827829
Constants.WRF_EARTH_RADIUS,
@@ -864,6 +866,7 @@ def __init__(self, **proj_params):
864866
def _cf_params(self):
865867
_cf_params = {}
866868
_cf_params["grid_mapping_name"] = "latitude_longitude"
869+
_cf_params["earth_radius"] = Constants.WRF_EARTH_RADIUS
867870
return _cf_params
868871

869872
def _pyngl(self, geobounds, **kwargs):
@@ -920,7 +923,7 @@ def _cart_extents(self, geobounds):
920923
[geobounds.bottom_left.lat, geobounds.top_right.lat])
921924

922925
def _proj4(self):
923-
_proj4 = ("+proj=eqc +units=meters +a={} +b={} "
926+
_proj4 = ("+proj=eqc +units=m +a={} +b={} "
924927
"+lon_0={} +nadgrids=@null".format(
925928
Constants.WRF_EARTH_RADIUS,
926929
Constants.WRF_EARTH_RADIUS,
@@ -1037,6 +1040,7 @@ def _cf_params(self):
10371040
_cf_params["grid_north_pole_latitude"] = self._bm_cart_pole_lat
10381041
_cf_params["grid_north_pole_longitude"] = self.pole_lon
10391042
_cf_params["north_pole_grid_longitude"] = self._bm_lon_0
1043+
_cf_params["earth_radius"] = Constants.WRF_EARTH_RADIUS
10401044

10411045
return _cf_params
10421046

0 commit comments

Comments
 (0)