[gradsusr] image from each timestep

Stephen McMillan smcmillan at planalytics.com
Mon Feb 9 14:03:29 EST 2015


No problem, Jason.  To handle multiple parameters, it depends on what you
want the end result to be.  For example, if you want to overlay contour
lines on a shaded contour plot, change the output accordingly ('set gxout
contour') and display your variable within the same timestep setting.  Add
an additional plot (e.g., wind barbs) if desired.  However, if you want to
write a separate image for each parameter at the same timestep, display
your variable and do your 'printim...'  for each parameter in succession,
before the end of the while loop.  Most GrADS functions have an example or
two in the GrADS Documentation Index (
http://www.iges.org/grads/gadoc/gadocindex.html).  Following are simplified
samples of the two ways.
Stephen Mc

while...
  'c'
  'd [var1]'
  'd [var2]'
  'd [var3]'
  'printim....'
  ts=ts+1
endwhile

OR

while...
  'c'
  'd [var1]'
  'printim...'
  'c'
  'd [var2]'
  'printim...'
  'c'
  'd [var3]'
  'printim...'
  ts=ts+1
endwhile


On Mon, Feb 9, 2015 at 12:54 PM, <webmaster at solargrafix.com> wrote:

>  OK, sorry about that, I actually thought I was replying to the user
> forum.  I will be more careful about that in the future.
>
>
>
> I have been tinkering with that code, and I was able to get it to do just
> about everything I need it to, for a single parameter.  How do I change the
> code to handle multiple parameters?
>
>
>
> Thanks,
>
> Jason
>
>
>
>
>
>
>
>
>
>
>  ------------------------------
>
> *From:* Stephen McMillan [mailto:smcmillan at planalytics.com]
> *Sent:* Monday, February 09, 2015 11:57 AM
>
> *To:* Jason Warren
> *Subject:* Re: [gradsusr] image from each timestep
>
>
>
> That's great, and yes it does.
>
>
>
> In the future, please post your questions and responses to the Users
> Forum.  That way, other users can benefit from the answers or provide
> alternate solutions to your questions.
>
>
>
> Thanks, and best wishes!
>
> Stephen
>
>
>
> On Mon, Feb 9, 2015 at 11:13 AM, <webmaster at solargrafix.com> wrote:
>
> Hello,
>
>
>
> Thanks again for your assistance.  It works great.  Does this work with
> scripts which plot multiple parameters (such as pressure and temperature)?
>
>
>  ------------------------------
>
> *From:* Stephen McMillan [mailto:smcmillan at planalytics.com]
> *Sent:* Monday, February 09, 2015 9:14 AM
> *To:* Jason Warren
>
>
> *Subject:* Re: [gradsusr] image from each timestep
>
>
>
> Jason,
>
> Remove the second quote from the 'set t...' line.  It should be:
>
> 'set t 'ts
>
>
>
> My original example was incorrect...sorry.
>
> Stephen
>
>
>
> On Mon, Feb 9, 2015 at 9:00 AM, <webmaster at solargrafix.com> wrote:
>
> Hi,
>
>
>
> Thanks for the info, but I receive a "non-terminated constant" error when
> I try to use that code.
>
>
>
> Here is my script:
>
>
>
>
>
>
>
> 'clear'
>
> 'set datawarn off'
>
>
>
> 'sdfopen
> http://nomads.ncep.noaa.gov:80/dods/gfs_0p25/gfs20150209/gfs_0p25_06z'
>
>
>
> 'set lat 35 50'
>
> 'set lon -95 -65'
>
> 'set mproj scaled'
>
> 'set display color white'
>
> 'set map 1'
>
> 'set mpdset hires'
>
> 'set mpdraw on'
>
> 'set timelab off'
>
> 'set grid off'
>
> 'set font 0'
>
> 'set strsiz .1'
>
>
>
> 'set t 2 20 3'
>
>
>
>   'q time'
>
>     timestr=subwrd(result, 3)
>
>     weekday1=subwrd(result,6)
>
>    'draw string 9.1 0.2 'timestr
>
> 'draw string 8.7 0.2 'weekday1
>
>
>
> 'set gxout shaded'
>
> 'set grads off'
>
> 'set csmooth on'
>
> 'set cterp on'
>
> 'set gxout shaded'
>
> 'color -50 50 .5 -gxout shaded -kind
> thistle->orchid->darkmagenta->midnightblue->darkblue->mediumblue->deepskyblue->mediumseagreen->yellow->gold->darkorange->red->darkred->deeppink->lightpink'
>
>
> 'set lev 850'
>
> 'd tmpprs-273.15'
>
>
>
> t1=1;t2=20
>
> ts=t1
>
> while(ts<=t2)
>
>   'set t' 'ts
>
>   'd tmpprs-273.15'
>
>   'printim temp.png x1280 y960'
>
>   ts=ts+1
>
> endwhile
>
>
>
>
>
>
>
>
>  ------------------------------
>
> *From:* Stephen McMillan [mailto:smcmillan at planalytics.com]
> *Sent:* Sunday, February 08, 2015 11:57 AM
> *To:* webmaster at solargrafix.com; GrADS Users Forum
> *Subject:* Re: [gradsusr] image from each timestep
>
>
>
> Hi Jason,
>
>
>
> t1=1;t2=20 (or whatever)
>
> ts=t1
>
> while(ts<=t2)
>
>   'set t' 'ts
>
>   'd var'  (substitute your variable name for var)
>
>   'printim....'
>
>   ts=ts+1
>
> endwhile
>
>
>
> There are other ways to do it, but this should work for you.  Good luck,
> and welcome to opengrads!
>
>
>
> Stephen McMillan
>
>
>
> On Sun, Feb 8, 2015 at 10:23 AM, <webmaster at solargrafix.com> wrote:
>
> Hi,
>
>
>
> I am new to OpenGrads and I am still learning.
>
>
>
> I am trying to get my script to create an image from each timestep.  I
> know how to print a single timestep using printim, but I would like to
> create an image for each timestep.  How do I do that?
>
>
>
> Thanks,
>
> Jason Warren
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20150209/5718d20a/attachment-0001.html 


More information about the gradsusr mailing list