[Thread Prev][Thread Next][Index]

[ferret_users] wrong x - axis processing AVHRR daily data



Hi,
I am trying to work with global daily AVHRR v5.2. data, downloaded from ftp://ftp.nodc.noaa.gov/pub/data.nodc/pathfinder/Version5.2. I am trying to build a regional subset and monthly averages. Working with the data, I noticed a zonal shift between the derived monthly data and the landmask.
It seems ferret (pyferret7.0 or pyferret7.1) is the reason

With ncdump the original data have headers like follows: ( I have deleted lines not needed to understand the problem)

dimensions:
        time = UNLIMITED ; // (1 currently)
        lat = 4320 ;
        lon = 8640 ;
variables:
        int time(time) ;
                time:standard_name = "time" ;
...
        float lat(lat) ;
                lat:standard_name = "latitude" ;
...
        float lon(lon) ;
                lon:standard_name = "longitude" ;
                lon:units = "degrees_east" ;
lon:reference_datum = "geographical coordinates, WGS84 projection" ;
                lon:grid_mapping = "Equidistant Cylindrical" ;
                lon:axis = "X" ;
                lon:valid_min = -180. ;
                lon:valid_max = 180. ;

ferret can open these files correctly, plots look fine. Listing the coordinates gives the same values like ncdump.

Now I restrict the data to highest quality level. Just to show the problem, I write output of one time step only and do not define any region. yes? let sst = if PATHFINDER_QUALITY_LEVEL eq 7 then SEA_SURFACE_TEMPERATURE else 1/0
yes? set mem/size=500
yes? save/clobber/file=test.nc/outtype=float sst

ncdump reveals, that ferret has added two points to the zonal coordinate. As usual, the modulo - attribute was set, which should be fine here.
dimensions:
        LON1_8642 = 8642 ;
        LAT = 4320 ;
        TIME = UNLIMITED ; // (1 currently)
variables:
        float LON1_8642(LON1_8642) ;
                LON1_8642:units = "degrees_east" ;
                LON1_8642:axis = "X" ;
                LON1_8642:modulo = 360.f ;
                LON1_8642:point_spacing = "even" ;
                LON1_8642:standard_name = "longitude" ;

However, something is really wrong.
yes? use test.nc
           *** NOTE: Ignored modulo length exceeding axis length: LON1_8642

yes? sh data
     currently SET data sets:
    1> ./test.nc  (default)
name title I J K L M N SST IF PATHFINDER_QUALITY_LEVEL EQ 1:8642 1:4320 ... 1:1 ... ...

Inspecting the longitudes, ferret has mapped the 8640 values onto 8642 points.

ferret v6.67 produces the following header and correct coordinates.

dimensions:
        LON = 8640 ;
        LAT = 4320 ;
        TIME = UNLIMITED ; // (1 currently)
variables:
        double LON(LON) ;
                LON:units = "degrees_east" ;
                LON:axis = "X" ;
                LON:modulo = 360. ;
                LON:point_spacing = "even" ;
But it is not a good alternative, since it takes much much longer than with version 7.1.

A possible workaround could be
yes? set axis/modulo `SEA_SURFACE_TEMPERATURE,r=xaxis`
yes? let sst = if PATHFINDER_QUALITY_LEVEL eq 7 then SEA_SURFACE_TEMPERATURE else 1/0
yes? save/clobber/file=test.nc/outtype=float sst

The header is now correct:
netcdf test {
dimensions:
        LON = 8640 ;
        LAT = 4320 ;
        TIME = UNLIMITED ; // (1 currently)
variables:
        float LON(LON) ;
                LON:units = "degrees_east" ;
                LON:axis = "X" ;
                LON:modulo = " " ;
                LON:point_spacing = "even" ;
                LON:standard_name = "longitude" ;

But the file is explosive:

yes? use test.nc
yes? list x[gx=sst]
             VARIABLE : X
                        axis LON
             FILENAME : test.nc
             SUBSET   : 8642 points (LONGITUDE)
At line 330 of file tm_fmt.F
Fortran runtime error: Bad real number in item 1 of list input

Seems that 8642 coordinate values have been written anyway.

So, recent ferret versions seem to make errors, when working with this data set.

Best,
Martin Schmidt

PS: The following workaround does the job. But ferret should be more friendly to global coordinates.

yes? define axis/x=-180:180:`1/24`/edges/unit=degrees_east xax
yes? save/clobber/file=test.nc/outtype=float sst[gx=xax@asn]








[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement