[ncl-talk] About trajectories routine

Gustavo Correa gus at ldeo.columbia.edu
Sat Dec 6 11:00:11 MST 2014


Hi Carlos

I guess it all depends on how your your input data file looks like.
Is it an ascii, binary, NetCDF, HDF, GRIB file?
NetCDF, HDF, and to some extent GRIB are self describing, and can be read
with NCL's "addfile" function:

http://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml

Ascii layout is easy to see directly on the file, and can be read with NCL's "asciiread" function:

http://www.ncl.ucar.edu/Document/Functions/Built-in/asciiread.shtml

Those above are in general they  easier to read than binary, 
because the latter can vary in layout and record structure in many different ways.
But you can also read binary, with fbinread, cbinread, fbinrecread, etc, 
although all depends on how it was written/created:

http://www.ncl.ucar.edu/Document/Functions/io.shtml


You say 
"I have data with just 1 variable to 250 times."

Is it a NetCDF or HDF file?
Is it an ascii column file with 250 lines, one value per line?
Does it have a column for time also, say one "time value" pair per line?
Is it binary?  If binary, how is it organized?

The example traj_1.ncl reads a file with this layout:
******
; note this trajectory file contains data in the form of
; 9 variables x 131 timesteps x 100 trajectories
   ntime = 131

   big = fbinrecread("traj.bin",0,(/9,ntime,100/),"float")
   time= fbinrecread("traj.bin",1,(/ntime/),"float")
******

You can change the two "fbinrecread" commands above and
adjust them to your input file layout, but you need to know the input file
type and layout.

I hope this helps,
Gus Correa


On Dec 6, 2014, at 12:09 PM, Carlos Batista wrote:

> Hi users
> My name is Carlos and I'm new in the use of NCL...
> I need to know what the structure of the data read by the routine trajectories. https://www.ncl.ucar.edu/Applications/traj.shtml ... for example: traj_1.ncl
> 
> I have data with just 1 variable to 250 times. How can I know the number of trajectories of such data?
> 
> Who has an example with data is read could send for me, please!
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk



More information about the ncl-talk mailing list