Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WRF data geotransform and extporting data to geoTiff #193

Open
isaacWpark opened this issue Oct 18, 2022 · 2 comments
Open

WRF data geotransform and extporting data to geoTiff #193

isaacWpark opened this issue Oct 18, 2022 · 2 comments

Comments

@isaacWpark
Copy link

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

@jthielen
Copy link

jthielen commented Oct 18, 2022

Would the projected geospatial coordinate functionality of xwrf meet your needs instead?

@DWesl
Copy link
Contributor

DWesl commented Sep 10, 2024

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants