[Thread Prev][Thread Next][Index]

Re: [ferret_users] variance up to a time-varying level



Andrew,

That is exactly what I needed. Creating a mask crossed my mind, but I
couldn't get it to work. Your trick of using the vertical index values is
the syntax I was missing.

Thanks,
   Bill


On 4/4/06 4:20 PM, "Andrew Wittenberg" <Andrew.Wittenberg@noaa.gov> wrote:

> Hi Bill,
> 
> You could use a masking expression to eliminate (set to missing) all
> points above the highest cloud top level, and then compute the variance of
> that masked field.  E.g.
> 
> let w_below = IF k[gk=w] LE cloud_top_lev THEN w
> let w_var = w_below[i=1:`w,r=iend`@var,j=1:`w,r=jend`@var,k=@var]
> 
> Andrew
> 
> On Tue, 4 Apr 2006, Gustafson, William I wrote:
> 
>> I have come up with an algorithm that works at one time, but it fails
>> when applied to a multi-time dataset because I have to evaluate an
>> expression to a scalar to get it into the k=1:`lev`@var command. If
>> anybody can get around this problem, I would be grateful for your
>> assistance.
>> 
>> Here is what I am doing right now...
>> 
>> let cloudthresh = 0.00001
>> let cloudmixr = qcloud+qice
>> let event_mask = cloudmixr[k=@evnt:`cloudthresh`]   !Counts number of cloudy
>> cells from the bottom of the domain
>> let event_max = event_mask[k=@max]   !At each column, find out how many
>> cloudy cells exist
>> let event_max_mask = if event_mask eq event_max then 1   !Make a mask that
>> goes to 1 at the top of the clouds for each col.
>> let cloud_top_lev3d = event_max_mask[k=@loc:1]    !The level of the highest
>> cloud top within each column
>> let cloud_top_lev = cloud_top_lev3d[i=@max,j=@max]  !The single highest
>> cloud top level in the domain
>> let w_var =
>> w[i=1:`w,return=iend`@var,j=1:`w,return=jend`@var,k=1:`cloud_top_lev`@var]
>> !Variance of w up to cloud_top_lev
> 
> 

--------------------------------------------------------------------
William I. Gustafson Jr.
Atmospheric Science and Global Change Division
Pacific Northwest National Laboratory
3200 Q Ave., MSIN K9-30
Richland, WA 99352
(509)372-6110


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement