[Thread Prev][Thread Next][Index]

Re: [ferret_users] extra point after monthly average



Hi Zhen,
The problem is in getting the start and end points exactly right for the equally-spaced Julian axis. You've put the first and last coordinates in the middle of January and December, but for equally-spaced months, each of length `365.25/12` days, the start and end coordinate should be located at a coordinate that is half of the length of the month from the start of 1984 and the same amount of time from the end of 1992.

Here is the definition you used,

yes? define axis/calendar=julian/t="15-jan-1984:12:00:00":"15-dec-1992:12:00:00":`365.25/12`/units=days monthlytax
yes? list tax_datestring(t[gt=monthlytax], t[gt=monthlytax], "minutes")
VARIABLE : TAX_DATESTRING(T[GT=MONTHLYTAX], T[GT=MONTHLYTAX], "minutes")
            SUBSET   : 109 points (TIME)
            CALENDAR : JULIAN
15-JAN-1984 /   1:"15-JAN-1984 12:00"
14-FEB-1984 /   2:"14-FEB-1984 22:30"
16-MAR-1984 /   3:"16-MAR-1984 09:02"
15-APR-1984 /   4:"15-APR-1984 19:32"
16-MAY-1984 /   5:"16-MAY-1984 06:02"
...
15-SEP-1992 / 105:"15-SEP-1992 01:13"
15-OCT-1992 / 106:"15-OCT-1992 11:43"
14-NOV-1992 / 107:"14-NOV-1992 22:18"
15-DEC-1992 / 108:"15-DEC-1992 08:48"
14-JAN-1993 / 109:"14-JAN-1993 19:18"

To get the equally-spaced axis that you want, it's probably simpler and more accurate to use DEFINE AXIS/EDGES/NPOINTS

yes? define axis/calendar=julian/edges/t="1-jan-1984:00:00:00":"31-dec-1992:23:59:59"/npoints=108/units=days monthlytax

zhen.li@xxxxxxxxxxxxx wrote:
Hi Ferret users:

I have a script (below) to average daily data from 1984 to 1992 to monthly mean output. I should have 9(yr)*12 =108 data points after averaging. However, I got 109 points. I wonder why there is an extra point? My daily data has 3288 data points, and 3288/30.4375
gives me 108 points on monthly basis.

>>>>>
use "salt_ave_daily.cdf"

define axis/calendar=julian/t="15-jan-1984:12:00:00":"15-dec-1992:12:00:00":`365.25/12`/units=days monthlytax
define grid/x=xdeg/y=ydeg/t=monthlytax monthlygrd
let salt_mon=salt_ave[gt=monthlygrd@ave]
set mem/size=500
save/file=salt_mon.cdf salt_mon
<<<<<

Thanks very much for your help!

Zhen



--

~> ~> ~> ~> ~> ~> ~> ~> ~> ~> ~>
Ansley Manke, NOAA/PMEL   ansley.b.manke@xxxxxxxx
7600 Sand Point Way NE, Seattle WA
Phone 206-526-6246,  FAX 206-526-6744




[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement