[Thread Prev][Thread Next][Index]

[ferret_users] More specific question on time series overlay wrt Grid Transformation and Definition



Dear Ferret User Group:

OK ...after a more thorough search....I understand that in order to place (overlay) a second time series, I need to re-grid the second variable to the time grid that is specified by the first time axis...here are the commands I am using to do so and I am still getting only one plot in the figure. Any pointers are greatly appreciated.

!For first data block  in ASCII file...($3 is the variable I want to plot specified by Column name)

DEFINE axis/T/T0=1-jan-2001/UNIT=DAYS ttaxis_days_1=tstep_1[L=1:`nntime_1`]    !nntime_1 is read from file
LET dummy_1   = t[GT=ttaxis_days_1]
LET new_var_1 = RESHAPE($3,dummy_1)

list new_var_1  ! Prints out the correct values

DEFINE GRID/T=ttaxis_days_1 gttaxis_1
LET dummy_11  = t[GT=gttaxis_1]
LET new_var_11 = RESHAPE($3,dummy_11)

! For Second Data Block in ASCII file
! Read File for Station = S2 and DataProduct/Dataset =D1
! Move Back to beginning of ASCII File

CANCEL DATA "$1"

!...SKIP the first data block and read second one etc!

DEFINE axis/T/T0=1-jan-2001/UNIT=DAYS ttaxis_days_2=tstep_2[L=1:`nntime_2`]  !nntime_2 is also read from file and is NE nntime_1
LET dummy_2   = t[GT=ttaxis_days_2]
LET new_var_2 = RESHAPE($3,dummy_2)

! Now re-gridding second Time Series Variable new_var_2 to time axis ttaxis_days_1 (defined above)

DEFINE GRID/T=ttaxis_days_1 gttaxis_2
LET dummy_21  = t[G=gttaxis_2]
LET new_var_21 = RESHAPE($3,dummy_21)

list new_var_11, new_var_21

! Unfortunately, the above diagnostic shows identical values for new_var_11 and new_var_21...this is should not be the case

! Make the Time Series Plots as unconnected symbols with different colors

PLOT /NOLAB/THICKNESS=3/SIZE=0.2/SET new_var_11, new_var_21[g=gttaxis_1, gt=@asn]
!PPL TXLINT,1,0
PPL pen 1,2                   ! set pen 1 color to 2 (red)
PPL line 1,19,3               ! set line 1 to symbol #19, unconnected
PPL pen 2,3                   ! set pen 2 color to 3 (green)
PPL line 2,17,3               ! set line 2 to symbol #17, unconnected
PPL PLOT

! creat gif file
! Create a GIF file in local directory
FRAME/FILE="$2"
SPAWN chmod ugo+rw "$2"

quit

Thanks to any insights.
agdc2005


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement