NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: [idvusers] time selection and area averages

Hi Suvarchal,
                 I probably didn't understand your area averaged correctly,
are you looking for something like: global averaged of surface temperature.
If so, you can certainly use the formula:

GridMath.applyFunctionOverLevels(S, GridMath.FUNC_AVERAGE)

and the input field S can be a temperature at the certain level. If you
want to average a specific region of your dataset, you can do the subset
first on the dataset property window.   To subset a certain time steps, you
probably want to do it in the dataset property window, it is very flexible
to do it this way than calling a formula.


Yuan



On Thu, May 28, 2015 at 5:16 PM, Suvarchal Kumar <
suvarchal.kumar@xxxxxxxxxxxxxxx> wrote:

>  Hi Yuan,
>                  Probably i am asking too much,
> I have seen getNthTimeGrid,  same as doing field.getSample(Nthtime),
> Actually I was wondering If i can subset a field(time|100,lat,lon) at
> select times , say at indices 2,40,30,90 as a new field, so that i could
> plot it as one variable/process it further. last resort for me would be
> declare a new field and use a loop setSample to create the new variable. It
> would be great to have some thing like pass array of time indices to a
> method to get all newtimes at once.
>
> i have tried rects(field.D=??) on a global field and with different
> smoothing Integers and I dont seem to get a global area averaged value, any
> example on a variable like field(time|100,lat|90,lon|180) would be helpful.
>
> Thanks,
> Suvarchal
>  ------------------------------
> *From:* Yuan Ho [yuanho@xxxxxxxx]
> *Sent:* Tuesday, May 26, 2015 8:08 PM
> *To:* Suvarchal Kumar
> *Cc:* idvusers@xxxxxxxxxxxxxxxx
> *Subject:* Re: [idvusers] time selection and area averages
>
>   Hi Suvarchal,
>            We have a few area average formulas available, such as
> rects(field, D=2) for the rectangular aperature smoothing,  and you can
> check out the Jython libraries under Grid Diagnostics. There is also a
> formula named getNthTimeGrid(field, Nth) for your second request under the
> Grid Routines.
>
>
>  Yuan
>
> On Mon, May 25, 2015 at 3:24 PM, Suvarchal Kumar <
> suvarchal.kumar@xxxxxxxxxxxxxxx> wrote:
>
>> Hi All, I am trying to write some jython scripts to make a composite
>> views,
>>
>> two things i cant figure out in my script:
>> 1) I want  to compute and display average of a grid at every time step.
>>
>> I feel there must be better way to do then loop around this to get an
>> Average
>> ucar.unidata.util.Misc.getAverage(avgvariable.getSample(i).getFloats()[0])
>> --well i can live with it.
>>
>> I am ok with an average but would like area average, i havent seen a
>> direct function(?), is there a way to get area of each grid box? that i
>> could multiply and average myself? I think i saw it somewhere  but cant
>> find where.
>>
>> 2) how to access a grid at particular time subset passed as an array?
>>   i have a gridded dataset with N times as timeset, would like to have
>> newvariables at time indices 1,2,7 or specified by time values, into a new
>> variable.
>>
>> so I would like to get  only a particular time subset of a grid specified
>> by a time array list(either index or value). This works as part of
>> Dataselection before reading dataset but cant manage it with a variable
>> after it is loaded?
>>
>> Cheers,
>> Suvarchal
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> idvusers mailing list
>> idvusers@xxxxxxxxxxxxxxxx
>> For list information, to unsubscribe, visit:
>> http://www.unidata.ucar.edu/mailing_lists/
>>
>>
>


  • 2015 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the idvusers archives: