[Thread Prev][Thread Next][Index]
Re: monthly in daily
Hi Celine,
Assuming that the monthly data are located near the center of
each month then two cases arise
1) you don't need the daily to monthly differences before mid-Jan
and after mid-Dec : this is the easiest case
2) you need to compare the daily data with interpolated monthlies
at all days of the year : this requires a modulo axis.
Both cases are demonstrated below. There may be more elegant solutions
from users who do this more often than I but I believe this should work
for you.
A) generate a test monthly series by creating the files celine.cdl and
celine_mod.cdl follows:
----------------------
netcdf celine {
dimensions:
TIME = 12 ;
variables:
double TIME(TIME) ;
TIME:units = "days since 1900-01-01 00:00:00" ;
TIME:time_origin = "1-JAN-1900" ;
TIME:point_spacing = "uneven" ;
TIME:modulo = " " ;
float V(TIME) ;
data:
TIME =
32887.5, 32917.0, 32946.5, 32977.0, 33007.5, 33038.0,
33068.5, 33099.5, 33130.0, 33160.5, 33191.0, 33221.5;
V =
1, 3, 5, 7, 5, 3, 1, -1, -3, -5, -3, -1 ;
}
--------------------
netcdf celine_mod {
...
TIME:modulo = " " ;
...
(celine_mod.cdl is identical to celine.cdl except for these two lines)
then create a netCDF file (celine.cdf and celine_mod.cdf) by the command
ncgen -n celine.cdl
ncgen -n celine_mod.cdl
B) Run the following in Ferret
! make a demo daily data series
def axis/t=1-jan-1990:31-dec-1990:1/units=days tax
def grid/t=tax grd
let vday=5*sin(l[g=grd]*atan(1.)/45)
use celine ! the non-modulo axis version
set view upper ; plot v[d=1],vday
let v1=v[d=1,g=grd,gt=@lin]
plot/o v1-0.5 ! offset for clarity - notice that
! the ends of the year are missing
use celine_mod ! now use modulo version
set view lower ; plot v[d=2],vday
let v2=v[d=2,g=grd,gt=@lin]
plot/o v2-0.5 ! offset for clarity - now the whole
! year is available
list vday-v2
01-JAN-1990 00 / 1: 0.121
02-JAN-1990 00 / 2: 0.141
03-JAN-1990 00 / 3: 0.162
04-JAN-1990 00 / 4: 0.182
05-JAN-1990 00 / 5: 0.202
...
27-DEC-1990 00 / 361: 0.387
28-DEC-1990 00 / 362: 0.408
29-DEC-1990 00 / 363: 0.428
30-DEC-1990 00 / 364: 0.449
31-DEC-1990 00 / 365: 0.469
Hope this helps. Depending on the format of your monthly data you will
need to edit in the "modulo" to its CDL file or define the grid axis
that reads it to be modulo. See "modulo" in the user guide.
Mick
|____spillane@pmel.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