[gradsusr] Average in two different time and locations
T. haghroosta
haghroosta at hotmail.com
Tue Feb 5 13:10:01 EST 2013
Dear Ricardo, The script that you helped me to write, was run correctly. Now I would like to calculate the average of one parameter in two different files. I wrote this script, but it doesn't show me any outputs. Could you please tell me what is the problem? 'reinit'
'open E:\test.ctl'
'set t 5'
'set lat 7'
'set lon 107'
'define r1= sst'
'close 1'
'sdfopen sst.nc'
'set t 5'
'set lat 7'
'set lon 107'
'define r2= sst'
'define aver= (r1+r2)/2'
'd aver'
Ar=subwrd(result,4)
say Ar
Regards, T.
>
>
> Today's Topics:
>
> 1. Re: Average in two different time and locations (T. haghroosta)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 5 Feb 2013 16:52:21 +0000
> From: "T. haghroosta" <haghroosta at hotmail.com>
> Subject: Re: [gradsusr] Average in two different time and locations
> To: <gradsusr at gradsusr.org>
> Message-ID: <DUB121-W46FE8940A7C33FF388D9D9DD000 at phx.gbl>
> Content-Type: text/plain; charset="windows-1256"
>
>
> Dear Ricardo, Thank you very much it finally worked.Thank you all other helpers. Regards, T.
>
> >
> > Today's Topics:
> >
> > 1. Re: problems with the command regrid in my suse (Jeff Duda)
> > 2. script to several files (Estefan?a Jim?nez)
> > 3. Re: Plot wind vector and magnitude
> > (Endalkachew Bekele - NOAA Affiliate)
> > 4. Re: Average in two different time and locations (Ricardo Hallak)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Tue, 5 Feb 2013 09:56:00 -0600
> > From: Jeff Duda <jeffduda319 at gmail.com>
> > Subject: Re: [gradsusr] problems with the command regrid in my suse
> > To: GrADS Users Forum <gradsusr at gradsusr.org>
> > Message-ID:
> > <CAAig09Bo-9SPKQaDTY17CmZ6oZDe946meEGcLAYnkSK8CapfFg at mail.gmail.com>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> > If you're using Grads (not opengrads) then those functions defined outside
> > of Grads will not be available to you. You can use the lterp() function,
> > however. It should do the same thing as regrid().
> >
> > Jeff Duda
> >
> > On Tue, Feb 5, 2013 at 9:28 AM, decker guzman <deckerfis at gmail.com> wrote:
> >
> > > * *I want to regrid my data and I am using GrADS Version 2.0.1 (not opengrads in
> > > windows). I have tried
> > > "regrid(uwnd,2.5,2.5)"," regrid2(uwnd,2.5,2.5)" and "re(uwnd,2.5,2.5)" .
> > >
> > > However error messages were displayed and said 'regrid' not a variable
> > > or function name , 'regrid2' not a variable or function name and 're'
> > > not a variable or function name respectively..
> > > could someone help me please?
> > >
> > > Decker
> > >
> > >
> > > _______________________________________________
> > > gradsusr mailing list
> > > gradsusr at gradsusr.org
> > > http://gradsusr.org/mailman/listinfo/gradsusr
> > >
> > >
> >
> >
> > --
> > Jeff Duda
> > Graduate research assistant
> > University of Oklahoma School of Meteorology
> > Center for Analysis and Prediction of Storms
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130205/d8e0e633/attachment-0001.html
> >
> > ------------------------------
> >
> > Message: 2
> > Date: Tue, 5 Feb 2013 10:07:59 -0600
> > From: Estefan?a Jim?nez <estefaniajimenez.r at gmail.com>
> > Subject: [gradsusr] script to several files
> > To: GrADS Users Forum <gradsusr at gradsusr.org>
> > Message-ID:
> > <CAL2qOoLeAmwUdTDXuw6ydDakmqxyTT07kBnsGBzQNJNNLBCiOg at mail.gmail.com>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> > Hi all! How can I do to do a script that plots and saves the same image for
> > several files? For example, I have 30 files that I need to get the rain in
> > an image and save it... I have the script for one file but how can I change
> > it to make it work for all the 30 files? So I don't have to run the script
> > 30 times...
> >
> > Thanks!
> >
> > --
> > *Estefan?a Jim?nez R.*
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130205/a1e0f309/attachment-0001.html
> >
> > ------------------------------
> >
> > Message: 3
> > Date: Tue, 5 Feb 2013 11:17:01 -0500
> > From: Endalkachew Bekele - NOAA Affiliate
> > <endalkachew.bekele at noaa.gov>
> > Subject: Re: [gradsusr] Plot wind vector and magnitude
> > To: beregassa at gmail.com, GrADS Users Forum <gradsusr at gradsusr.org>
> > Message-ID:
> > <CAN1MjmeSJYMdgLoS_VR4he3ZsjLj7ZL-W4+MziUyRC90e=4THg at mail.gmail.com>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> > hi Bedasa,
> >
> > How are you doing?
> >
> > I hope all is well in Arba Minch.
> >
> > I saw your script, and I have attempted to edit it a little bit:
> >
> > reinit'
> > 'set display color white'
> > 'c'
> > 'set grid off'
> > 'set grads off'
> > 'sdfopen v850.nc'
> > 'sdfopen u850.nc'
> > 'set mpdset hires'
> > 'set lat -40 40'
> > 'set lon -180 180'
> > i=1
> > while(i<=3)
> > 'set t 'i
> > 'set gxout shaded'
> > 'd mag(v850.1,u850.2)'
> > 'set gxout vector'
> > 'd v850.1;u850.2'
> > pull pause
> > 'c'
> > i=i+1
> > end while
> >
> > This will pause you display until you hit the enter key. Then it will take
> > you the next time step. agin it will pause, and when you hit the enter key
> > it will take you to the last (third) time step.
> >
> > Let me know if you are nor able to run it.
> >
> > Blessings,
> > Endalkachew
> >
> >
> >
> >
> >
> > On Tue, Feb 5, 2013 at 8:59 AM, Bedassa Regassa <beregassa at gmail.com> wrote:
> >
> > >
> > >
> > > Hello, I try to write the following script to plot wind vector and
> > > magnitude. But, I can't see the wind magnitude. I like a comment on my
> > > script here is attached
> > > 'reinit'
> > > 'set display color white'
> > > 'c'
> > > 'set grid off'
> > > 'set grads off'
> > > 'sdfopen v850.nc'
> > > 'sdfopen u850.nc'
> > > 'set mpdset hires'
> > > 'set lat -40 40'
> > > 'set lon -180 180'
> > > 'set t 1 3'
> > > 'set gxout shaded'
> > > 'd mag(v850.1,u850.2)'
> > > 'set gxout vector'
> > > 'd v850.1;u850.2'
> > >
> > > Thank you.
> > >
> > > Sincerely,
> > >
> > > Bedassa
> > >
> > > _______________________________________________
> > > gradsusr mailing list
> > > gradsusr at gradsusr.org
> > > http://gradsusr.org/mailman/listinfo/gradsusr
> > >
> > >
> >
> >
> > --
> > -----------------------------------------------------------------------------------
> > Endalkachew Bekele
> > NOAA Center for Weather and Climate Prediction / African Desk
> > 5830 University Research Court, Rm 3149
> > College Park, Maryland 20740
> > Tel: (301) 683-3459
> > e-mail: endalkachew.bekele at noaa.gov
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130205/fd9fff5f/attachment-0001.html
> >
> > ------------------------------
> >
> > Message: 4
> > Date: Tue, 5 Feb 2013 13:25:51 -0300
> > From: "Ricardo Hallak" <hallak at model.iag.usp.br>
> > Subject: Re: [gradsusr] Average in two different time and locations
> > To: GrADS Users Forum <gradsusr at gradsusr.org>
> > Message-ID: <20130205155234.M10066 at model.iag.usp.br>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> > Hi,
> >
> > one suggestion is to add something like:
> > AT=subwrd(result,4)
> > after:
> > 'd aveT'
> > in your script below. This will capture the aveT information in a new script variable named AT.
> > Now you can handle AT. For example, you can display AT in the terminal screen adding:
> > say AT
> >
> > in your script.
> >
> > Or you can plot AT (a single value) on the map using, for example:
> >
> > 'draw string X Y 'AT
> >
> > NOTE: every quote and blank space in the lines above or below are essential. Let me put the entire script here:
> >
> > 'set t 1'
> > 'set lat 35'
> > 'set lon 90'
> > 'define T1= T'
> > 'set t 2'
> > 'set lat 20'
> > 'set lon 72'
> > 'define T2=T'
> > 'define aveT=(T1+T2)*0.5'
> > 'd aveT'
> > AT=subwrd(result,4)
> > say AT
> >
> > Again, you can "draw" the most recent value of AT on the map, if you want, converting world coordinates (lon,lat) to (x,y) coordinates. (x,y) are the distance of a (x,y) point from the (0,0), that is, the southwestern point of the display window (in inchs of the GrADS page). For example, assuming your data has 200 x 200 points, you can add these lines in your script:
> >
> > 'set x 1 200'
> > 'set y 1 200'
> > 'd T'
> > 'q w2xy 55 81'
> > xpoint=subwrd(result,3)
> > ypoint=subwrd(result,6)
> > 'draw string 'xpoint'? 'ypoint'? 'AT
> >
> > This will plot the AT value? at the the point (xpoint,ypoint) over a T field map, where 55 and 81 arethe averages of the longitude and latitude, respectively. Of course, you can chose whatever point you want in the 2D map.
> >
> > Greetings,
> > Ricardo
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130205/48ca456f/attachment-0003.html
More information about the gradsusr
mailing list