r-spatial / stars

Spatiotemporal Arrays, Raster and Vector Data Cubes
https://r-spatial.github.io/stars/
Apache License 2.0
560 stars 94 forks source link

Will I be able to create NetCDF files? #8

Closed ibarraespinosa closed 3 years ago

ibarraespinosa commented 7 years ago

Hi and congrats by the proposal grant. Many people are excited about this package, including me.

I have a question and not really an issue.

Will we be able to create NetCDF files? I have my package which creates a flux of emissions in a grid (currently as SpatialGridDataFrame but I'm gonna migrate to SF soon) and it would be very beneficial to me to have a tool to create NetCDF from this grids. The idea is to create inputs for atmospheric models such as WRF-Chem, CMAQ, BRAMS etc.

Thanks and congrats

mdsumner commented 7 years ago

Initial support will be via GDAL, so see the description of how that interprets this format and what is supports for file creation:

http://www.gdal.org/frmt_netcdf.html

You can try it on a system with rgdal that includes NetCDF as a driver, I don't think either win or Mac binaries on CRAN currently do but it's relatively easy on a Linux system to install the right systems packages. Then exploration can be done with rgdal and more directly at the command line. The command line utilities are available for mac and win with nc support independently of CRAN.

Happy to explore details with you, but I suspect the write capabilities won't be configurable enough for your needs. Having this as an example application either with full native support or via workarounds would be useful information.

ibarraespinosa commented 7 years ago

Ok, I'm gonna think about it. I believe that I would need the headers of the NetCDF files required for each modeling system. I'm gonna try some tests and will let you know.

Many thanks

edzer commented 5 years ago

I will take this up with @appelmar , when discussing gdalcubes next week.

edzer commented 4 years ago

So, we have now:

ibarraespinosa commented 4 years ago

Thanks you so much, I will check the options

PS: stay safe

On Thu, Apr 2, 2020, 09:35 Edzer Pebesma notifications@github.com wrote:

So, we have now:

  • through write_stars using the GDAL driver we can write GDAL-like NetCDF files (no time support, everything beyond x/y is a band);
  • I think we don't have generic stars -> netcdf writing, and this would be very nice to have; in particular the new (GDAL >= 3.1) multidimensional arrays https://gdal.org/drivers/raster/netcdf.html#multidimensional-api-support options seem promising
  • package ncdfgeom can read and write vector data cubes ( @dblodgett-usgs https://github.com/dblodgett-usgs )
  • package gdalcubes can properly write netcdf files with time support, created from image collections

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-spatial/stars/issues/8#issuecomment-607818730, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGRM74DCUITNJC6NQ6GF2J3RKSA75ANCNFSM4DXRYEBA .

edzer commented 3 years ago

Closing in favor of #419.