[gradsusr] Advanced Usage of Ave Function

Jeffrey Duda jdduda at iastate.edu
Fri Sep 16 19:23:02 EDT 2011


Yes.

2011/9/16 Rowell, Mason D. <Mason.D.Rowell-1 at ou.edu>

>  Jeff,
>
> On this, should I have at the beginning of my grads script open commands in
> single quotes for each of the 25 files I will be averaging, like I would at
> the command prompt? I'd imagine it would have to be done at some point for
> the script to use it.
>
> Mason
>  ------------------------------
> *From:* gradsusr-bounces at gradsusr.org [gradsusr-bounces at gradsusr.org] on
> behalf of Jeffrey Duda [jdduda at iastate.edu]
> *Sent:* Sunday, August 28, 2011 8:53 PM
> *To:* GrADS Users Forum
> *Subject:* Re: [gradsusr] Advanced Usage of Ave Function
>
>  Mason,
> It sounds like you'll have to hard code the lat/lon boxes for each ave
> command then.  Try something like
>
> lat1.1 = ...
> lat1.2 = ...
> .
> .
> .
> lat1.n = ...
>
> ---
>
> lat2.1 = ...
> lat2.2 = ...
> .
> .
> .
> lat2.n = ...
>
> ---
>
> lon1.1 = ...
> lon1.2 = ...
> .
> .
> .
> lon1.n = ...
>
> ---
>
> lon2.1 = ...
> lon2.2 = ...
> .
> .
> .
> lon2.n = ...
>
> where lat1 and lat2 are the start and end latitudes of the box and lon1 and
> lon2 are th start and end longitudes of the box, and n is the number of
> files.  Then do
>
> a = 1
> sum = 0
> while (a <= n)
>  'd asum(field.'a',lon='lon1.a',lon='lon2.a',lat='lat1.a',lat='lat2.a')'
> *insert commands to take the output value into a new variable called
> summand
>   sum = sum + summand
>  a = a +1
> endwhile
>
> average = sum/n
>
> Is this what you are trying to do?
>
> Jeff Duda
>
> 2011/8/28 Rowell, Mason D. <Mason.D.Rowell-1 at ou.edu>
>
>>  Thank you for your response,
>>
>> The trouble is, I don't want the domains for each file to match. I have
>> GRIB data that I have made ctl files for with grib2ctl.pl but I want to
>> center each file (for a different day) on a different grid point and then
>> average the files. Thus I wouldn't be averaging the same actual grid point
>> in space each time.
>>
>> Mason
>>  ------------------------------
>> *From:* gradsusr-bounces at gradsusr.org [gradsusr-bounces at gradsusr.org] on
>> behalf of James Ciarlo` [james.ciarlo at physics.org]
>> *Sent:* Saturday, August 27, 2011 9:02 AM
>> *To:* GrADS Users Forum
>> *Subject:* Re: [gradsusr] Advanced Usage of Ave Function
>>
>>  try opening them together
>>
>> open file.ctl
>> open file2.ctl
>> open file3.ctl
>> .... etc
>>
>> then set the domain conditions (so that they all match)
>>
>> then just ave. Remember to call the variables with var.1, var.2 depending
>> on the file number.
>>
>> if you give us an example of the commands you are trying to use we can
>> probably help better
>>
>> Regards,
>>
>> James
>>
>> 2011/8/27 zjuyanlibin <zjuyanlibin at 163.com>
>>
>>> **
>>> convert the different domains into a same domain at first step.
>>>
>>>
>>>
>>>  ------------------------------
>>>  *发件人:* Rowell, Mason D.
>>> *发送时间:* 2011-08-27  04:42:50
>>> *收件人:* GrADS Users Forum
>>> *抄送:*
>>> *主题:* [gradsusr] Advanced Usage of Ave Function
>>>  All,
>>>
>>> Is there a way to average several different files (presumably the same variable in each file) but with a different domain setting for each file?
>>>  Mason
>>> _______________________________________________
>>> 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
>>>
>>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
>
> --
> Jeff Duda
> Iowa State University
> Meteorology Graduate Student
> www.meteor.iastate.edu/~jdduda <http://www.meteor.iastate.edu/%7Ejdduda>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Iowa State University
Meteorology Graduate Student
www.meteor.iastate.edu/~jdduda <http://www.meteor.iastate.edu/%7Ejdduda>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110916/1d6bfe56/attachment-0003.html 


More information about the gradsusr mailing list