[Thread Prev][Thread Next][Index]

RE: How to extract length of axis to a symbol?



Steve,

Thanks.  That was too simple for me to consider.  For the mail
archive, it works with:

SAVE/FILE="m1_adcp.nc"/APPEND U_VEL_COMP[T="$TSTART":"$TEND"]
                                         ^ (not L)
-Mike

--
Mike McCann   (mccann@mbari.org)
Group Leader, Information Applications Group
Monterey Bay Aquarium Research Institute
7700 Sandholdt Road
Moss Landing, CA 95039-9644
Voice: (831) 775-1769   Fax: (831) 775-1646 http://www.mbari.org/rd/iag.htm


> -----Original Message-----
> From: Steve Hankin [mailto:hankin@pmel.noaa.gov]
> Sent: Tuesday, April 03, 2001 6:03 PM
> To: McCann, Mike
> Cc: 'Andrew Wittenberg'; ferret_users
> Subject: Re: How to extract length of axis to a symbol?
> 
> 
> Hi Mike,
> 
> If I am understanding you correctly, what you are after is to 
> know what the time
> index range becomes for a slug of data *after* it is regridded.
> 
> It is easy to find the date range (as opposed to index range) 
> and use it as
> follows:
> 
>      define symbol tstart `U_COMPONENT,return=tstart`
>      define symbol tend `U_COMPONENT,return=tend`
>      SAVE/FILE="m1_adcp.nc"/APPEND U_VEL_COMP[L="$TSTART":"$TEND"]
> 
> The date range after regridding will in some cases be smaller 
> than before
> regridding, since linear interpolation is not possible at the 
> endpoints of the
> source data. However, if the date ranges of the files that 
> you are appending are
> non-overlapping, I think the above procedure should work 100%.
> 
>     - steve
> 
> =====================================
> 
> "McCann, Mike" wrote:
> 
> > Andrew, Ansley, et al.-
> >
> > Thanks!   That define works.  Now I need a little help
> > getting the index range of a regridded variable.  The
> > first section below writes a new netCDF file and then
> > I want to append to it with additional data, yet unless
> > I specify the index range the first set of data gets
> > overwritten by the no_data values from the 2nd set of data.
> >
> > LET V_VEL_COMP = V3[gt=TNEW@LIN]
> > SAVE/FILE="m1_adcp.nc"/LLIMITS=1:($NTIME)/CLOBBER 
> U_VEL_COMP,V_VEL_COMP
> >
> > USE
> > 
> "/hosts/tornado/vol/vol0/oasis/deployments/m1/199606/m1/netcdf
> /m1_adcp_19960
> > 110_NarrowBand.nc"
> > LET U1 = missing(U_COMPONENT_FLAG, -9999)
> > LET U2 = IF U1 EQ 0 THEN 1
> > LET U3 = U_COMPONENT * U2
> > LET U_VEL_COMP = U3[gt=TNEW@LIN]
> > LET V1 = missing(V_COMPONENT_FLAG, -9999)
> > LET V2 = IF V1 EQ 0 THEN 1
> > LET V3 = V_COMPONENT * V2
> > LET V_VEL_COMP = V3[gt=TNEW@LIN]
> >
> > (How do I get the $LSTART & $LEND values that are needed for this?)
> >
> > SAVE/FILE="m1_adcp.nc"/APPEND
> > U_VEL_COMP[L=$LSTART:$LEND],V_VEL_COMP[L=$LSTART:$LEND]
> >
> > Again, thanks in advance,
> > Mike
> >
> > --
> > Mike McCann   (mccann@mbari.org)
> > Group Leader, Information Applications Group
> > Monterey Bay Aquarium Research Institute
> > 7700 Sandholdt Road
> > Moss Landing, CA 95039-9644
> > Voice: (831) 775-1769   Fax: (831) 775-1646 
http://www.mbari.org/rd/iag.htm
>
> > -----Original Message-----
> > From: Andrew Wittenberg [mailto:andyw@splash.Princeton.EDU]
> > Sent: Tuesday, April 03, 2001 2:58 PM
> > To: McCann, Mike
> > Cc: ferret_users
> > Subject: Re: How to extract length of axis to a symbol?
> >
> >
> > On Tue, 3 Apr 2001, McCann, Mike wrote:
> >
> > > After defining an axis, e.g.:
> > >
> > > DEFINE AXIS/T=($TMIN):($TMAX):7200/UNITS=seconds TNEW
> > >
> > > How do I get the number of points in the axis and assign
> > > the number to a symbol?
> >
> > Hi Mike,
> >
> > Give this a try:
> >
> > yes? define symbol num_points `t[gt=tnew],r=lsize`
> > yes? say ($num_points)
> >
> > Andrew
> >
> > ----------------------------------------------------------------------
> > Andrew Wittenberg          Program in Atmospheric and Oceanic Sciences
> > andyw@splash.princeton.edu                        Princeton University
> > ----------------------------------------------------------------------
> >
> >

--

                |  NOAA/PMEL               |  ph. (206) 526-6080
Steve Hankin    |  7600 Sand Point Way NE  |  FAX (206) 526-6744
                |  Seattle, WA 98115-0070  |  hankin@pmel.noaa.gov



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement