[Thread Prev][Thread Next][Index]

Re: Concatting data files

Inresponse to my request for help in concatting data files into a time
series when all the files had the same time set, Lynn deWitt provided the
following solution.
(The trick being to specify the time attributed to the variable you 
concatting as you timestamp it).

USE test1.cdf, test2.cdf, test3.cdf

! define the p axis
DEFINE AXIS/T=1:3:1 tp

! define the "zero" value
LET zero = T[g=gp] * 0

! define the time-stamped variable
LET adv_stamped = zero + intjadv[t=330000]

! save all 3 sets in a time series
REPEAT/L=1:3 (SET DATA `L`; SAVE/APPEND/FILE=test.nc adv_stamped)

There's something about the time axis in your cdf files  - maybe because
the time is the same in all of them - that requires it be set specifically.
the following is an ncdump of the output file:

> ncdump test.nc
netcdf test {
        Z63_63 = 1 ;
        TP = UNLIMITED ; // (3 currently)
        double Z63_63(Z63_63) ;
                Z63_63:units = "D" ;
                Z63_63:point_spacing = "even" ;
        double TP(TP) ;
        float ADV_STANPED(TP, Z63_63) ;
                ADV_STANPED:missing_value = -1.e+34f ;
                ADV_STANPED:_FillValue = -1.e+34f ;
                ADV_STANPED:long_name = "ZERO + INTJADV[T=330000]" ;
                ADV_STANPED:history = "From test1" ;

// global attributes:
                :history = "FERRET V4.91 (GUI) 08-May-00" ;

 Z63_63 = 0.981900274753571 ;

 TP = 1, 2, 3 ;

  -9.226068e-15 ;


Lynn deWitt


Pacific Fisheries Environmental Laboratories
1352 Lighthouse Avenue
Pacific Grove, CA 93950-2097

>I am trying to produce a times series for a variable from a number of
>files. I have tried various methods including the "timestamping" and the
>other methods found in the recent `Re: Concatting data from "degenerate"
>I sent out a similar request for help last week and it was pointed out
>that I didn't really give enough information, so here is a code sample:
>!------ ! code to concat 3 data files to concat.cdf
>! We now have 3 new files
>! GO test
>! initialize the files
>USE test1.cdf, test2.cdf, test3.cdf
>! define the p axis
>DEFINE AXIS/T=1:3:1 tp
>! define the "zero" value
>LET zero = T[g=gp] * 0
>! define the time-stamped variable
>LET adv_stamped = zero + intjadv
>! save all 3 sets in a time series
>REPEAT/X=1:3 (SET DATA `X`; SAVE/APPEND/FILE=concat.cdf adv_stamped)
>The problem is that the script, at each time step, writes the same value
>to each element of the concatination vector. It repeats this process
>three times. 
>I can't fathom how to get each value to its own element only.
>Incase you feel this is a worthy challenge I've included the three data
>files test{1,2,3}.cdf
>Thankyou for your time,
>        Jeff

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement