Project

General

Profile

lonlat grid

Added by Jay Su over 7 years ago

Hi,

I created a netCDF4 Classic file with netCDF4-python. It works well with panoply or ncdump, but when examined with

cdo sinfo
Grid coordinates shows "generic" instead of "lonlat", and unsurprisingly cdo cant subset the dataset:

cdo sellonlatbox (Abort): Unsupported grid type!

Does anyone here know the solution? Thanks,
sukye


Replies (9)

RE: lonlat grid - Added by Ralf Mueller over 7 years ago

hi!

Some sample of your data would be helpful

cheers
ralf

RE: lonlat grid - Added by Jay Su over 7 years ago

attached. thank you ralf.

toms.nc4 (1.14 MB) toms.nc4

RE: lonlat grid - Added by Ralf Mueller over 7 years ago

CDO needs ntecdf data generally following the CF convention: http://cfconventions.org/

Your data does not:

        int nCorners(nCorners) ;
                nCorners:long_name = "Ground Pixel Corner" ;
                nCorners:units = "1" ;
                nCorners:description = "The dimension representing the ground pixel corners.  There are four corners per ground pixel." ;
        double nTimes(nTimes) ;
                nTimes:long_name = "Time at Start of Scan (TAI93)" ;
                nTimes:units = "seconds since 1993-01-01" ;
                nTimes:description = "The dimension representing the observation times in the granule.  The values are in TAI93 (time in continuous seconds since 12 a.m. UTC on January 1, 1993)." ;
        float nWavel(nWavel) ;
                nWavel:long_name = "TOMS Wavelength" ;
                nWavel:units = "nm" ;
                nWavel:description = "The dimension representing the TOMS wavelengths.  The values range from 331 to 380 nm." ;
        int nXtrack(nXtrack) ;
                nXtrack:long_name = "Cross-Track Position (1-Based)" ;
                nXtrack:units = "1" ;
                nXtrack:description = "The dimension representing the cross-track position of the observation in the scan line.  The values range from 1 to 35." ;

group: ANCILLARY_DATA {
  variables:
        float SurfaceAlbedoOceanCorrected(nTimes, nXtrack, nWavel) ;
                SurfaceAlbedoOceanCorrected:_FillValue = -1.267651e+30f ;
                SurfaceAlbedoOceanCorrected:long_name = "Surface Albedo Ocean Corrected at 331, 340, 360 and 380 nm" ;
                SurfaceAlbedoOceanCorrected:units = "1" ;
                SurfaceAlbedoOceanCorrected:description = "The surface albedo ocean corrected at 331, 340, 360 and 380 nm." ;
                SurfaceAlbedoOceanCorrected:valid_min = 0.f ;
                SurfaceAlbedoOceanCorrected:valid_max = 1.f ;
        float TerrainPressure(nTimes, nXtrack) ;
                TerrainPressure:_FillValue = -1.267651e+30f ;
                TerrainPressure:long_name = "TerrainPressure" ;
                TerrainPressure:units = "hPa" ;
                TerrainPressure:valid_min = -20.f ;
                TerrainPressure:description = "The terrain pressure (in hPa) at the center of the ground pixel (from the TOMS Level 1B file)." ;
                TerrainPressure:valid_max = 1000.f ;

CDO is not a general netcdf editor, but you could use the NCO package - it supports the netcdf-standard in a broader sense.

hth
ralf

RE: lonlat grid - Added by Jay Su over 7 years ago

Could you tell me a little more where this file fails CF-convention?

I tried
http://puma.nerc.ac.uk/cgi-bin/cf-checker.pl
and it gave a pass.

Thanks,

RE: lonlat grid - Added by Ralf Mueller over 7 years ago

Ok, CDO is designed for working with climate/weather, so it needs some kind of grid. There is no such coodinate in your file, nothing that could be interpreted as longitudes or latitudes. You can have a look into the documentation about it.

sorry for being unclear

Esp. I dont see your file following the coordinates recommendations: http://cfconventions.org/cf-conventions/cf-conventions.html#coordinate-system

RE: lonlat grid - Added by Jay Su over 7 years ago

Is it possible to run cdo setgrid to fix this issue?

In the group GEOLOCATION_DATA, two variables: Latitude/Longitude could be used ?

RE: lonlat grid - Added by Jay Su over 7 years ago

Here is a related example. (attached)

Panoply shows:

dimensions:
lat = 1800;
lon = 3600;

but ncdump shows:

dimensions:
lat = 1800 ;
phony_dim_1 = 3600 ;

cdo sinfo shows:

Grid coordinates :
1 : generic : points=3600

RE: lonlat grid - Added by Ralf Mueller over 7 years ago

CDO needs a data variable for be able to work with that file. you could put in an empty one, that makes use of the given dimensions.

RE: lonlat grid - Added by Jay Su over 7 years ago

Is it true CDO does not support groups? It's an issue reported 6 years ago. Looks like v1.6.9 does not.

What do you mean by a data variable? lat/lon are both dimensions and variables in the file.

    (1-9/9)