[Thread Prev][Thread Next][Index]
Re: working with JJAS time period of different years
Hi Roxy,
The FAQ suggested by Ansley explains the basic method to get
seasonal data. I just want to add an easy way to pick the "L" or "T" for
the desired(here JJAS) season of each year and create new variables : one
with only JJAS data (no information about other months) and other one with
missing values for rest of the months.
From your mail....
> var=precip[t=01-jun-1998:30-sep-1998]
> save/file=precip_jjas.cdf var
To precip_jjas.cdf you can't add data(var) for jun-sep1999. For
doing this you must have opened precip_jjas.cdf with proper "LLIMITS"
so that you can add "var" for other time periods to this file. If you
want more information please refer user manual Ch10 Sec2 & this mail
in the archive
http://ferret.pmel.noaa.gov/Ferret/Mail_Archives/fu_2001/msg00282.html
!----------extract_jjas.jnl-------------
! let us make some dummy data (pentad)
define axis/t="01-JAN-1998":"31-DEC-2002":5/unit=days tpent
let myvar = sin(t[gt=tpent]/250)
set var/title="Pentad Rainfall data 1998-2002"/units="mm/day" myvar
! get T0 & time units of the variable for later use
define symbol tzero = `myvar,return=T0`
define symbol tunits = `myvar,return=TUNIT`
! get the "time values" of JJAS from 1998 to 2002 in a text file
sp rm -f dummy.dat
REPEAT/L=1998:2002 ( ;\
set reg/t="01-JUN-`L`":"30-SEP-`L`" ;\
let tim = t[gt=myvar] ;\
list/nohead/quiet/file=dummy.dat/format=(2x,f8.2)/append tim ;\
)
! read the time values from dummy.dat and do the "exact" regridding
cancel reg/all ; cancel var tim
file/var=tim dummy.dat
define axis/t/T0=($tzero)/units=($tunits)/from_data tax=tim
let var_jjas = myvar[gt=tax@xact]
! above variable doesn't have any information about months other
! than JJAS...hence while plotting Ferret will linearly interpolate
! the values for those missing months
let rain = var_jjas[gt=myvar@xact]
! above variable will have the information "missing_value" for
! months other than JJAS..hence Ferret will not perform any
! interpolation
set var/title="Seasonal(JJAS) Rainfall"/units="mm/day" rain
! cross-checking
plot/line=4/dash myvar
plot/ov rain
! save to a netCDF file
! save/file=rain_JJAS.nc/append rain
! remove the dummy file
sp rm -f dummy.dat
!-------end of extract_jjas.jnl----------------------
Hope This Helps
With Regards
Jaison
On 23 Aug 2004, Roxy Mathew wrote:
> Hi Ferreters, I have a netcdf file with precipitation
> from Jan 1998 to Dec 2002 (pentad values).
> I want but to work with the JJAS time period only.
> Is there any way I can extract the JJAS time period
> of all the years to a new netcdf file?
> Or is there another way I can process the JJAS months
> together?
> I tried with the following method but it is not working:
>
> var=precip[t=01-jun-1998:30-sep-1998]
> save/file=precip_jjas.cdf var
> var=precip[t=01-jun-1999:30-sep-1999]
> save/append/file=precip_jjas.cdf var
>
> Thanks for any help :) Cheers, Roxy
>
> EES, Hokkaido University
> Sapporo, Japan
>
--
___________________________________________________
Jaison Kurian
Centre for Atmospheric and Oceanic Sciences
Indian Institute of Science
B A N G A L O R E 560 012
Ph: +91-80-3942505
+91-80-3600450
Fax:+91-80-3600865
___________________________________________________
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement