U † ‘gu!ã@sddlmZGdd„dƒZdS)é)ÚDatasetc@seZdZdd„Zdd„ZdS)Ú nwmGeoMetacCs¦d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)NiñØÿÿÚ)ÚnxÚnyÚxCoordsÚyCoordsÚyStdNameÚxStdNameÚ yLongNameÚ xLongNameÚ yAxisTypeÚ xAxisTypeÚyUnitsÚxUnitsÚyResÚxResÚ transformTypeÚ transformNameÚ gridMappingÚ coordAxisÚ esriStringÚ stdParallelÚlon0Úlat0Ú falseEastÚ falseNorthÚradiusÚproj4Ú conventions)Úself©r!úH/lfs/h1/ops/prod/packages/nwm.v3.0.13/ush/mpe_refine/nwmGeospatialMod.pyÚ__init__ s6znwmGeoMeta.__init__cCs zt|jƒ}Wnd|j|_tƒ‚YnXdt|jƒkrNd|j|_tƒ‚dt|jƒkrnd|j|_tƒ‚dt|jƒkrŽd|j|_tƒ‚z|jdjd|_Wnd |j|_tƒ‚YnXz|jdjd|_Wnd |j|_tƒ‚YnXz|jdd d …|_ Wnd |j|_tƒ‚YnXz|jdd d …|_ Wnd |j|_tƒ‚YnXz|jdj |_ Wnd|j|_tƒ‚YnXz|jdj |_ Wnd|j|_tƒ‚YnXz|jdj|_Wnd|j|_tƒ‚YnXz|jdj|_Wnd|j|_tƒ‚YnXz|jdj|_Wnd|j|_tƒ‚YnXz|jdj|_Wnd|j|_tƒ‚YnXz|jdj|_Wnd|j|_tƒ‚YnXz|jdj|_Wnd|j|_tƒ‚YnXz|jdj|_Wnd|j|_tƒ‚YnXz|jdj|_Wnd|j|_tƒ‚YnXz|jdj|_Wnd|j|_tƒ‚YnXz|jdj|_Wnd|j|_tƒ‚YnXz|jdj|_Wnd|j|_tƒ‚YnXz|jdj |_!Wnd|j|_tƒ‚YnXz|jdj"|_#Wnd|j|_tƒ‚YnXz|jdj$|_%Wnd|j|_tƒ‚YnXz|jdj&|_'Wnd|j|_tƒ‚YnXz|jdj(|_)Wnd|j|_tƒ‚YnXz|jdj*|_+Wnd |j|_tƒ‚YnXz|jdj,|_-Wnd!|j|_tƒ‚YnXz|jdj.|_/Wnd"|j|_tƒ‚YnXz |j0|_0Wnd#|j|_tƒ‚YnXz |j1|_2Wnd$|j|_tƒ‚YnXz | 3¡Wnd%|j|_tƒ‚YnXd S)&z_ Function to read in geospatial metadata from the NWM metadata file. z&ERROR: Failure to open metadata file: Úxz+ERROR: Coordinate variable x not found in: Úyz+ERROR: Coordinate variable y not found in: ÚcrszERROR: crs not found in: rz*ERROR: Unable to find x variable size in: z*ERROR: Unable to find y variable size in: Nz1ERROR: Unable to extract x coordinate values in: z1ERROR: Unable to extract y coordinate values in: z/ERROR: Unable to extract x standard_name from: z/ERROR: Unable to extract y standard_name from: z,ERROR: Unable to extract x long_name from : z,ERROR: Unable to extract y long_name from : z5ERROR: Unable to extract x _CoordinateAxisType from: z5ERROR: Unable to extract y _CoordinateAxisType from: z'ERROR: Unable to extract x units from: z'ERROR: Unable to extract y units from: z,ERROR: Unable to extract x resolution from: z,ERROR: Unable to extract y resolution from: z7ERROR: Unable to extract CoordinateTransformType from: z.ERROR: Unable to extract transform_name from: z1ERROR: Unable to extract grid_mapping_name from: z.ERROR: Unable to extract coordinateAxes from: z.ERROR: Unable to extract esri_pe_string from: z1ERROR: Unable to extract standard_parallel from: z=ERROR: Unable to extract longitude_of_central_meridian from: z=ERROR: Unable to extract latitude_of_projection_origin from: z-ERROR: Unable to extract false_easting from: z.ERROR: Unable to extract false_northing from: z,ERROR: Unable to extract earth_radius from: z%ERROR: Unable to extract proj4 from: z+ERROR: Unable to extract Conventions from: zERROR: Unable to close file: )4rÚ landMetaFileÚerrMsgÚ ExceptionÚlistÚ variablesÚshaperrrrÚ standard_namer r Ú long_namer r Z_CoordinateAxisTyperr ÚunitsrrÚ resolutionrrÚ_CoordinateTransformTyperÚtransform_namerÚgrid_mapping_namerÚ_CoordinateAxesrÚesri_pe_stringrÚstandard_parallelrÚlongitude_of_central_meridianrÚlatitude_of_projection_originrÚ false_eastingrÚfalse_northingrÚ earth_radiusrrZ ConventionsrÚclose)r Ú statusMetaZidMetar!r!r"ÚreadMeta*s4                                                               znwmGeoMeta.readMetaN)Ú__name__Ú __module__Ú __qualname__r#r>r!r!r!r"r srN)ÚnetCDF4rrr!r!r!r"Ú s