[Thread Prev][Thread Next][Index]

Re: [ferret_users] Getting LAT and LON to be dimensions of a Variable

IF the latitudes are the same at all i, and the longitudes are the same at all j,  you can define coordinate axes from one line of the lon,lat grids:

   yes? DEFINE AXIS/X/units=degrees_east lon_axis = lon[j=1]
   yes? DEFINE AXIS/Y/units=degrees_north lat_axis = lat[i=1]

Now there are several ways to think of a "monthly axis".  Is this model data? What calendar did they use? Some use a 360-day calendar with 30-day months.  Others may use a Gregorian calendar, or one with leap years, but not making other corrections.  Here's one way to do it, with the standard Proleptic Gregorian calendar and equal-length months (we could set /units= or /t0= but I've let Ferret set those using its defaults).

   yes? DEFINE AXIS/T=1-jan-1999:31-dec-2008/edges/npoints=120 time_axis
   yes? list t[gt=time_axis]

Then you can define a sst variable on these axes, and Ferret plots will be labeled with longitude, latitude and time.

   yes? LET/TITLE="Sea Surface Temperature"/UNITS="degC" sst2  = sst[gx=lon_axis@asn,gy=lat_axis@asn,gt=time_axis@asn]


On 8/7/2014 5:20 PM, Molulaqhooa Maoyi wrote:
Thank you Ansley for the reply

Yes the Lat and Lon are the same for i and j respectively.

Here is the ncdump I did on my netcdf file:

The time is monthly data from 1999 to 2008

netcdf ROMS_SST{
M = 194 ;
L = 230 ;
TDIM = 120 ;
double lat(M, L) ;
lat:long_name = "latitude" ;
lat:units = "degN" ;
double lon(M, L) ;
lon:long_name = "longitude" ;
lon:units = "degE" ;
double SST(TDIM, M, L) ;
SST:long_name = "Sea Surface Temperature" ;
SST:units = "degC" ;

On Fri, Aug 8, 2014 at 1:51 AM, Ansley Manke <ansley.b.manke@xxxxxxxx> wrote:
Hi Molulaqhoo,
We have plans to handle data on "curvilienar grid" such as this transparently, using attributes in the dataset. This is not yet implemented. For now you need to do the 3-argument FILL command, with one exception.  Some grids  are defined this way but are in fact rectilinear.  If the latitudes are the same at all values of i in the grid, and the longitudes are the same at all values of j in the grid, then it'd be a matter of defining 1-D coordinate axes; we can help you do that.

The axis that is being marked as a K axis doesn't have attributes that tell Ferret to mark it as a time axis.  Is there a coordinate variable for the dimension of length 120 in the file?  The Unix command ncdump would help us understand what is in the file:
> ncdump -h filename.nc
You could initialize the file in Ferret with the /ORDER=   qualifier:
yes? use/order=xyt  filename.nc
and then if the data should have a formatted  time axis, you could use the DEFINE AXIS command, setting up a T axis of length 120, with the correct units and time origin, then put the data onto that axis with a command like:
yes? let new_sst = sst[gt=time_axis@asn]

On 8/7/2014 3:05 PM, Molulaqhooa Maoyi wrote:
Dear all

I am new into ferret and I have two questions:

I am battling to get the SST data to include LAT and LON dimension instead of them  being separate. I would like to do a fill on the SST data without having to specify LAT and LON e.g fill SST[k=1], LON,LAT

 name     title                                  I              J         K         L         M         N
 LAT      latitude                             1:230     1:194     ...       ...       ...       ...
 LON      longitude                          1:230     1:194     ...       ...       ...       ...
 SST      Sea Surface Temperature  1:230     1:194     1:120     ...       ...       .
My second question is how to move a dimension from K to L on the SST variable.


"Try and Fail than to Fail to Try" - Israel Maoyi

"Try and Fail than to Fail to Try" - Israel Maoyi

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

Privacy Policy | Disclaimer | Accessibility Statement