[Thread Prev][Thread Next][Index]

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



Hi Patrick,
About the polygon command, I believe that Ferret does fill in the polygons that are defined. In the dataset Ki_cells.nc, I see cells where the longitude values cross the branch cut. We would want to make some correction, when we detect that this is what's happening.  So for this cell,

yes? use Ki_cells
yes? list/j=2171 bounds_lon
             VARIABLE : BOUNDS_LON
             FILENAME : Ki_cells.nc
             SUBSET   : 6 points (X)
             Y        : 2171
           2171  
          2171
 1   / 1:  174.5
 2   / 2:  167.6
 3   / 3:  172.1
 4   / 4: -172.1
 5   / 5: -167.6
 6   / 6: -174.5

we should correct the longitudes.  What comes to my mind is an external function, where we pass in the longitude vertex coordinates and a tolerance for the size of jump that will mark the vertex locations for a correction, and the return for a cell like this would be corrected, but a cell such as

 1   / 1:   -5.5
 2   / 2:  -12.4
 3   / 3:   -7.9
 4   / 4:    7.9
 5   / 5:   12.4
 6   / 6:    5.5

would not change.  Does that sound like a reasonable solution? It seems to me that trying to put automated logic into the polygon plot code itself might lead to results that wouldn't be well suited to all grids.

--Ansley


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