[ncl-talk] About trajectories routine

Carlos Batista krlosbatist at gmail.com
Tue Dec 9 09:18:01 MST 2014


I am most grateful for your answers! Thanks!

I have not had success with my doubts and even with my problem.

I did not know that I would need to calculate the trajectories before.
Sorry!

I'd like to know, how you can do these calculations. It is done within the
NCL? How? Can I send a small set of data for you to do these tests? You
would have a small example of how to make these trajectories and how to use
scripts for strokes?

Thank you for your help and cooperation!

Cheers
Carlos

2014-12-09 14:09 GMT-02:00 Alan Brammer <abrammer at albany.edu>:

> Replies should pretty much always be to ncl-talk.
>   I can not provide code for the trajectory calculation.  I would suggest
> you research into hysplit http://ready.arl.noaa.gov/HYSPLIT.php or look
> into the software Vapor https://www.vapor.ucar.edu/
> These can both calculate kinematic air trajectories, I'm not sure about
> ocean based trajectories (if that's your thing).  This is as much info as I
> can provide.
>
> There are many papers and programs out there to calculate trajectories, I
> suggest you look into them and decide what you need.  NCL would then be
> able to plot up the data calculated by the trajectory model.
>
>  Good luck.
>
> On Tue, Dec 9, 2014 at 11:03 AM, Carlos Batista <krlosbatist at gmail.com>
> wrote:
>
>>
>> Dear Alan,
>>
>> I am most grateful for your answers! Thanks!
>>
>> Alan, I have not had success with my doubts and even with my problem.
>>
>> I did not know that I would need to calculate the trajectories before.
>> Sorry!
>>
>> I'd like to know, how you can do these calculations. It is done within
>> the NCL? How? Can I send a small set of data for you to do these tests? You
>> would have a small example of how to make these trajectories and how to use
>> scripts for strokes?
>>
>> Thank you for your help and cooperation!
>>
>> Cheers
>> Carlos
>>
>> PS1: Sorry, but I can send my questions just post here or in the forum?
>>
>> 2014-12-09 12:45 GMT-02:00 Alan Brammer <abrammer at albany.edu>:
>>
>> Carlos,
>>> I haven't read all of this thread, so apologies if this is answered.  To
>>> plot trajectories one first needs to calculate the trajectory. Earlier you
>>> said "therefore, I have variables in all oceans and I would like to
>>> trace their paths, " which makes me think you don't have trajectories.
>>>   If you want to calculate trajectories then there is not any examples
>>> of an easy way in NCL and while it is somewhat straightforward it's going
>>> to take a good amount of coding. Probably not something to do if you're not
>>> familiar with a language.
>>>
>>> If you have already have trajectories then the required variables would
>>> be time, lat, lon and then salinity? in your case I guess.  If you have a
>>> small data file, and you're struggling with reading it in. Send the code
>>> you're using and the file in question (if less than 1.5MB) to the list.
>>> Gustavo already gave you a lot of info about how the examples are
>>> structured the binary files are (/9,ntime, ntraj/).  If you already have
>>> the data file ask whoever made it what the ordering is and change the
>>> script according.  Don't change the file to match the example script,
>>> that's just extra work.
>>>
>>>
>>> Lastly to learn NCL look at the documentation and examples.  Some
>>> examples have data files saved here:
>>> https://www.ncl.ucar.edu/Applications/Data/
>>> Learning by asking questions to NCL-talk is not recommended. That's why
>>> the documentation was created. Also check out Mary's webinar emails.
>>>
>>>
>>>
>>> Alan.
>>>
>>>
>>> On Mon, Dec 8, 2014 at 9:13 PM, Carlos Batista <krlosbatist at gmail.com>
>>> wrote:
>>>
>>>>
>>>> I will post the questions here in the forum ...
>>>>
>>>> Gustavo, as I not know use the NCL, I need some examples of how it
>>>> works. To trace the trajectories must do the same thing. I'd like to know
>>>> if you would have some data series in which you can use with those routines
>>>> traj_1.ncl and traj_2.ncl. So I'll can see how organized my data in a
>>>> better way.
>>>>
>>>> Sorry for all questions, but I realy not know use the NCL, but I want
>>>> learn as using in my study...
>>>>
>>>> Appreciate your cooperation!
>>>>
>>>> Thanks
>>>> Cheers!
>>>> Carlos
>>>>
>>>> 2014-12-08 2:06 GMT-02:00 Gustavo Correa <gus at ldeo.columbia.edu>:
>>>>
>>>> Hi Carlos
>>>>>
>>>>> It would help if you send a clear, complete, precise, description of
>>>>> the data layout
>>>>> in your input file.
>>>>> Otherwise it will be just wild guesswork and ineffective trial and
>>>>> error.
>>>>>
>>>>> Apparently you are stuck when you read the data in.
>>>>> There is no point trying to debug the script further if you cannot
>>>>> even read the data.
>>>>> To read the data correctly, you need to know what you are reading,
>>>>> i.e. you need to make clear how the data is organized in the input
>>>>> file.
>>>>> In addition, the script structure certainly depends on your data
>>>>> layout.
>>>>> It may be just like the example script, or it may need modifications.
>>>>>
>>>>> Is there a single trajectory in the input file or several trajectories?
>>>>> What is the sequence of data?
>>>>>
>>>>> Is it:
>>>>>
>>>>> lat1,lon1,time1,salinity1,
>>>>> lat2, lon2, time2, salinity2,
>>>>> ...
>>>>> latN, lonN, timeN, salinityN
>>>>>
>>>>> or perhaps
>>>>>
>>>>> lat1, lat2, ..., latN
>>>>> lon1, lon2, ...,lonN
>>>>> time1, time2, ...,timeN
>>>>> salinity1, salinty2, ..., salinityN
>>>>>
>>>>> What is "N" in this sequence?
>>>>> Is it 250 as you mentioned before, or some other number?
>>>>>
>>>>> Are there four variables (lon, lat, time, salinity) or are there more
>>>>> (or less) variables?
>>>>> Which variables, how many, how are they ordered?
>>>>>
>>>>> Does this layout get repeated for more trajectories?
>>>>> How many repetitions/trajectories?
>>>>>
>>>>>
>>>>> On Dec 7, 2014, at 1:08 PM, Carlos Batista wrote:
>>>>>
>>>>> > Hello Gustavo.
>>>>> >
>>>>> > Gustavo, my data has a latitude, longitude, time and the values of
>>>>> my variable.
>>>>> >
>>>>> > I imagine that at each grid point (x, y, and time) there are values
>>>>> of my variable that change with time.
>>>>> >
>>>>>
>>>>> That isn't clear.
>>>>> If x and y stay fixed, then there is no trajectory, the location will
>>>>> always be the same.
>>>>>
>>>>> > Which of the scripts could do the course? The traj_1.ncl or
>>>>> traj_2.ncl?
>>>>> >
>>>>>
>>>>> It all depends on how the data is organized in the input file.
>>>>> One of the scripts may fit, or may need to be modified to adapt to
>>>>> your data layout.
>>>>>
>>>>> > Could you tell me how the data should be organized for the scripts
>>>>> work?
>>>>> >
>>>>> > With these my data: x, y variable time-varying .... is possible to
>>>>> trace the trajectories of my variable?
>>>>> >
>>>>>
>>>>> I am not sure I understand what you're saying.
>>>>> If you are saying that X and Y are fixed and only salinity varies with
>>>>> time,
>>>>> then you are not going to be able to draw trajectories.
>>>>>
>>>>> For trajectories x and y must vary with time (unless the
>>>>> particle/parcel  is not moving,
>>>>> which is not what happens in the ocean).
>>>>> X,Y fixed and only the value of the salinity varying with time sounds
>>>>> as the Eulerian
>>>>> approach to fluid mechanics.
>>>>> That is probably not what you want.
>>>>> If you are interested in trajectories, you need a Lagrangian
>>>>> description, i.e.,
>>>>> you need to follow the fluid parcels over time, so that X, Y, and
>>>>> salinity
>>>>> will vary together with time.
>>>>>
>>>>> I hope this helps,
>>>>> Gus Correa
>>>>>
>>>>> > Gustavo, sorry so many questions, but I need to understand how the
>>>>> script works for trying to organize the data correctly.
>>>>> >
>>>>> > Thanks!!!
>>>>> > Cheers!
>>>>> >
>>>>> > Carlos Batista
>>>>> >
>>>>> > 2014-12-07 12:42 GMT-02:00 Gustavo Correa <gus at ldeo.columbia.edu>:
>>>>> > Hi Carlos
>>>>> >
>>>>> > Something is amiss, which is hard for me to understand,
>>>>> > because you didn't tell clearly what is in your data.
>>>>> >
>>>>> > To draw trajectories, you need the position (x,y)
>>>>> > of the particles.
>>>>> > You could use the salinity information *also* (as in example
>>>>> traj_2.ncl, where
>>>>> > salinity values are associated to variations in the trajectory
>>>>> color).
>>>>> > However, the fundamental information you need is position (x,y), not
>>>>> salinity itself,
>>>>> > and that is what is used in example traj_1.ncl.
>>>>> >
>>>>> > What do you have (x,y), or do you have salinty only?
>>>>> > What is in the 250 points in your file?
>>>>> >
>>>>> > In the example traj_1.ncl, ntime=131, the input file seems to have
>>>>> > a first Fortran record (record 0) with 9 x 131 x 100 data points,
>>>>> > and a second Fortran record (record 1) with 131 data points
>>>>> (presumably
>>>>> > the time data values associated to the first record).
>>>>> > The first record seems to store x (xpt) and y (ypt) coordinates in
>>>>> the big(1,:,traj(i)),
>>>>> > and big(2,:,traj(i)) points of the first record in the input file.
>>>>> > You see? The script uses the particle position (x,y) to draw the
>>>>> trajectories.
>>>>> > It doesn't even use the salinity values (which is used only in
>>>>> scrpit traj_2.ncl,
>>>>> > and seems to be stored in big(8,:,traj(i)).
>>>>> >
>>>>> > That is as far as I can tell from the code in those two examples
>>>>> (which I haven't run/tried).
>>>>> >
>>>>> > Does your file have  the salinity values only?
>>>>> > If that is the case, you cannot draw trajectories.
>>>>> > You may not need all the information that the file in the examples
>>>>> have.
>>>>> > However, you definitely need the particle position (x,y).
>>>>> >
>>>>> > I hope this helps,
>>>>> > Gus Correa
>>>>> >
>>>>> > On Dec 7, 2014, at 7:13 AM, Carlos Batista wrote:
>>>>> >
>>>>> > >
>>>>> > > Hello Gustavo.
>>>>> > >
>>>>> > > My files were written in Fortran, compiled in ifort. I can
>>>>> transform this data into ASCII using the very FORTRAN or NetCDF using
>>>>> GrADS. However, do not know if using the GrADS will work too.
>>>>> > >
>>>>> > > Gustavo, my data are ocean variables (salinity). Therefore, I have
>>>>> variables in all oceans and I would like to trace their paths, like the
>>>>> example that is on the page. That means I have more than 1 trajectorie?
>>>>> > >
>>>>> > > Gustavo, the cbinread did not work. What really works is the
>>>>> descriptor fbinrecread. I tried again without the time information, as you
>>>>> recommended.
>>>>> > >
>>>>> > > Now there's one new problem. The problem arises within another
>>>>> command: coordinate matrices.
>>>>> > >
>>>>> > > See the new test:
>>>>> > > ;*******************************
>>>>> > > carlos at carlos-Lenovo-IdeaPad-Z400-Touch:~/area/$ ncl
>>>>> > >
>>>>> > >  Copyright (C) 1995-2013 - All Rights Reserved
>>>>> > >  University Corporation for Atmospheric Research
>>>>> > >  NCAR Command Language Version 6.1.2
>>>>> > >  The use of this software is governed by a License Agreement.
>>>>> > >  See http://www.ncl.ucar.edu/ for more details.
>>>>> > >
>>>>> > > ncl 0> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>>>> > > ncl 1> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>>>> > > ncl 2> ;**************************************************
>>>>> > > ncl 3> begin
>>>>> > > ncl 4> ntime = 250
>>>>> > >
>>>>> > > ncl 6>  big = fbinrecread("dados.bin",0,(/1,ntime,1/),"float")
>>>>> > >
>>>>> > > ncl 7>  wks = gsn_open_wks("ps","traj")
>>>>> > > ncl 8>    res            = True
>>>>> > > ncl 9>    res at gsnDraw    = False
>>>>> > > ncl 10>    res at gsnFrame   = False
>>>>> > > ncl 11>    res at vpWidthF   = 0.80
>>>>> > > ncl 12>    res at vpHeightF  = 0.80
>>>>> > > ncl 13>    res at mpMaxLatF  = -20
>>>>> > > ncl 14>    res at mpMinLatF  = -60
>>>>> > > ncl 15>    res at mpMinLonF  = -75
>>>>> > > ncl 16>    res at mpMaxLonF  = -25
>>>>> > > ncl 17>
>>>>> > > ncl 18>    res at tiMainString    = "Example of a trajectory plot"
>>>>> ; title
>>>>> > > ncl 19>    res at gsnCenterString = "markers every 4th time step"
>>>>> > > ncl 20>
>>>>> > > ncl 21>    map = gsn_csm_map_ce(wks,res)
>>>>> > > ncl 22> ;*********************************************
>>>>> > > ncl 23> ; trajectory parameters
>>>>> > > ncl 24> ;*********************************************
>>>>> > > ncl 25>    xpt = new(ntime,float)
>>>>> > > ncl 26>    ypt = new(ntime,float)
>>>>> > > ncl 27> traj = (/-1,-0.5,0.1,0.5,1/)
>>>>> > > ncl 28> pres                  = True
>>>>> > > ncl 29>    pres at gsLineThicknessF = 2.0
>>>>> > > ncl 30>    colors= (/"red","blue","dark green","grey","magenta"/)
>>>>> > > ncl 31>
>>>>> > > ncl 32>    mres  = True
>>>>> > > ncl 33>    first = True
>>>>> > > ncl 34> ;********************************
>>>>> > > ncl 35>    c=0
>>>>> > > ncl 36>    do i = 0,dimsizes(traj)-1
>>>>> > >
>>>>> > > ncl 37>       ypt = big(2,:,traj(i))
>>>>> > >
>>>>> > > ncl 38>       xpt = big(1,:,traj(i))
>>>>> > >
>>>>> > >
>>>>> > > ncl 40>       pres at gsLineColor = colors(c)
>>>>> > > ncl 41>       c=c+1
>>>>> > > ncl 42>       gsn_polyline(wks,map,xpt,ypt,pres)
>>>>> > > ncl 44> ; add markers to the trajectories
>>>>> > > ncl 45>
>>>>> > > ncl 46>       mres at gsMarkerIndex  = 16
>>>>> > > ncl 47>       mres at gsMarkerSizeF  = 4.0
>>>>> > > ncl 48>       mres at gsMarkerColor  = "black"
>>>>> > > ncl 49>       gsn_polymarker(wks,map,xpt(::4),ypt(::4),mres) ;
>>>>> draw every 4th marker
>>>>> > > ncl 50>
>>>>> > > ncl 51> ; create a unique marker to indicate the start of the
>>>>> trajectory
>>>>> > > ncl 52>
>>>>> > > ncl 53>       first at gsMarkerSizeF  = 8.0
>>>>> > > ncl 54>       first at gsMarkerColor  = "green"
>>>>> > > ncl 55>
>>>>> > > ncl 56>       gsn_polymarker(wks,map,xpt(0),ypt(0),first)
>>>>> > > ncl 57>       delete(first at gsMarkerColor)
>>>>> > > ncl 58>       delete(first at gsMarkerSizeF)
>>>>> > >
>>>>> > > ncl 59>    end do
>>>>> > > ncl 60>    draw(map)
>>>>> > > ncl 61>    frame(wks)
>>>>> > > ncl 62>
>>>>> > > ncl 63> end
>>>>> > >
>>>>> > > warning:fbinrecread: size specified is greater than record size,
>>>>> filling with missing values
>>>>> > > fatal:Illegal subscript. Subscripts must be integer when not using
>>>>> coordinate indexing
>>>>> > > fatal:["Execute.c":8126]:Execute: Error occurred at or near line 37
>>>>> > >
>>>>> > > ;;;;;;;*****************************
>>>>> > >
>>>>> > > Thanks again!
>>>>> > >
>>>>> > > Cheers!
>>>>> > > Carlos Batista
>>>>> > >
>>>>> > >
>>>>> > >
>>>>> > >
>>>>> > > 2014-12-06 23:10 GMT-02:00 Gustavo Correa <gus at ldeo.columbia.edu>:
>>>>> > > Hi Carlos
>>>>> > >
>>>>> > > Binary files are a pain.
>>>>> > > You need to know how they were written (Fortran or C, sequential
>>>>> or direct access, the number
>>>>> > > type that was written: 4-byte real, 8-byte real, 4-byte integer,
>>>>> etc,
>>>>> > > if there are record separators, etc), then choose the right
>>>>> function to read the file based
>>>>> > > on this information.
>>>>> > > Better avoid them, use self describing formats like NetCDF,
>>>>> > > or for small amounts of data just plain ascii.
>>>>> > >
>>>>> > > Do you know any of the information above of your data file?
>>>>> > > Can you at least do:
>>>>> > >
>>>>> > > ls -l dados.bin
>>>>> > >
>>>>> > > Anyway, do you have a single stream of 250 data points (ie. a
>>>>> single "trajectory")?
>>>>> > > If this is the case (and the error message suggests this) you
>>>>> should instruct the
>>>>> > > reading function to read only those 250 data points.
>>>>> > > It sounds as you have only one trajectory, not 100, but it is hard
>>>>> to tell.
>>>>> > > If this is the case, you need to change the example script more
>>>>> than just
>>>>> > > the data reading routine, to match the data you have.
>>>>> > >
>>>>> > > In addition, if you don't have the time information written to the
>>>>> file,
>>>>> > > you should not try to read it, ie. remove this:
>>>>> > > >  time= fbinrecread("dados.bin",1,(/ntime/),"float")
>>>>> > >
>>>>> > >
>>>>> > > Also, the error message suggests that the file was not written by
>>>>> Fortran,
>>>>> > > maybe it was written by a C program.
>>>>> > > Have you tried cbinread instead?
>>>>> > > Say, something like this:
>>>>> > >
>>>>> > > > big = cbinread("dados.bin",(/1,ntime,1/),"float")
>>>>> > >
>>>>> > >
>>>>> > > I hope this helps,
>>>>> > > Gus Correa
>>>>> > >
>>>>> > >
>>>>> > > On Dec 6, 2014, at 1:26 PM, Carlos Batista wrote:
>>>>> > >
>>>>> > > > Hi Gustavo, How are you?
>>>>> > > >
>>>>> > > > My file is in the binary format.
>>>>> > > > I have only one variable over time (250 Timesteps).
>>>>> > > >
>>>>> > > > In NCl I tried to enter the information by modifying the size of
>>>>> the read data
>>>>> > > >
>>>>> ;*******************************************************************
>>>>> > > > ; 1 variables x 250 x 100 Timesteps trajectories
>>>>> > > > Ntime = 250
>>>>> > > >
>>>>> > > > big fbinrecread = ("my_data.bin" 0, (/ 1, Ntime, 100 /), "float")
>>>>> > > > time = fbinrecread ("my_data.bin", 1, (/ Ntime /), "float")
>>>>> > > >
>>>>> > > >
>>>>> ;*********************************************************************
>>>>> > > >
>>>>> > > > Another thing I did not understand is why the existence of only
>>>>> 100 trajectories. If I want more I can change this value?
>>>>> > > >
>>>>> > > > **********************************see the
>>>>> error*****************************
>>>>> > > >
>>>>> > > > carlos at carlos-Lenovo-IdeaPad-Z400-Touch:~/area/$ ncl
>>>>> > > >  Copyright (C) 1995-2013 - All Rights Reserved
>>>>> > > >  University Corporation for Atmospheric Research
>>>>> > > >  NCAR Command Language Version 6.1.2
>>>>> > > >  The use of this software is governed by a License Agreement.
>>>>> > > >  See http://www.ncl.ucar.edu/ for more details.
>>>>> > > >
>>>>> > > > ncl 0> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>>>> > > > ncl 1> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>>>> > > > ncl 2> load
>>>>> "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>>>>> > > > ncl 3> begin
>>>>> > > > ncl 4>  ntime = 250
>>>>> > > > ncl 5> big = fbinrecread("dados.bin",0,(/1,ntime,100/),"float")
>>>>> > > >
>>>>> > > > ncl 6>  time= fbinrecread("dados.bin",1,(/ntime/),"float")
>>>>> > > >
>>>>> > > > ncl 7>  wks = gsn_open_wks("ps","traj")
>>>>> > > > ncl 8> ;*********************************************
>>>>> > > > ncl 9> ; color preps
>>>>> > > > ncl 10> ;*********************************************
>>>>> > > > ncl 11>   cnLevels=fspan(34.5,34.8,8)
>>>>> > > > ncl 12>   cmap = RGBtoCmap ("redyellowblue.rgb")
>>>>> > > > ncl 13>   gsn_define_colormap (wks,cmap)
>>>>> > > > ncl 14>
>>>>> > > > ncl 15>    res            = True
>>>>> > > > ncl 16>    res at gsnDraw    = False
>>>>> > > > ncl 17>    res at gsnFrame   = False
>>>>> > > > ncl 18>    res at vpWidthF   = 0.80
>>>>> > > > ncl 19>    res at vpHeightF  = 0.80
>>>>> > > > ncl 20>    res at mpMaxLatF  = -20
>>>>> > > > ncl 21>    res at mpMinLatF  = -60
>>>>> > > > ncl 22>    res at mpMinLonF  = -75
>>>>> > > > ncl 23>    res at mpMaxLonF  = -25
>>>>> > > > ncl 24>
>>>>> > > > ncl 25> ; label bar resources
>>>>> > > > ncl 26>    res_lb                    = True
>>>>> > > > ncl 27>    res_lb at vpWidthF           = 0.60
>>>>> > > > ncl 28>    res_lb at vpHeightF          = 0.10
>>>>> > > > ncl 29>    res_lb at lbPerimOn          = False
>>>>> > > > ncl 30>    res_lb at lbOrientation      = "Horizontal"
>>>>> > > > ncl 31>    res_lb at lbLabelStride      = 2
>>>>> > > > ncl 32>    res_lb at lbLabelAlignment   = "InteriorEdges"
>>>>> > > > ncl 33>    res_lb at lbFillColors       = cmap(2:,:)
>>>>> > > > ncl 34>    res_lb at lbMonoFillPattern  = True
>>>>> > > > ncl 35>    res_lb at lbLabelFontHeightF = 0.015
>>>>> > > > ncl 36>
>>>>> > > > ncl 37>    res at tiMainString    = "Trajectories colored by
>>>>> salinity (ppt)"  ; title
>>>>> > > > ncl 38>
>>>>> > > > ncl 39>    map = gsn_csm_map_ce(wks,res)
>>>>> > > > ncl 40> ;*********************************************
>>>>> > > > ncl 41> ; trajectory parameters
>>>>> > > > ncl 42> ;*********************************************
>>>>> > > > ncl 43>    xpt = new(ntime,float)
>>>>> > > > ncl 44>    ypt = new(ntime,float)
>>>>> > > > ncl 45>    traj = (/1,10,53,67,80/)
>>>>> > > > ncl 46>
>>>>> > > > ncl 47> ;*********************************************
>>>>> > > > ncl 48> ; some plot parameters
>>>>> > > > ncl 49> ;*********************************************
>>>>> > > > ncl 50>    pres                  = True
>>>>> > > > ncl 51>    pres at gsLineThicknessF = 2.0
>>>>> > > > ncl 52>
>>>>> > > > ncl 53>    mres  = True
>>>>> > > > ncl 54>    first = True
>>>>> > > > ncl 55> ;********************************
>>>>> > > > ncl 56>    do i = 0,dimsizes(traj)-1
>>>>> > > > ncl 57>       ypt = big(2,:,traj(i))
>>>>> > > > ncl 58>       xpt = big(1,:,traj(i))
>>>>> > > > ncl 59>       sst = big(8,:,traj(i))
>>>>> > > > ncl 60>
>>>>> > > > ncl 61>      do j=0,dimsizes(ypt)-2
>>>>> > > > ncl 62>         pres at gsLineColor=GetFillColor(cnLevels,cmap,avg(
>>>>> (/sst(j),sst(j+1)/)))
>>>>> > > > ncl 63>
>>>>>  gsn_polyline(wks,map,(/xpt(j),xpt(j+1)/),(/ypt(j),ypt(j+1)/),pres)
>>>>> > > > ncl 64>      end do
>>>>> > > > ncl 65>
>>>>> > > > ncl 66>
>>>>> > > > ncl 67> ; create a unique marker to indicate the start of the
>>>>> trajectory
>>>>> > > > ncl 68>
>>>>> > > > ncl 69>       first at gsMarkerSizeF  = 9.0
>>>>> > > > ncl 70>       first at gsMarkerColor  = "red"
>>>>> > > > ncl 71>
>>>>> > > > ncl 72>       gsn_polymarker(wks,map,xpt(0),ypt(0),first) ; draw
>>>>> start of traj
>>>>> > > > ncl 73>       delete(first at gsMarkerColor)
>>>>> > > > ncl 74>       delete(first at gsMarkerSizeF)
>>>>> > > > ncl 75>    end do
>>>>> > > > ncl 76>
>>>>> gsn_labelbar_ndc(wks,dimsizes(cnLevels)+1,cnLevels,0.30,0.30,res_lb)
>>>>> > > > ncl 77>    draw(map)
>>>>> > > > ncl 78>    frame(wks)
>>>>> > > > ncl 79>
>>>>> > > > ncl 80> end
>>>>> > > >
>>>>> > > > warning:fbinrecread: size specified is greater than record size,
>>>>> filling with missing values
>>>>> > > > fatal:fbinrecread: 0 or less than zero fortran control word,
>>>>> FILE NOT SEQUENTIAL ACCESS!
>>>>> > > > fatal:["Execute.c":8126]:Execute: Error occurred at or near line
>>>>> 6
>>>>> > > > **************************************************
>>>>> > > >
>>>>> > > > Thanks!
>>>>> > > > Carlos
>>>>> > > >
>>>>> > > >
>>>>> > > > 2014-12-06 16:00 GMT-02:00 Gustavo Correa <gus at ldeo.columbia.edu
>>>>> >:
>>>>> > > > 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
>>>>> > > >
>>>>> > > > _______________________________________________
>>>>> > > > ncl-talk mailing list
>>>>> > > > List instructions, subscriber options, unsubscribe:
>>>>> > > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>> > > >
>>>>> > >
>>>>> > > _______________________________________________
>>>>> > > ncl-talk mailing list
>>>>> > > List instructions, subscriber options, unsubscribe:
>>>>> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>> > >
>>>>> > > _______________________________________________
>>>>> > > ncl-talk mailing list
>>>>> > > List instructions, subscriber options, unsubscribe:
>>>>> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>> >
>>>>> > _______________________________________________
>>>>> > ncl-talk mailing list
>>>>> > List instructions, subscriber options, unsubscribe:
>>>>> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>> >
>>>>> > _______________________________________________
>>>>> > ncl-talk mailing list
>>>>> > List instructions, subscriber options, unsubscribe:
>>>>> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>
>>>>> _______________________________________________
>>>>> ncl-talk mailing list
>>>>> List instructions, subscriber options, unsubscribe:
>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141209/769b6d88/attachment.html 


More information about the ncl-talk mailing list