[Thread Prev][Thread Next][Index]

appending to a netcdf file




Hi Ferreters,

I have what I'm sure is a really simple problem but it's throwing me.
I've checked the manual and Steve Hankin's post in the mail archives
(...Mail_Archives/fu_98/msg00014.html) but I'm still getting the wrong
answer.  I have a a netcdf file that has 17 vertical levels and 14610 time
steps (no x or y).  I want to normalize each levels time series by
subtracting out that level's mean dividing by the std deviationn (or is
it variance?  I'll figure that out later).  Following the post in the
archive, I tried:

let test=index[d=2]+2 !index is the time series
save/file=test.nc/klimits=1:17 test[k=1] !from what I understood, this
should write the k=1 "slice" of the data to the file and fill the rest
with missing data flags
let test=index[d=2]-2 !just to make the values markedly different
save/file=test.nc/append test[k=2] !i've also tried with klimits=1:17

Here's what the data should be for k=1:
list/k=1/l=1:5 test
             INDEX[D=aoindex1,K=1]+2
             HEIGHT (millibar): 10
 01-JAN-1958 00 / 1:  1.067
 02-JAN-1958 00 / 2:  1.084
 03-JAN-1958 00 / 3:  1.004
 04-JAN-1958 00 / 4:  0.900
 05-JAN-1958 00 / 5:  0.863

and I open the test.nc file _before_ I write to it the second time (the
append step), these are indeed the values that I get.  But, if I open the
file after I write to it the second time, I get these values:
yes? list/k=1/l=1:5 test[d=3]
             INDEX[D=aoindex1]-2
             HEIGHT (millibar): 10
 01-JAN-1958 00 / 1: -2.933
 02-JAN-1958 00 / 2: -2.916
 03-JAN-1958 00 / 3: -2.996
 04-JAN-1958 00 / 4: -3.100
 05-JAN-1958 00 / 5: -3.137

which is of course the original values - 2 (or the values written in the
first step - 4.

Can someone please point out what I'm doing wrong?

Thanks as always,

Brent

-- 
Brent A. McDaniel

Dept of Earth and Atmospheric Sciences
Georgia Institute of Technology
Atlanta, Ga.  USA



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement