[Thread Prev][Thread Next][Index]

RE: Error writing CDF file



Hi Bruce,
	It would seem that you need to restore the time information that
the time averaging transformation removes.  Here is a demo that may help:

-----------------------------------------------------------------------
Ferret Session 1:
Make test files of monthly data for jan,...,jun for 4 years

def axis/x=1:4:1 xax ; def axis/y=1:3:1 yax ; def axis/z=1:2:1 zax
def axis/t=15-jan-1991:15-jun-1991/npoints=6 tax
def grid/x=xax/y=yax/z=zax/t=tax grd

let v=1000*l[g=grd]+100*k[g=grd]+10*j[g=grd]+i[g=grd]+910000
save/file=test1991.nc v

def axis/t=15-jan-1992:15-dec-1992/npoints=12 tax
let v=1000*l[g=grd]+100*k[g=grd]+10*j[g=grd]+i[g=grd]+920000
save/file=test1992.nc v

def axis/t=15-jan-1993:15-dec-1993/npoints=12 tax
let v=1000*l[g=grd]+100*k[g=grd]+10*j[g=grd]+i[g=grd]+930000
save/file=test1993.nc v

def axis/t=15-jan-1994:15-dec-1994/npoints=12 tax
let v=1000*l[g=grd]+100*k[g=grd]+10*j[g=grd]+i[g=grd]+940000
save/file=test1994.nc v
quit
------------------------------------------------------------
Ferret Session 2:
Read each of these file in turn, compute the Feb-Apr average,
and store it in a new file with an appropriate date, based here
on the date of the variable "v"

! define a time variable to assist in adding time dimension
let time=t[g=v]
! ... and associate the Feb-Apr average with the March date
let/title="Feb-Apr Average" fma=v[l=2:4@ave]+0*time[l=3]

! access the 1991 data (monthly values jan-jun)
use test1991.nc ; save/file=fma.nc fma

! add the 1992 average
use test1992.nc ; save/file=fma.nc/app fma

! add the 1993 average
use test1993.nc ; save/file=fma.nc/app fma

! add the 1994 average
use test1994.nc ; save/file=fma.nc/app fma
quit
----------------------------------------------------------------
Ferret Session 3:
Validate the content of the file "fma.nc"

use fma.nc
sho grid/all fma
plot/i=1/j=1/k=1/sym=20 fma
----------------------------------------------------------------

Good luck,
Mick

|____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