Replies: 1 comment
-
Hi Harley, Thanks for posting this! 😄 Yea, it will take some time to get used to Xarray. It handles netCDF quite easily, but rioxarray and Rasterio are tools to deal with the raster data. There are some nice examples in Fatiando-data, which shows how to get raw data into beautiful data sets. For example in here in [12], you could set up the coordinate information or other metadata and proper field use Thanks for the suggestion, I think we should put it somewhere or link it along with the tutorial section. So people will be easy to find it! 😄 |
Beta Was this translation helpful? Give feedback.
-
Hi team,
I'm a huge fan of your work and have had a ton of fun gridding everything from ground geophysics to soil samples.
One issue I had when first starting out is exporting the final xarrays to georeferenced rasters. It's probably a no brainer for most people on here, but this was my first time working with xarrays.
I followed a tutorial by opensourceoptions on youtube about working with xarrays and netCDF but ended up having troubles with the coordinate systems.
In the end, I ended up using this short code at the end of the chain to export as a tif with the correct coordinate system:
crs = CRS.from_epsg(XXXXX)
grid.rio.set_spatial_dims("easting", "northing", inplace=True)
grid.rio.write_crs(input_crs=crs, inplace=True)
fn = (Save location)/File_Name.tif
grid.rio.to_raster(fn)
It's probably not the cleanest way but you might consider adding a short section on exporting the final grids to the tutorial section of the gridder.
Thanks a ton for this awesome project,
Harley
Beta Was this translation helpful? Give feedback.
All reactions