!
! Get time increment of original data to construct regular "original" axis
!
LIST/CLOBBER/NOHEAD/L=1/FILE=dinc.txt TBOX[G=AIR_TEMPERATURE]
SPAWN echo DEFINE SYMBOL DINC \"\`cat dinc.txt\`\" > dinc_output.jnl
GO dinc_output.jnl
SPAWN rm dinc_output.jnl
SPAWN rm dinc.txt
DEFINE SYMBOL TORG = TIME_ORG
DEFINE AXIS/T=($DMIN):($DMAX):($DINC)/T0="01-JAN-1970 00:00:00"/UNITS=seconds ($TORG)
!
! Regrid WIND_SPEED to regular original DINC axis then to hourly time grid
!
LET WIND_SPEED_ORG = WIND_SPEED_2[gt=($TORG),gy=($YOUT),gx=($XOUT)]
LET WIND_SPEED_HR = WIND_SPEED_ORG[gt=($TOUT)@AVE,gy=($YOUT),gx=($XOUT)]
-----Original Message-----Hi Mike,
From: Ansley Manke [mailto:ansley@pmel.noaa.gov]
Sent: Friday, January 10, 2003 11:08 AM
To: McCann, Mike
Cc: ferret_users@ferret.wrc.noaa.gov
Subject: Re: Gaps and @AVE regridding transform
This is happening because of the irregular time axis on the
input data. If you list the variable you're regridding, you'll
see that in general the data is at 10-minute intervals, but
where this gap appears, there is a time-axis gap of several
hours. The Pseudo-variable TBOX shows this well. List
wind_speed_2 and tbox[gt=wind_speed_2] together:yes?list/t="22-sep-1997:16:00":"23-sep-1997:01:00" wind_speed_2, tbox[gt=wind_speed_2]
DATA SET: ./w2.nc
TIME: 22-SEP-1997 16:00 to 23-SEP-1997 01:00
LONGITUDE: 122W(-122)
LATITUDE: 36.8N
DEPTH (m): 3.5
Column 1: WIND_SPEED_2 is WIND_SPEED * WIND_SPEED_1F
Column 2: TBOX is TBOX (axis TIME)
WIND_SPE TBOX
22-SEP-1997 16:06:52 / 6761: 3.025 600.
22-SEP-1997 16:16:52 / 6762: 2.435 600.
22-SEP-1997 16:26:52 / 6763: 1.850 600.
22-SEP-1997 16:36:52 / 6764: 2.044 600.
22-SEP-1997 16:46:52 / 6765: 2.362 600.
22-SEP-1997 16:56:52 / 6766: 1.813 600.
22-SEP-1997 17:06:52 / 6767: 2.975 600.
22-SEP-1997 17:16:52 / 6768: 3.196 12994.
23-SEP-1997 00:19:59 / 6769: .... 12994.
23-SEP-1997 00:29:59 / 6770: 6.215 600.
23-SEP-1997 00:39:59 / 6771: 5.449 600.
23-SEP-1997 00:49:59 / 6772: 6.268 600.
23-SEP-1997 00:59:59 / 6773: 5.573 600.The @AVE regridding will use the portion of grid cell on the
original axis which overlaps each grid cell on the output axis.
The input axis here has a large grid box with data value 3.196
at the location in question, so the value 3.196 is the result for
the output hourly axis at all the hours corresponding to any part
of that cell. List WIND_SPEED_AVG and WIND_SPEED_LIN
to see this.yes?list/t="22-sep-1997:16:00":"23-sep-1997:01:00" wind_speed_avg, wind_speed_lin
DATA SET: ./w2.nc
TIME: 22-SEP-1997 16:00 to 23-SEP-1997 01:00
LONGITUDE: 122W(-122)
LATITUDE: 36.8N
DEPTH (m): 3.5
Column 1: WIND_SPEED_AVG is WIND_SPEED_2[GT=TIME_HR@AVE]
Column 2: WIND_SPEED_LIN is WIND_SPEED_2[GT=TIME_HR@LIN]
WIND_SPEWIND_SPE
22-SEP-1997 16:00 / 1271: 2.237 2.218
22-SEP-1997 17:00 / 1272: 2.578 2.177
22-SEP-1997 18:00 / 1273: 3.196 ....
22-SEP-1997 19:00 / 1274: 3.196 ....
22-SEP-1997 20:00 / 1275: 3.196 ....
22-SEP-1997 21:00 / 1276: 3.196 ....
22-SEP-1997 22:00 / 1277: .... ....
22-SEP-1997 23:00 / 1278: .... ....
23-SEP-1997 00:00 / 1279: 6.215 ....
23-SEP-1997 01:00 / 1280: 5.909 5.573A solution might be to regrid the input data to a regular grid,
where the missing data would be represented on many 10-minute
grid cells, and then the @AVE regridding would use only data from
the same hour as the output grid.Ansley Manke
"McCann, Mike" wrote:
Hello ferret users,I've encountered a little problem in re-gridding a 10-minute gappy time series to a 1-hour axis using the @AVE transform. Here's a ferret script that shows the problem:
USE "http://dods.mbari.org/cgi-bin/nph-nc/data/OASISdata/deployments/m1/199705/m1/netcdf/m1_metsys_19970731.nc"
DEFINE SYMBOL DMIN = "31-JUL-1997 18:00"
DEFINE SYMBOL DMAX = "24-SEP-1998 21:00"
LET BAR = y[gy=LATITUDE] ! Scalar for below
LET FOO = x[gx=LONGITUDE] ! Scalar for below
DEFINE SYMBOL TOUT = TIME_HR
DEFINE SYMBOL YOUT = LATITUDE_MET_HR
DEFINE SYMBOL XOUT = LONGITUDE_MET_HR
DEFINE AXIS/T=($DMIN):($DMAX):3600/T0="01-JAN-1970 00:00:00"/UNITS=seconds ($TOUT)
DEFINE AXIS/Y/UNITS=deg ($YOUT)=BAR
DEFINE AXIS/X/UNITS=deg ($XOUT)=`FOO+360`
SET AXIS/MODULO LONGITUDE LONGITUDE[L=1]! Change missing data flag so that it's not 1
LET WIND_SPEED_1 = missing(WIND_SPEED_FLAG, -9999)!
! Catch all flags. Good data set to 1
!
LET WIND_SPEED_1F = IF WIND_SPEED_1 EQ 0 THEN 1
LET WIND_SPEED_2 = WIND_SPEED * WIND_SPEED_1F!
! Regrid WIND_SPEED to new time grid
!
LET WIND_SPEED_AVG = WIND_SPEED_2[gt=($TOUT)@AVE,gy=($YOUT),gx=($XOUT)]LET WIND_SPEED_LIN = WIND_SPEED_2[gt=($TOUT)@LIN,gy=($YOUT),gx=($XOUT)]
SET REGION/T=22-sep-1997:24-sep-1997
PLOT WIND_SPEED_2
PLOT/OV WIND_SPEED_AVG, WIND_SPEED_LINWIND_SPEED_AVG has a value of 120.7 after the 7 hour gap that begins at 1800 on Sep 22. There also appears to be "invented" values at the beginning of the gap. Perhaps I don't understand the use of the @AVE transform for doing this re-gridding. Is there something better I should be using?
Thanks in advance for any help.
-Mike
--
Mike McCann (mccann@mbari.org)
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--
Ansley Manke Pacific Marine Environmental Laboratory Seattle WA (206)526-6246