[gdal-dev] how to create NETCDF with several 3D variables?
anton.korosov at nersc.no
Mon Jul 23 22:46:14 PDT 2012
Etienne, Chris, thank you very much for your response!
I'll take a closer look at this software, though I wish to be dependent
on fewer packages.
On 07/23/2012 08:09 PM, Etienne Tourigny wrote:
> Chris is right - the netcdf driver in gdal was designed to read netcdf
> data and create netcdf files from other formats, not write complex
> Anything else is a hack - better to use other tools if you want to
> combine bands, variables, etc.
> On Mon, Jul 23, 2012 at 2:07 PM, Chris Barker <chris.barker at noaa.gov> wrote:
>> On Mon, Jul 23, 2012 at 7:50 AM, Anton Korosov <anton.korosov at nersc.no> wrote:
>>> how to create a NetCDF file with several variables that have more than two
>> I"m sure you can get this to work, but...
>> netcdf has a pretty different data model than GDAL -- I suspect you'll
>> be fighting that regularly. You may be better off workign with a more
>> native netcdf driver. If you are at all familiar with Python, the
>> "netCDF4" python module is great:
>> ( you can read stuff in other formats with GDAL, and write with
>> netcdf4, if that makes sense )
>> you may want to give it a try.
>>> I have to save time series of several fields (sst, chlorophyll, etc) in one
>>> I found that in order to create one 3D variable I can add
>>> NETCDF_DIM_EXTRA, NETCDF_DIM_time_DEF, NETCDF_DIM_time_VALUES to the
>>> metadata in a VRT file. Then I use 'gdal_translate -of NetCDF' or
>>> gdal.GetDriverByName('NetCDF').CreateCopy() to generate a .nc file.
>>> However I cannot make several 3D variables!
>>> Here are two VRTs. One works fine (one variable: 'sst', 3 dimentions: time,
>>> x, y). Another one produces two variables (chl, sst) but time dimension is
>>> not added!
>>> Is it possible to do it in theory?
>>> I use the latest release of GDAL 2.0dev
>>> With best regards and great thanks for the developers of the fantastic
>>> NetCDF driver!
>>> gdal-dev mailing list
>>> gdal-dev at lists.osgeo.org
>> Christopher Barker, Ph.D.
>> Emergency Response Division
>> NOAA/NOS/OR&R (206) 526-6959 voice
>> 7600 Sand Point Way NE (206) 526-6329 fax
>> Seattle, WA 98115 (206) 526-6317 main reception
>> Chris.Barker at noaa.gov
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
More information about the gdal-dev