[Thread Prev][Thread Next][Index]

Re: Distribution of annual data across months



Hi Barry,
	I think the SAMPLEL function may be of help in creating
the first variable - that repeats each annual value 12 times.
Here is a demo of what I have in mind (but for 3 years rather
than 100 so the listings are shorter).

! define grid for three years annual data
def axis/t=1-jul-2001:1-jul-2003/npoints=3 tyear
def grid/t=tyear gyear

! and load it with sample data {2,3,1}
let vsample=tsequence({2,3,1})
let vyear=vsample[g=gyear,gt=@asn]
list vyear
 JUL-2001 / 1:  2.000
 JUL-2002 / 2:  3.000
 JUL-2003 / 3:  1.000

! now define grid for the monthly data
def axis/t=15-jan-2001:15-dec-2003/npoints=36 tmonth
def grid/t=tmonth gmonth

! now we need a "sample" function with 36 values: 12x1, 12x2, 12x3
let lsamp = int((l[g=gmonth]-1)/12) + 1

! which used with the SAMPLEL gives us what we need
let vm=samplel(vyear,lsamp)     ! this has the values right but
                                ! lacks the calendar axis
let vmonth=vm[g=gmonth,gt=@asn]
list vmonth
 15-JAN-2001 /  1:  2.000
 14-FEB-2001 /  2:  2.000
 16-MAR-2001 /  3:  2.000
 16-APR-2001 /  4:  2.000
 16-MAY-2001 /  5:  2.000
 16-JUN-2001 /  6:  2.000
 16-JUL-2001 /  7:  2.000
 15-AUG-2001 /  8:  2.000
 15-SEP-2001 /  9:  2.000
 15-OCT-2001 / 10:  2.000
 15-NOV-2001 / 11:  2.000
 15-DEC-2001 / 12:  2.000
 14-JAN-2002 / 13:  3.000
 14-FEB-2002 / 14:  3.000
 16-MAR-2002 / 15:  3.000
 16-APR-2002 / 16:  3.000
 16-MAY-2002 / 17:  3.000
 15-JUN-2002 / 18:  3.000
 16-JUL-2002 / 19:  3.000
 15-AUG-2002 / 20:  3.000
 15-SEP-2002 / 21:  3.000
 15-OCT-2002 / 22:  3.000
 14-NOV-2002 / 23:  3.000
 15-DEC-2002 / 24:  3.000
 14-JAN-2003 / 25:  1.000
 14-FEB-2003 / 26:  1.000
 16-MAR-2003 / 27:  1.000
 15-APR-2003 / 28:  1.000
 16-MAY-2003 / 29:  1.000
 15-JUN-2003 / 30:  1.000
 16-JUL-2003 / 31:  1.000
 15-AUG-2003 / 32:  1.000
 14-SEP-2003 / 33:  1.000
 15-OCT-2003 / 34:  1.000
 14-NOV-2003 / 35:  1.000
 15-DEC-2003 / 36:  1.000

Your data seems to be ASCII so you are free to define your axes in
a way similar to the above, but I think the scheme would work
if "gyear", "gmonth" came from input netcdf files.

Hope this helps,
Mick

|Please note NEW E-Mail Address|
|!!! Mick.Spillane@noaa.gov !!!|
|__Room 2070 Bldg#3 NOAA/PMEL__|
|____Phone_:_(206)526-6780_____|




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement