[Thread Prev][Thread Next][Index]

Re: Reading in ASCII and creating time axis therefrom...



Hi Gary,
	I suspect the problem is that you read in the data along
the (default) X axis but then try to assign them to the T axis.
I grabbed the lines of data you provided to a file "strand.d"
and then the following read them and created the netCDF file
"strand.nc"

def axis/t=1:5:1 tax ; def grid/t=tax grd
file/var=yy,mm,dd,vr1,vu1,vr2,vu2,vr3,vu3,vww,vsf,vuf/g=grd strand.d
 
let time = DAYS1900(yy,mm,dd)-DAYS1900(1996,1,1)
define axis/t/from_data/name=tax2/units="days"/t0="1-JAN-1996" time
def grid/like=vr1/t=tax2 grd2
let u2=vu2[gt=grd2@asn]
plot u2

save/file=strand.nc u2

sp ncdump strand.nc
netcdf strand {
dimensions:
        TAX2 = UNLIMITED ; // (5 currently)
variables:
        double TAX2(TAX2) ;
                TAX2:units = "DAYS since 1996-01-01 00:00:00" ;
                TAX2:time_origin = "1-JAN-1996" ;
        float U2(TAX2) ;
                U2:missing_value = -1.e+34f ;
                U2:_FillValue = -1.e+34f ;
                U2:long_name = "VU2[GT=GRD2@ASN]" ;
                U2:history = "From strand.d" ;

// global attributes:
                :history = "FERRET V5.22    5-Jan-01" ;
data:

 TAX2 = 177, 207, 238, 268, 298 ;

 U2 = 1, 15, 11, 11, 1 ;
}

! now read in U2 and overplot to check (the pre-existing variable
! U2 needs to be removed first)
can var u2
use strand.nc
plot/o u2+0.5

Mick

|--****--****-*---*---***--***--|____spillane@pmel.noaa.gov____|
|-*__---*-----*--*-*--*--*-*--*-|_SCIENCE APPLICATIONS SUPPORT_|
|--***--*-----*-*---*-***--***--|____EPIC/Ferret/PlotPlus______|
|-----*-*-----*-*****-*----*----|__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