[Thread Prev][Thread Next][Index]

Re: [ferret_users] choosing a grid point



Hi Anup,

the problem is not with ferret, but the definitions in the original NetCDF files. These are not set correctly, and ferret doesn't infer the correct longitude/latitude axes for your variable ZO. Therefore it uses indices instead of longitudes for the axis values. The longitude and latitude is defined in the variables LON and LAT, but they are not recognized as such, because the name of these variables is not the same as the name of the dimension they are defined on. What you need is the NCO utilities (http://nco.sf.net if it is not available on your system yet), and more specifically the utility ncrename.
Another utility that you need is ncdump.

Run ncdump -h ZETA.nc and you could see something like:

netcdf seamask {
dimensions:
        LONGITUDE = 288 ;
        LATITUDE = 217 ;
        SURFACE = 1 ;
        T = UNLIMITED ; // (1 currently)
variables:
        double LONGITUDE(LONGITUDE) ;
                LONGITUDE:units = "degrees_east" ;
                LONGITUDE:modulo = 360. ;
                LONGITUDE:point_spacing = "even" ;
                LONGITUDE:AXIS = "X" ;
        double LATITUDE(LATITUDE) ;
                LATITUDE:units = "degrees_north" ;
                LATITUDE:point_spacing = "even" ;
                LATITUDE:AXIS = "Y" ;
        double SURFACE(SURFACE) ;
                SURFACE:units = "level" ;
                SURFACE:point_spacing = "even" ;
                SURFACE:AXIS = "Z" ;
        double T(T) ;
                T:units = "days since 1978-09-01 00:00:00" ;
                T:time_origin = "01-SEP-1978 00:00:00" ;
                T:calendar = "360_DAY" ;
        float SEA(T, SURFACE, LATITUDE, LONGITUDE) ;
                SEA:missing_value = -1.e+34f ;
                SEA:_FillValue = -1.e+34f ;
                SEA:long_name = "0*SSM+1" ;
                SEA:history = "From higem_seafrac.nc" ;

The important thing here is the variables LONGITUDE and LATITUDE, which are defined along the dimension with exactly the same names. This enables ferret to infer the correct axes. You can either rename the dimension or the variable name with ncrename to match both values for your file, e.g. ncrename -v LON,longitude ZETA.nc. The new file should now be recognized correctly by ferret and you should be able to do as was mentioned before. You'll also notice that the variables for longitude and latitude have disappeared in ferret when the dataset is shown.

Cheers,
John

On 12 Jul 2007, at 23:10, Anup Sherchan wrote:

Dear ferret users
Thanks to all who replied but my problem still exists. I'm trying to create a harmonic analysis of tides. I chose some coordinates say California, England (1W, 54N ), Philippines and I want to have the plot of sea level [depth in meter] wrt time [days]. I can do so by choosing the location using ncview as seeing what the corresponding values of i and j at that position might be, but I want the exact coordinates, as 1 W, 54 N for Immingham, England.

/http://lpas.epfl.ch/MOD/manuals/ferret/chapter4.html/

/yes? SET DATA levitus_climatology
yes? SET REGION/X=180/Y=0                      ! true profile
yes? PLOT/Z=0:5000 temp
yes? DEFINE AXIS/DEPTH/Z=100:2000:100  zfalse
yes? DEFINE GRID/LIKE=temp/Z=zfalse  gfalse    ! false profile
yes? PLOT/Z=0:5000/OVERtemp[G=gfalse@ASN] /

The above mentioned weblink shows some similarity but doesn't work in my case, when I execute the first 3 lines as shown above, gives me the following error

/yes? show data/full
    currently SET data sets:
   1> ./ZETA.nc  (default)

name title I J K L LON longitude 1:120 1:101 ... ...
            degrees on grid GIH1 with -1.000000E+34 for missing data
            X=0.5:120.5  Y=0.5:101.5
LON_BOUNDS
1:4 1:120 1:101 ...
              on grid GIH2 with -1.000000E+34 for missing data
            X=0.5:4.5  Y=0.5:120.5  Z=0.5:101.5
LAT latitude 1:120 1:101 ... ...
            degrees on grid GIH1 with -1.000000E+34 for missing data
            X=0.5:120.5  Y=0.5:101.5
LAT_BOUNDS
1:4 1:120 1:101 ...
              on grid GIH2 with -1.000000E+34 for missing data
            X=0.5:4.5  Y=0.5:120.5  Z=0.5:101.5
TIME ... ... ... 1:8760
      (invalid coordinate axis)
day as %Y%m%d.%f on grid GIH3 with -1.000000E+34 for missing data

ZO sealevel 1:120 1:101 ... 1:8760
            m on grid GIH4 with -1.000000E+34 for missing data
            X=0.5:120.5  Y=0.5:101.5

 time range: 1 to 8760/
/yes? plot zo[l=1:8760]
**ERROR: dimensions improperly specified: specified data is not a line
          - its a 3D region: "plot zo[l=1:8760]"
yes? set region/x=1W/y=54N
yes? plot/l=1:8760 zo
**ERROR: illegal limits: "ZO" is not in the range X=359
         Axis extremes are X=0.5:120.5
/
Help needed. Thanks.

Anup Sherchan




[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement