Hi Michael, Are you sure you should use the -mo flag? Because it looks like that flag is for setting metadata to the output.
Since gdal considers each time step in a NetCDF dataset a band, have you tried using the -b switch, for selecting the band you are interested in? Cheers Daniel On Tue, Jun 12, 2012 at 12:37 AM, Michael Barton <[email protected]> wrote: > This is a question for any gdal experts out there. > > I'm working with reading NetCDF files. gdal does an admirable job of this. > Many of the NetCDF climate data files have many bands and I'd like import > only some of them. Specifying a particular NetCDF SUBSET will allow gdal to > read the data for a particular variable. > > For example, ... > > gdal_translate > NETCDF:"/Users/cmbarton/Dropbox/NCAR_files/ppt_A1.SRESA1B_EA1-8.CCSM.atmm.2000-01_cat_2099-12.nc":ppt /Users/cmbarton/Dropbox/NCAR_files/out.tif > > ...will translate all of the data sets for the ppt (precipitation) variable > > AFAICT, the -mo flag in gdal_translates also allows it to operate on a > subset of data specified by a metadata option. But I can't figure out the > proper syntax to use it. There are hints in > <http://www.gdal.org/frmt_netcdf.html>, but the exact way to specify > relevant metadata still eludes me. It seems like to translate only the bands > for which the time variable = 730015.5 days after 1-01-01, I need to run... > > gdal_translate -mo ppt#NETCDF_DIMENSION_time=730015.5 > NETCDF:"/Users/cmbarton/Dropbox/NCAR_files/ppt_A1.SRESA1B_EA1-8.CCSM.atmm.2000-01_cat_2099-12.nc":ppt > /Users/cmbarton/Dropbox/NCAR_files/out.tif > > But this ignores the -mo specification and simply translates all bands. > > So does anyone know how to specify the metadata for time in this case? > > Thanks > Michael > > _____________________ > C. Michael Barton > Visiting Scientist, Integrated Science Program > National Center for Atmospheric Research & > University Consortium for Atmospheric Research > 303-497-2889 (voice) > > Director, Center for Social Dynamics & Complexity > Professor of Anthropology, School of Human Evolution & Social Change > Arizona State University > www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu > > > > > > > _______________________________________________ > grass-user mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/grass-user > _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
