Friday, 27 December 2019

gdal - Are there examples of high-level interfaces to NetCDF


The R raster package and GDAL both have independent wrappers around NetCDF-4* that treat an array variable as a "complete" dataset, i.e. they provide objects or interfaces that seamlessly give access to a variable inclusive with:




  • dimension variables

  • coordinate system metadata

  • value units

  • general other metadata


* I'm also interested in HDF4 and HDF5 extensions, but it seems less likely than for NetCDF-4.


I often see code that uses these at the lowest level, and I'm hoping to find more examples like those in raster and GDAL that have abstracted this away:


## psuedo code
load NetCDF

nc = open("file.nc")

v = getvar(nc, "somevariable")

x = getvar(nc, "somevariable_lon")
y = getvar(nc, "somevaraible_lat")

etc.


In R's raster and in GDAL it is much more like an extension of a traditional GIS raster, i.e. all the spatial context and metadata is present, and it extends to 3D and above. (There are problems with different conventions for rectilinear and curvilinear coordinates, but that's not my concern here).


Are there other open-source examples in widely used languages that provide the high-level interfaces like R's raster and GDAL?



Is there capacity in the NetCDF library itself for this higher level access? (I know how to use the lower level to build this, I want existing examples).


I'm also excluding uses of GDAL in Python, Perl, C# etc. - that is all just GDAL as far as I'm concerned. I'm also not interested in GIS interfaces that provide these via GDAL.


raster:
http://cran.r-project.org/web/packages/raster/index.html


GDAL: http://www.gdal.org


edit (2017):


Python's xarray is a good example




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...