[Thread Prev][Thread Next][Index]

Re: a problem with FFTA



Hi Antonio,
The FFT functions require that  he time axis be regular; that is,
have constant time steps.  The COADS data you're using has a
monthly axis where different months have different lengths.  If you
say "SHOW GRID sst", you will see that in the "# points" column the
listing is "456 i", with the i indicating an irregular axis.   (In the FFT
demo, the monthly Navy winds are already on a regular time axis.)

You can regrid sst to a regular time axis, and then call FFTA.   Something
along these lines will solve your problem:

!  here is one of the COADS datasets; accessed via DODS

use "http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/coads/1degree/global/enh/sst.mean.nc";

!   Use SHOW GRID to get the range of time.  Define a regular
!   time axis and regrid the sst data to it.

SHOW GRID sst
DEF AXIS/T=01-JAN-1960:01-DEC-1997:1/UNITS=months regt
LET reg_sst = sst[GT=regt]

SHOW GRID reg_sst

!   Define the time series for which to compute the FFT
LET fft_sst = reg_sst[x=10w:6w@ave,y=45n:38n@ave]
PLOT fft_sst

!   Compute and plot the FFT series.
LET fft_sstfft = FFTA(fft_sst[l=1:456])
PLOT fft_sstfft
Ansley Manke

arv@ono.com wrote:

> Hi,
>
> I've followed the instructions within the demo file:  ef_fft_demo.jnl
>
> My data is as follows:
>
> yes? show data/variables
>      currently SET data sets:
>     1> ./sst38N_34N.10W_6W.nc  (default)
>      COADS 1-degree Enhanced
>  name     title                             I         J
> K         L
>  SST      Sea Surface Temperature Monthly  1:4       1:4       ...
> 1:456
>              degC on grid GOV1 with 650.31 & 32766 for missing data
>              X=10W:6W  Y=34N:38N
>
>   time range: 01-JAN-1960 00:00 to 01-DEC-1997 00:00
>
> so I've made:
>
> LET FFT_sst = sst[x=10w:6w@ave,y=34n:38n@ave]
> LET FFT_sstfft = ffta(FFT_sst[l=1:456])
>
> then
>
> PLOT FFT_sstfft
>
> and I get:
>
> yes? plot FFT_sstfft
>
> Bailing out of external function "ffta":
>          Time axis must be a regular axis
>  **ERROR: : error in external function
>
> Any idea. I think I've set right the time axis and if I plot just
> FFT_sst I get the right graphic
>
> Thanks
>
> Antonio Rodríguez

--
Ansley Manke  Pacific Marine Environmental Laboratory  Seattle WA  (206)526-6246




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement