A :class:`wrf.WrfProj` subclass for Lambert Conformal Conic projections. See Also: :class:`wrf.WrfProj`, :class:`wrf.LatLon`, :class:`wrf.PolarStereographic`, :class:`Mercator`, :class:`RotatedLatLon`
| 496 | |
| 497 | |
| 498 | class LambertConformal(WrfProj): |
| 499 | """A :class:`wrf.WrfProj` subclass for Lambert Conformal Conic projections. |
| 500 | |
| 501 | See Also: |
| 502 | |
| 503 | :class:`wrf.WrfProj`, :class:`wrf.LatLon`, |
| 504 | :class:`wrf.PolarStereographic`, |
| 505 | :class:`Mercator`, :class:`RotatedLatLon` |
| 506 | |
| 507 | """ |
| 508 | def __init__(self, **proj_params): |
| 509 | """Initialize a :class:`wrf.LambertConformal` object. |
| 510 | |
| 511 | Args: |
| 512 | |
| 513 | **proj_params: Map projection optional keyword arguments, that |
| 514 | have the same names as found in WRF output NetCDF global |
| 515 | attributes: |
| 516 | |
| 517 | - 'TRUELAT1': True latitude 1. |
| 518 | - 'TRUELAT2': True latitude 2. |
| 519 | - 'MOAD_CEN_LAT': Mother of all domains center latitude. |
| 520 | - 'STAND_LON': Standard longitude. |
| 521 | - 'POLE_LAT': Pole latitude. |
| 522 | - 'POLE_LON': Pole longitude. |
| 523 | |
| 524 | """ |
| 525 | super(LambertConformal, self).__init__(**proj_params) |
| 526 | |
| 527 | self._std_parallels = [self.truelat1] |
| 528 | if self.truelat2 is not None: |
| 529 | self._std_parallels.append(self.truelat2) |
| 530 | |
| 531 | def _cf_params(self): |
| 532 | _cf_params = {} |
| 533 | _cf_params["grid_mapping_name"] = "lambert_conformal_conic" |
| 534 | _cf_params["standard_parallel"] = self._std_parallels |
| 535 | _cf_params["longitude_of_central_meridian"] = self.stand_lon |
| 536 | _cf_params["latitude_of_projection_origin"] = self.moad_cen_lat |
| 537 | _cf_params["earth_radius"] = Constants.WRF_EARTH_RADIUS |
| 538 | |
| 539 | return _cf_params |
| 540 | |
| 541 | def _pyngl(self, geobounds, **kwargs): |
| 542 | if not pyngl_enabled(): |
| 543 | return None |
| 544 | |
| 545 | truelat2 = (self.truelat1 if _ismissing(self.truelat2) |
| 546 | else self.truelat2) |
| 547 | |
| 548 | _pyngl = Resources() |
| 549 | _pyngl.mpProjection = "LambertConformal" |
| 550 | _pyngl.mpDataBaseVersion = "MediumRes" |
| 551 | _pyngl.mpLambertMeridianF = self.stand_lon |
| 552 | _pyngl.mpLambertParallel1F = self.truelat1 |
| 553 | _pyngl.mpLambertParallel2F = truelat2 |
| 554 | |
| 555 | _pyngl.mpLimitMode = "Corners" |