MCPcopy Create free account
hub / github.com/NCAR/wrf-python / LatLon

Class LatLon

src/wrf/projection.py:840–934  ·  view source on GitHub ↗

A :class:`wrf.WrfProj` subclass for Lat Lon projections. See Also: :class:`wrf.WrfProj`, :class:`wrf.RotatedLatLon`, :class:`wrf.PolarStereographic`, :class:`Mercator`, :class:`LambertConformal`

Source from the content-addressed store, hash-verified

838
839
840class LatLon(WrfProj):
841 """A :class:`wrf.WrfProj` subclass for Lat Lon projections.
842
843 See Also:
844
845 :class:`wrf.WrfProj`, :class:`wrf.RotatedLatLon`,
846 :class:`wrf.PolarStereographic`,
847 :class:`Mercator`, :class:`LambertConformal`
848
849 """
850 def __init__(self, **proj_params):
851 """Initialize a :class:`wrf.LatLon` object.
852
853 Args:
854
855 **proj_params: Map projection optional keyword arguments, that
856 have the same names as found in WRF output NetCDF global
857 attributes:
858
859 - 'TRUELAT1': True latitude 1.
860 - 'TRUELAT2': True latitude 2.
861 - 'MOAD_CEN_LAT': Mother of all domains center latitude.
862 - 'STAND_LON': Standard longitude.
863 - 'POLE_LAT': Pole latitude.
864 - 'POLE_LON': Pole longitude.
865
866 """
867 super(LatLon, self).__init__(**proj_params)
868
869 def _cf_params(self):
870 _cf_params = {}
871 _cf_params["grid_mapping_name"] = "latitude_longitude"
872 _cf_params["earth_radius"] = Constants.WRF_EARTH_RADIUS
873 return _cf_params
874
875 def _pyngl(self, geobounds, **kwargs):
876 if not pyngl_enabled():
877 return None
878
879 _pyngl = Resources()
880 _pyngl.mpProjection = "CylindricalEquidistant"
881 _pyngl.mpDataBaseVersion = "MediumRes"
882 _pyngl.mpCenterLonF = self.stand_lon
883 _pyngl.mpCenterLatF = self.moad_cen_lat
884
885 _pyngl.mpLimitMode = "Corners"
886 _pyngl.mpLeftCornerLonF = geobounds.bottom_left.lon
887 _pyngl.mpLeftCornerLatF = geobounds.bottom_left.lat
888 _pyngl.mpRightCornerLonF = geobounds.top_right.lon
889 _pyngl.mpRightCornerLatF = geobounds.top_right.lat
890
891 for key, val in viewitems(kwargs):
892 setattr(_pyngl, key, val)
893
894 return _pyngl
895
896 def _basemap(self, geobounds, **kwargs):
897 if not basemap_enabled():

Callers 1

getprojFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected