Hi -
My apologies. I made an editing error like I think you had done, originally!
You have commands which define the FFT variables, but the script you had is making a plot so it lists pairs of variables to plot. It has defined variables including "per", "fft_uwnd", and "FFT_uwndfftp"
So all you need is
Or if you want to rename variables you could do this, but watch out about variable names, there is already a variable called A in the script, so if you do a "LET A = " definition, you'd redefine that existing variable and ruin the calculation.!Save fft period unitsave/file=fft_period.nc per[l=1:`FFT_nf`], fft_uwnd
!Save phase in period unitsave/file=phase_period.nc per[l=1:`FFT_nf`], FFT_uwndfftp
!Save fft period unit
let AOUT = fft_uwnd
save/file=fft_period.nc per[l=1:`FFT_nf`], AOUT
!Save phase in period unitlet BOUT = FFT_uwndfftpsave/file=phase_period.nc per[l=1:`FFT_nf`], BOUT
On 8/2/2012 3:16 PM, antonio avio wrote:
Hallo,
Thanks Ansley for the reply,The main goal is to save the fft and phase from spectral analysis which have period unit in x axis.
Yes, I also did the same thing, but i still got the error message,After compiling i got this error:
**ERROR: command syntax: per[l=1:378], fft_uwndDefinition contains multiple expressionsDEFINE VARIABLE A = per[l=1:378], fft_uwndCommand file, command group, or REPEAT execution aborted
Thanks for the helps,Antonio
On Thu, Aug 2, 2012 at 9:36 PM, Ansley Manke <ansley.b.manke@xxxxxxxx> wrote:
Hi
You are using "SET_UP per" as if it's a variable name. The error message is telling you that variable names in Ferret cannot have a space in them.
Do you mean to say this?
!Save fft in period unitlet A = per[l=1:`FFT_nf`], fft_uwnd
On 8/2/2012 10:58 AM, antonio avio wrote:
Hallo,I wonder why I got this error when i wanted to save the results of FFT analysis (period unit not frequency) in different nc files:
!Save fft in period unitlet A = SET_UP per[l=1:`FFT_nf`], fft_uwnd!-> DEFINE VARIABLE A = SET_UP per[l=1:378], fft_uwnd**ERROR: command syntax: SET_UP per[l=1:378], fft_uwndSET_UP before per[l=1:378] is illegalDEFINE VARIABLE A = SET_UP per[l=1:378], fft_uwndCommand file, command group, or REPEAT execution aborted
Here is my command:
[SNIP]!converting to Period! Get the frequency increment used in the FFT.LET FFT_nf = `fft_uwnd,return=lend`LET FFT_nyquist = 0.5LET FFT_freq1 = FFT_nyquist/ FFT_nf
! Define a frequency axis.DEFINE AXIS/T=`FFT_freq1`:`FFT_nyquist`:`FFT_freq1` FAXISDEFINE GRID/T=FAXIS gfftfreqLET a = T[g=gfftfreq]
! Define the period from the frequency axis.LET per = 1./a
! Plot period vs FFT Amplitudes showing the first 24 months where most of the energy is.! The PPL commands clean up the appearance of the plot.
SET VIEW urPLOT/VS/LINE/HLIMITS=0:32:2/TITLE="Amplitude Spectrum"/SET_UP per[l=1:`FFT_nf`], fft_uwndPPL XFOR (I2)PPL XLAB Period, months/cyclePPL YLABPPL PLOT!****************************************************************************************************! Compute and plot the phase using fftp.
LET FFT_uwndfftp = fftp(fft_u[l=1:757])SET VARIABLE/TITLE="FFT Phase"/UNITS="deg" FFT_uwndfftp
SET VIEW llPLOT FFT_uwndfftp
SET VIEW lrPLOT/VS/LINE/HLIMITS=0:32:2/TITLE="FFT Phase"/SET_UP per[l=1:`FFT_nf`],FFT_uwndfftpPPL XFOR (I2)PPL XLAB Period, months/cyclePPL YLAB DegPPL PLOT
!Save fft period unitlet A = SET_UP per[l=1:`FFT_nf`], fft_uwndsave/file=fft_period.nc A
!Save phase in period unitlet B = SET_UP per[l=1:`FFT_nf`], FFT_uwndfftpsave/file=phase_period.nc B
!**********************************************************************************Thanks for your help.
Antonio.