[Thread Prev][Thread Next][Index]

Re: [ferret_users] Linking lon and lat with variable dimensions



Hi,
There is not a SAMPLEXYT_CURV_NRST function.  Though in Ferret there are usually better ways of doing things than using repeat loops, here is a job where you could make use of one.

If xpts, ypts, tpts are the sample locations tpts is in the same units and same time origin as the gridded variable, and they're all lists of numbers i=1:npts,  then it'd look something like this:

yes? repeat/range=1:`npts`/name=q (\
let tt = tpts[i=`q`]; \
let xx = xpts[i=`q`];\
let yy = ypts[i=`q`];\
 save/append/file=sampled.nc samplexy_curv_nrst(t_surf[t=`tt`],lo,la,x=`xx`,y=`yy`])

That isn't tested of course so it might not actually run.  Here you're asking Ferret to return the field at the time point, and calling the function with just a single x,y location.

-Ansley

On 9/16/2014 12:59 PM, Ge Peng - NOAA Affiliate wrote:
Hi Ansley,

SAMPLEXY_CURV_NRST looks promising. Is there a SAMPLEXYT_CURV_NRST function or something similar?

Thanks,

--- Peng

On Mon, Sep 15, 2014 at 4:58 PM, Ansley Manke <ansley.b.manke@xxxxxxxx> wrote:
Hi Peng,
This is a "curvilinear" grid, so you can use one of the functions for curvilinear data:

   yes? show functions *curv*

It sounds as if SAMPLEXY_CURV_NRST is probably the one you want.

Ansley


On 9/15/2014 12:37 PM, Ge Peng - NOAA Affiliate wrote:
Hi,

I have several datasets with different, non-standard polar-stereographic projections. Info from one data set is provided below.

I would like to get help in linking lon and lat with variable dimensions to extract values along a ship-track (time, lat, lon) which is irregular in time and space.

Suggestions on extracting methods are also appreciated - samplexyt is using linear interpolation and I would like to use value from the nearest data point instead.

Please let me know if you need any additional information.

Thanks,

--- Peng

The ferret show data command for one data set shows the following:

currently SET data sets:
    1> ./APPx_n025_Tsurf_Cld_daily_1400.nc  (default)
 name     title                             I         J         K         L
 LA       Latitude                         1:361     1:361     ...       ...
 LO       Longitude                        1:361     1:361     ...       ...
 T_SURF   daily APPx Surface Temperature   1:361     1:361     ...       1:365

Both lo and la are 2-dimension arrays and are not the same for all i and j indices.

And ncdump -h gives the following:

netcdf APPx_n025_Tsurf_Cld_daily_1400 {
dimensions:
        COLUMNS = 361 ;
        bnds = 2 ;
        ROWS = 361 ;
        TIME = UNLIMITED ; // (365 currently)
variables:
        double COLUMNS(COLUMNS) ;
                COLUMNS:point_spacing = "even" ;
                COLUMNS:axis = "X" ;
                COLUMNS:bounds = "COLUMNS_bnds" ;
        double COLUMNS_bnds(COLUMNS, bnds) ;
        double ROWS(ROWS) ;
                ROWS:point_spacing = "even" ;
                ROWS:axis = "Y" ;
                ROWS:bounds = "ROWS_bnds" ;
        double ROWS_bnds(ROWS, bnds) ;
        float LA(ROWS, COLUMNS) ;
                LA:missing_value = -1.e+34f ;
                LA:_FillValue = -1.e+34f ;
                LA:long_name = "Latitude" ;
                LA:units = "degrees_north" ;
        float LO(ROWS, COLUMNS) ;
                LO:missing_value = -1.e+34f ;
                LO:_FillValue = -1.e+34f ;
                LO:long_name = "Longitude" ;
                LO:units = "degrees_east" ;
        double TIME(TIME) ;
                TIME:units = "day since 1997-01-01 14:00:00" ;
                TIME:time_origin = "01-JAN-1997 14:00:00" ;
                TIME:axis = "T" ;
                TIME:bounds = "TIME_bnds" ;
        double TIME_bnds(TIME, bnds) ;
        float T_SURF(TIME, ROWS, COLUMNS) ;
                T_SURF:missing_value = 999.9f ;
                T_SURF:_FillValue = 999.9f ;
                T_SURF:long_name = "daily APPx Surface Temperature (K)" ;
                T_SURF:history = "From APPx_n025_All_daily_1400" ;


--
Ge Peng, Ph.D
Research Scholar
Cooperative Institute for Climate and Satellites NC
North Carolina State University
NOAA's National Climatic Data Center
151 Patton Ave, Asheville, NC 28801
ge.peng@xxxxxxxx
o: +1 828 257 3009
f:  +1 828 257 3002

Following CICS-NC on Facebook







--
Ge Peng, Ph.D
Research Scholar
Cooperative Institute for Climate and Satellites NC
North Carolina State University
NOAA's National Climatic Data Center
151 Patton Ave, Asheville, NC 28801
ge.peng@xxxxxxxx
o: +1 828 257 3009
f:  +1 828 257 3002

Following CICS-NC on Facebook





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

Privacy Policy | Disclaimer | Accessibility Statement