[Thread Prev][Thread Next][Index]

Re: [ferret_users] how to extract 2D subgrid variance?



let h2 = h^2
let h2_ave = h2[gx= . . . @AVE, gy= . . . @AVE]
let h_ave= h[ . . . average  . . .]
let h_var = h2_ave - h_ave*h_ave
 
Brilliant, it works. Thanks Ryo.
 
lev
 
Lev Tarasov -   Dept of Physics and Physical Oceanography,
		Memorial University of Newfoundland.
email: lev@xxxxxx
Date: Sun, 18 Aug 2019 13:26:43
From: Ryo Furue <furue@xxxxxxxxxx>
To: Lev Tarasov <lev@xxxxxx>
Cc: users Group Ferret <ferret_users@xxxxxxxx>
Subject: Re: [ferret_users] how to extract 2D subgrid variance?
 
Dear Lev,
 
On Sat, Aug 17, 2019 at 2:30 AM Lev Tarasov <lev@xxxxxx> wrote:
 
        At times I need to extract the subgrid variance of a bed
topography, and I've been using:
let hbvar=HBG[gx=XLONGRF5@var,gy=YLATGRF25@var]
! HBG is from a higher resolution data set
 
but have just noted (from some explicit checking and then rechecking the
ferret docs):
 
Note: This transformation is suitable for regridding only in a single
axis. [ . . . ]
So how can I regrid/extract the 2D subgrid variance?
 
 
This idea hasn't been tested, but I think you can calculate the correct 2D variance using @AVE, which does a 2D averaging (See the Ferret User Guide):
 
let h2 = h^2
let h2_ave = h2[gx= . . . @AVE, gy= . . . @AVE]
let h_ave= h[ . . . average  . . .]
let h_var = h2_ave - h_ave*h_ave
 
Note that ave( [a - ave(a)]^2 ) = ave(a^2) - [ave(a)]^2 .
 
Cheers,
Ryo
 
 

[Thread Prev][Thread Next][Index]