-
Notifications
You must be signed in to change notification settings - Fork 97
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
Writing 3D data frames to netcdf with write_mdim() #599
Comments
One thing is that your stars object has no information that Despite the warnings, ocean_read_stars <- read_stars("data/ocean_raster_write_mdim.nc") seems to return the object you're looking for? The error in |
Dear Edzer, thanks much for your immediate reply and trying to modify the You mention that in my reprex data frame, Many thanks, Jens |
Neither do I; a GDAL-centric solution would be a vertical CRS in WKT, but I'm not sure if such a thing exists; GDAL SpatialReference do have an IsVertical() member, but it is also possible to write WKT CRS with horzontal + vertical CRS, not sure what makes sense (never tried). I also looked into the CF conventions but that didn't bring much enlightenment. and to which things the GDAL NetCDF driver is sensitive, e.g. here. But, as a heuristic, if a dimension is not |
OK, thanks for clarifying. I'll proceed with what we have (which is superb already). |
Hi stars team,
To my understanding,
write_mdim()
is the only function available in R that would allow me to directly write multidimensional grids to netcdf files in a single line of code. This is great, thank you!I tried to implement a reprex example (below) to write ocean interior data (i.e. including a z-coordinate depth, in addition to lon and lat). The approach works in general, and I'm able to read the same object back into R with
read_mdim()
.However, when writing with
write_mdim()
or reading the data with another stars function (read_stars()
orread_ncdf()
), I receive error messages that suggest that the dimensions lack an indexing variable, and that the z-coordinate depth is not a vertical dimension. I assume that this might be due to my conversion from a tibble to stars object, but couldn't figure out the issue.Can someone help?
Note: A related question was posted on gis.statexchange and I can take care to reproduce recommendations given here over there.
Thanks much in advance for your help! Cheers, Jens
PS: I hope the reprex works OK, I did not quite know how to set it up for an I/O operation.
The text was updated successfully, but these errors were encountered: