[Thread Prev][Thread Next][Index]

Re: [ferret_users] Trying to visualize data on cubed-sphere grid



Hi Patrick,
In recent Ferret versions we tried to make sure axes have the same direction in all grids, and no longer use dimension names to set the direction of an axis, instead using the attributes of coordinate variables for determining directions. This hasn't been completely successful especially when the dimensions are not associated with coordinate variables but are given in the file only as dimensions.  It should do better, particularly putting the dimension that's marked as UNLIMITED in the time direction.

You have had trouble with these versions of Ferret and some of your datasets. Some of this we've discussed before; a vertex dimension is logically placed in these datasets "before" the X axis, which is not consistent with Ferret's grid.

For the Ki_cellsZT.nc dataset, we can open it as follows and I think use it successfully:

> ferret_v6842

yes? use/order=yzt Ki_cellsZT.nc
 *** NOTE:
 *** NOTE: Could not adjust grid for variable bounds_lon
 *** NOTE: Axes in grids may be inconsistent.
yes? sh dat
     currently SET data sets:
    1> ./Ki_cellsZT.nc  (default)
 name     title                             I         J         K         L         M         N
 LON      longitude                        ...       1:3612    ...       ...       ...       ...
 LAT      latitude                         ...       1:3612    ...       ...       ...       ...
 BOUNDS_LON
                                           ...       1:6       1:3612    ...       ...       ...
 BOUNDS_LAT
                                           ...       1:6       1:3612    ...       ...       ...
 KI                                        ...       1:3612    1:19      1:120     ...       ...
 

Patrick's dataset looks like this, with dimensions not coordinate axes for dimensions cell, Z, and time_counter:

> ncdump -h Ki_cellsZT.nc
netcdf Ki_cellsZT {
dimensions:
        cell = 3612 ;
        nvert = 6 ;
        Z = 19 ;
        time_counter = UNLIMITED ; // (120 currently)
variables:
        double lon(cell) ;
                lon:long_name = "longitude" ;
                lon:units = "degrees_east" ;
                lon:bounds = "bounds_lon" ;
        double lat(cell) ;
                lat:long_name = "latitude" ;
                lat:units = "degrees_north" ;
                lat:bounds = "bounds_lat" ;
        double bounds_lon(cell, nvert) ;
        double bounds_lat(cell, nvert) ;
        double Ki(time_counter, Z, cell) ;
                Ki:coordinates = "lon lat" ;
}



On 4/9/2013 9:43 AM, Patrick Brockmann wrote:
Hi all,

I come back on this issue because a solution is reachable
if you accept to see your map made with polygons.
Metadata has to be properly set as in the sampleGenGrid3.nc file.

Here is the simplest call.

yes? use sampleGenGrid3.nc
yes? set variable/units="degrees_east" BOUNDS_LON
yes? set variable/units="degrees_north" BOUNDS_LAT
yes? polygon/MODULO/COORD_AX=Y/line/fill/hlim=0:360 BOUNDS_LON, BOUNDS_LAT, SAMPLE

You get the attached image.
Not bad...

But now many problems occurs because ferret at version 6.84 does
mistakes when it sets the dimensions or is not consistent in its detection
depending there is or not a dimension Z or/and T.

Try :
yes? use Ki_cellsT.nc
yes? show data
     currently SET data sets:
    1> ./Ki_cellsT.nc  (default)
 name     title                             I         J         K         L         M         N
 KI                                        1:120     ...       ...       ...       ...       ...
 BOUNDS_LAT                                1:6       1:3612    ...       ...       ...       ...
 BOUNDS_LON            1:6       1:3612    ...       ...       ...       ...
LAT      latitude                         ...       1:3612    ...       ...       ...       ...
LON      longitude                        ...       1:3612    ...       ...       ...       ...

--> KI variable has no time dimension !!

yes? use Ki_cellsZT.nc
yes? show data
 *** NOTE:
 *** NOTE: Could not adjust grid for variable bounds_lon
 *** NOTE: Axes in grids may be inconsistent.
   2> ./Ki_cellsZT.nc  (default)
 name     title                             I         J         K         L         M         N
 LON      longitude                        1:3612    ...       ...       ...       ...       ...
 LAT      latitude                         1:3612    ...       ...       ...       ...       ...
 BOUNDS_LON
                                           1:6       1:3612    ...       ...       ...       ...
 BOUNDS_LAT
                                           1:6       1:3612    ...       ...       ...       ...
 KI                                        1:3612    1:19      1:120     ...       ...       ...

--> See now how dimension have been set (different as previous with )

And a last problem that occurs with excursion of polygons boundaries
because they may not set close to the center of the cell. It is not handle by ferret and
it is painfull to correct.

yes? use KI_cells.nc
yes? set variable/units="degrees_east" BOUNDS_LON
yes? set variable/units="degrees_north" BOUNDS_LAT
yes? polygon/MODULO/COORD_AX=Y/line/fill/hlim=0:360 BOUNDS_LON, BOUNDS_LAT, KI
yes? frame/file=Ki_cells.gif

--> See overlaps in attached image

All materials can be found from
http://dods.ipsl.jussieu.fr/brocksce/ferret_unstructuredgrid

Let me know if things are going better on those problems
or if I can correct then on my side by additionnal metadata.

Thanks
Patrick




I'm playing around with some data that's on a cubed-sphere grid, and am wondering if the description of the grid is causing the usual "Y coord field lies in different plane from data to be plotted" error when using the "shade ts,lon,lat" command.

The data of interest and the longitudes and latitudes are all described as one-dimensional vectors, i.e., a 1-D array of N points:

yes? use test.nc 
yes? show data
     currently SET data sets:
    1> ./test.nc  (default)
 name     title                             I         J         K         L         M         N
 TS       Surface temperature (radiative)  1:777602  ...       ...       1:1       ...       ...
 LAT      latitude                         1:777602  ...       ...       ...       ...       ...
 LON      longitude                        1:777602  ...       ...       ...       ...       …

and 'ncdump -h' shows:

prompt> ncdump -h test.nc | egrep "(lon|lat|TS)"
        float TS(time, ncol) ;
                TS:units = "K" ;
                TS:long_name = "Surface temperature (radiative)" ;
                TS:cell_methods = "time: mean" ;
        double lat(ncol) ;
                lat:long_name = "latitude" ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
        double lon(ncol) ;
                lon:long_name = "longitude" ;
                lon:units = "degrees_east" ;
                lon:axis = "X" ;

Giving lon and lat the appropriate "axis" attributes doesn't change anything about how FERRET sees the data.

Any suggestions appreciated!

Gary Strand
strandwg@xxxxxxxx





-- 
LSCE/IPSL, Laboratoire CEA-CNRS-UVSQ
Data Analysis and Visualization Engineer
ICMC - IPSL Climate Modelling Centre
--


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

Privacy Policy | Disclaimer | Accessibility Statement