[Thread Prev][Thread Next][Index]

Re: [ferret_users] regriding from discontinuous time axis



Hi Ferreters

I've tried Russ' solution, but I can not make it work (the XACT transformation doesn't work in my case).

Here is an example again :

Let time = {\
 22585.3295833333,\
 22585.3302777778,\
 22585.3309722222,\
 22585.3316666667,\
 22585.3323611111,\
 22585.3330555556,\
 22585.33375,\
 22585.3344444444,\
 22585.3351388889,\
 22585.3358333333}

Define Axis /T /From /T0=1-JAN-1950 /Units=days my_axis = time

Let var = TSEQUENCE( RANDU( time ) )
Let fake_var = T[GT=my_axis]
Let var_regrid = RESHAPE( var, fake_var )

List /T="2-nov-2011 07:54":"2-nov-2011 08:04" var_regrid
! Here I obtain 10 values

! New time axis
Define Axis /T="01-NOV-2011 00:00":"30-NOV-2011 23:00":1 /Units=seconds /T0=1-JAN-1950 t_axis_seconds

Let var_sec = var_regrid[ GT=t_axis_seconds@XACT ]

List /T="2-nov-2011 07:54":"2-nov-2011 08:04" var_sec
! Here I obtain 600 missing values and no good ones (I should have 10)



I use Ferret 6.82.

What's wrong ?

Thank you for your help,

Bruno Levier



On 09/10/2012 04:46 AM, Russ Fiedler wrote:
Hi Bruno,

If you define a continuous grid which contains the original points as a
subset you can use the @XACT remapping. In your example this would
require a time grid with intervals of half a day.

Def Axis/T=01-JAN-2000:13-JAN-2000:0.5/Units=days/T0=1-JAN-2000
my_axis_1dAV_half

Plot /Over /Line /Sym=20 /Co=2 var_regrid[ GT=my_axis_1dAV_half@XACT ]

To go to a daily grid I think remapping in 2 steps may be what you want

! Data at half day intervals. Missing vals if we don't match.
let tempvar_half = var_regrid[ GT=my_axis_1dAV_half@XACT ]
! Average onto a daily grid.
let tempvar_full = tempvar_half [ GT=my_axis_1dAV@AVE ]

Russ


On Fri, 2012-09-07 at 18:39 +1000, Bruno Levier wrote:
Hi Ferreters

I would like to regrid a variable on a new time axis. The problem is
that the source grid is discontinuous (with gaps of several days) ; the
tranformation fills the gap with interpolated or averaged values
(depending of the transformation used). Is it possible to avoid this
behaviour (I mean fill the gap with missing values) ?

Here is an example :
! Discontinuous time axis from January 1 to January 12 (no values from 3
to 10)
Let time = {0,0.5,1.0,1.5,2.0,10.0,10.5,11.0,11.5,12.0}
Define Axis /T /From /T0=1-JAN-2000 /Units=days my_axis = time

Let var = TSEQUENCE( RANDU( time ) )
Let fake_var = T[GT=my_axis]
Let var_regrid = RESHAPE( var, fake_var )

! New time axis
Define Axis /T=01-JAN-2000:13-JAN-2000:1 /Units=days /T0=1-JAN-2000
my_axis_1dAV

Plot /Line /Sym=18 var_regrid
! Now each day has a good value
Plot /Over /Line /Sym=20 /Co=2 var_regrid[ GT=my_axis_1dAV@AVE ]

Thanks !

Bruno






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

Privacy Policy | Disclaimer | Accessibility Statement