Open isaacWpark opened 2 years ago
Would the projected geospatial coordinate functionality of xwrf meet your needs instead?
- the projected coordinates of the upper-left corner of the upper-left pixel are not present in the attributes and do not seem to be otherwise accessible.
Does -ds.attrs["DX"] * ds.dims["west_east"] / 2
and ds.attrs["DY"] * ds.dims["south_north"] / 2
not work for your purposes? This would only work for the outer domain, but I think there's attributes somewhere in the WRF output to say where nested domains lie in their parent domains.
Alternately, would the Cartopy transform_point function work? I.e. crs = wrf.get_cartopy(...); crs.transform_point(ds.coords["XLONG"][0, 0], ds.coords["XLAT"][0, 0], crs.as_geodetic())
.
If you are able to install more packages, the xwrf package mentioned above can add x and y coordinates.
I'm trying to export 2d slices of wrf data to geotiffs, and have been stymied by the fact that:
-the projection information is not present in the .crs of the xarray object -the projected coordinates of the upper-left corner of the upper-left pixel are not present in the attributes and do not seem to be otherwise accessible.
While we are able to extract the proj4 from a cartopy object created from the xarray data using wrf.get_cartopy , we have been unable to extract the projected coordinates of the upper left corner of the upper-left pixel. Without those coordinates, we cannot transform the data into an evenly spaced grid in order to export it to a raster dataset. Any help would be appreciated.
Best,
Isaac Park
@mann1123