[Thread Prev][Thread Next][Index]

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]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement