aodn / content

Tracks AODN Portal content and configuration issues
0 stars 0 forks source link

Some SRS files can't be subsetted spatially by ncks (gogoduck) #230

Closed jonescc closed 8 years ago

jonescc commented 8 years ago
ncks -a -4 -O --mk_rec_dmn time -d time,1992-03-16T11:10:00.000Z,1992-03-16T11:10:00.000999Z -d lon,129.0,134.0 -d lat,-34.0,-31.0 -v time,lat,lon,dt_analysis,l2p_flags,quality_level,satellite_zenith_angle,sea_surface_temperature,sses_bias,sses_count,sses_standard_deviation,sst_dtime 19920331111000-ABOM-L3S_GHRSST-SSTfnd-AVHRR_D-1m_dn_Southern.nc
ncks: ERROR User-specified coordinate value range 129 <= lon <= 134 does not fall within valid coordinate range 2.51 <= lon <= -157.51

Looking at this file the defined min/max range for longitude is:

            lon:units = "degrees_east" ;
            lon:valid_min = -180.f ;
            lon:valid_max = 360.f ;

Actual longitude values are:

 lon = 2.51, 2.53, 2.55, 2.57, 2.59, 2.61, 2.63, 2.65, 2.67, 2.69, 2.71, 
    2.73, 2.75, 2.77, 2.79, 2.81, 2.83, 2.85, 2.87, 2.89, 2.91, 2.93, 2.95, 
    ...
    179.87, 179.89, 179.91, 179.93, 179.95, 179.97, 179.99, -179.99, -179.97, 
    -179.95, -179.93, -179.91, -179.89, -179.87, -179.85, -179.83, -179.81, 
    ...
    -157.71, -157.69, -157.67, -157.65, -157.63, -157.61, -157.59, -157.57, 
    -157.55, -157.53, -157.51 ;

Compare this to SRS files which can be spatially subsetted e.g. 19950630032000-ABOM-L3S_GHRSST-SSTskin-AVHRR_D-1m_night.nc

                lon:units = "degrees_east" ;
                lon:valid_min = -180.f ;
                lon:valid_max = 360.f ;
 lon = 70.01, 70.03, 70.05, 70.07, 70.09, 70.11, 70.13, 70.15, 70.17, 70.19, 
    70.21, 70.23, 70.25, 70.27, 70.29, 70.31, 70.33, 70.35, 70.37, 70.39, 
    ...
    179.93, 179.95, 179.97, 179.99, 180.01, 180.03, 180.05, 180.07, 180.09, 
    180.11, 180.13, 180.15, 180.17, 180.19, 180.21, 180.23, 180.25, 180.27, 
    ...

Looks like ncks expects longitude values crossing the anti-meridian to use values in the range 180 -> 360 not -180 -> 180. Do the files need to be corrected or do we need to handle these files somehow?

jonescc commented 8 years ago

@lbesnard ?

lbesnard commented 8 years ago

If I remember correctly, the first file is not correct (not CF) because the dimension should be monotonic. So ncks can't really work. I'll contact Edward.

lbesnard commented 8 years ago

fixed a week ago