[gradsusr] Drawing TC storm track in grads

Jennifer Adams jma at cola.iges.org
Thu Dec 4 08:28:53 EST 2014


On Dec 3, 2014, at 2:24 PM, Larry Ger Aragon <larrygeraragon30 at gmail.com> wrote:

> Thanks for the response, Jennifer. I understand the concept of the
> while loop. But, if I may ask, isn't it that grads sort of overlays
> the images as you display, that's why you'll either want to put
> 'clear' or else (sometimes), you'll have your new displayed image
> mashed up with the previous one? I'm afraid that would also be the
> case when I apply this while loop, I won't actually 'connect the dots'
> for successive time as the next images I would then add would just
> cover the one where I'm drawing my tracks. At most, I can only have
> two points and a line from the last image I would generate. Anyway, I
> haven't tried this but, can I store my drawn points and lines in a
> certain variable (container)? and just make some looping so I could
> update that when I want? I've only tried storing, say one whole
> spatial data at specific time/level in one variable, compare it to
> other (e.g. 6hr rainfall -  3hr raindall)
> , and display the resulting spatial values. I havent tried it when
> attemping to draw lines then store it in a container/variable (I guess
> it's not possible? just a wild guess). Anyway, I'd be glad to see your
> better idea on this.

You could move the final line in my script sample (where the cmd is sent to GrADS) inside the while loop, then it would draw the complete cyclone track at every time step, and each exectution of the loop would extend the line one more segment. 

You can store things as script variables … http://iges.org/grads/gadoc/script.html#variables
> 
> And just another topic, I hope you won't mind if I no longer created a
> new thread on this, but, Is there a way I could mask out only the
> values of say, precipitation, in the landmass (to exclude the ocean?).
> I've read this function mask of grads, but from how I understood it,
> it's only applicable when (ideally) you have negative values on the
> ocean part which could be set to as constant (using the const
> function). I've also been trying to find answer on the net, so I could
> grasp your ideas well when you respond.

You can mask out land or ocean areas by covering them with polygons that fill the land or ocean areas (like laying a blanket over the areas you don’t wan to see) using basemap.gs: http://iges.org/grads/gadoc/basemap.html

If you have a data variable that reflects the land/sea boundary, then you can use the maskout() and const() functions to create a mask that you can apply to your data so that nothing is drawn over land or ocean. 
—Jennifer


> 
> This will be of great help, jennifer, hope to have your consideration
> on these. Thank you very much.
> 
> 
> 
> 
> 
> On 12/3/14, Jennifer Adams <jma at cola.iges.org> wrote:
>> Hi, Larry —
>> 
>> How about something like this:
>> 
>> cmd=‘draw line’
>> while (...looping over forecast times...)
>>  …your code to determine lat/lon of cyclone center...
>>  ‘q w2xy ‘lon’ ‘lat
>>  xpos=subwrd(result,3)
>>  ypos=subwrd(result,6)
>>  cmd=cmd’ 'xpos’ ‘ypos
>> endwhile
>> cmd    ;* this will send the ‘draw line’ command to GrADS and plot the whole
>> cyclone track
>> 
>> —Jennifer
>> 
>> 
>> 
>> 
>> On Dec 3, 2014, at 3:05 AM, Larry Ger Aragon <larrygeraragon30 at gmail.com>
>> wrote:
>> 
>>> Greetings Grads users,
>>> 
>>> I'd be very glad to receive some help regarding this problem. I have
>>> this algorithm collecting tropical cyclone center at each forecast
>>> time, which I record only at two variables (lon and lat). I also print
>>> these coordinates (thru say command) in the terminal. After collecting
>>> all the values, I plan to make a track from the coordinates I just
>>> collected. I can't think of how I would program this in grads (does
>>> grads support fortran syntaxing?) with changing the values of the two
>>> variables I have so I would not have veeeery long .gs of just
>>> copy-pasting "q w2xy" then connect lines. If only  grads support C
>>> program/functions or R, it would be easier for me. Just want to ask if
>>> anybody have some ideas on this. Thanks.
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>> 
>> --
>> Jennifer M. Adams
>> Center for Ocean-Land-Atmosphere Studies (COLA)
>> 111 Research Hall, Mail Stop 2B3
>> George Mason University
>> 4400 University Drive
>> Fairfax, VA 22030
>> 
>> 
>> 
>> 
>> 
>> 
> 
> 
> -- 
> Weather Observer I
> Numerical Modelling Section
> Research & Development and Training Division
> Philippine Atmospheric, Geophysical and Astronomical Services Administration
> Quezon City, Philippines
> Tel: +632 920 4064
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
111 Research Hall, Mail Stop 2B3
George Mason University
4400 University Drive
Fairfax, VA 22030 





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20141204/5e703657/attachment.html 


More information about the gradsusr mailing list