Re: Question on writing many series to a netcdf file (LEO_ARIES)

From: Jamie Scott <James.D.Scott_at_nyahnyahspammersnyahnyah>
Date: Tue, 13 Feb 2007 09:06:22 -0700

It sounds like you are trying to put multiple time series with
different time periods in the same file.
As far as I know, you can only have one definition of the time
coordinate in a netcdf file. The way around that
in your situation is to define time such that it includes the range
of all the time series you will put in the file.
If you have a time series from 1900-1950 and one from 1930-2000,
define time to be 1900-2000. Also define
both time series to be the same length, but use missing values for
years the time series isn't defined.
Alternatively, you can create a new file for each time series.

Jamie Scott
NOAA/ESRL/PSD
james.d.scott_at_noaa.gov

On Feb 13, 2007, at 2:42 AM, ncl-talk-request_at_ucar.edu wrote:

>
> Hi,all
>
> I'm using ncl to output some time series (with different time
> span) in a netcdf format.
>
> Here below is a part of my simple script.
>
>
> x = asciiread("/home/linx/work/indices/
> PDO_Mantua_Obs_1900-2005_ANN.MAM.dat",(/106,2/),"float")
> pdo1 = x(:,0) ; ANN PDO from Mantua
> pdo1!0 = "time"
> ntime = dimsizes(pdo1)
> pdo1&time = fspan(1900,2005,ntime)
> pdo1_at_units = "standard value"
> pdo1_at_long_name = "PDO.ANN Obs" ; for leftstring
> pdo1_at_reference = "(Mantua et.al,1997)"
>
> system("rm ./ClimateIndices.nc")
> fout = addfile("./ClimateIndices.nc","c")
> fout_at_title="Climate Indices (Both Obs and Proxy record,
> Including PDO,ENSO,NHI&SHI,AO&NAO..)"
> fout_at_creation_date = systemfunc("date")
>
> ; make time and UNLIMITED dimension ; recommended for most
> applications
> filedimdef(fout,"time",-1,True) ; when I turn off
> this line, the script will report the error of dimsizes
> inconsitence for different series
>
> fout->pdo_ann_mantua = pdo1
> ........
>
>
> But I find that the outputed series (in nc file) are longer than
> the exact time span , and filled with missing value
>
> just outside the real time span.
>
> Anyone can help me? Thank a lot!
>
>
> Lin
>
>
>
>
>
>
>
> LEO_ARIES
> 2007-02-13
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/
> 20070213/5e997463/attachment.html
>
> ------------------------------
>
> Message: 3
> Date: Tue, 13 Feb 2007 17:42:08 +0800
> From: "LEO_ARIES" <Leo_Aries_at_tom.com>
> Subject: Re: Question on writing many series to a netcdf
> file
> To: "ncl-talk" <ncl-talk_at_ucar.edu>
> Message-ID: <200702131741573752740_at_tom.com>
> Content-Type: text/plain; charset="gb2312"
>
> Skipped content of type multipart/alternative-------------- next
> part --------------
> A non-text attachment was scrubbed...
> Name: ClimateIndice.ncl
> Type: application/octet-stream
> Size: 11151 bytes
> Desc: not available
> Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/
> 20070213/f7077890/ClimateIndice.obj
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 39, Issue 19
> ****************************************

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 13 2007 - 09:06:22 MST

This archive was generated by hypermail 2.2.0 : Tue Feb 13 2007 - 14:07:37 MST