[gradsusr] Question on converting script.gs to gradspy
Stephen Woodbridge
stephenwoodbridge37 at gmail.com
Sun Jan 6 13:10:15 EST 2019
Hi all,
I have a grads script, as script.gs, and I'm wondering how to convert it
to a python script. The reason for converting it is that I need to get
back the curve data that would be used to plot a curve in grads. So for
example, I have in the script:
...
*******************************************************
* Plot Second Panel (Wind Speed/Direction)
*******************************************************
'set parea .75 10.5 .5 4 '
'set grid on 5 '_black
'set tlsupp off'
'set string '_black
'set strsiz .13 '
'set ylopts 'col1' 5'
'set ylpos -0.45 l'
'set annot 'col1
'set xlab off'
'set ccolor 'col1
'set ylab on '
'set cterp on '
'set vrange 0 16 '
'set ylint 2 '
'set xlevs 'xlevs
'set gxout linefill'
'set lfcols 'col1' '_black
*WGRIB2'define b=HTSGWsfc*0'
'define b='_sig_height'*0'
*WGRIB2'd smth9(HTSGWsfc*3.25);b '
'd smth9(htsgw_surface*3.25);b '
and I want to get the data that was used to plot this curve. Do I just
run gradspy.cmd(line) for each of the lines above then for the last run:
gradspy.cmd("'d smth9(htsgw_surface*3.25);b '") # to display it
res = gradspy.results("'smth9(htsgw_surface*3.25);b '") # to fetch results
Can I pass a list of commands to gradspy.cmd(list) for all the sets?
Are there docs and examples for gradspy beyond te one page explaining
start, cmd, and result methods?
Thanks and sorry if this has been asked and answered before, I'm still
stumbling around in the dark here :)
-Steve
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
More information about the gradsusr
mailing list