Dear Ansley,
thanks for the suggestion, it works and I am able to create the mask. However
I still have a question, since I am not sure about the averaging. What I did
is:
! Create Mask
let Mask_Tropics = if lat gt -30 and lat lt 30 then 1
! Mask the variable also multiplying it by grid area
New_SST = Mask_Tropics * Area * SST
! Compute and Plot spatial mean
plot New_SST[i=@ave,j=@ave]
I think last step is wrong since ferret attempts to compute a "fake" area of
cells. So how can I avoid it accounts for the area? Maybe could I use @sum
instead of @ave and then divide by the number of points that fall inside the
sub-region?! If so, how can I compute the number of points where Mask_Tropics =
1?
Thanks for help
Regards
Markus
----Messaggio originale----
Da: ansley.b.manke@xxxxxxxx
Data: 03/11/2011 17.40
A: "markus.mingel@xxxxxxxxx"<markus.mingel@xxxxxxxxx>
Cc:<oar.pmel.ferret_users@xxxxxxxx>
Ogg: Re: [ferret_users] Spatial average on irregular domain
Hi-
This is not a simple question, is it. The size of the grid cells on a
curvilinear grid may vary from cell to cell, so to compute an accurate
average you would need to find a way to compute the area of the cells.
On a rectilinear grid, Ferret computes the actual size of the grid cells
using a simple latitude correction, but it does not have a means of
doing that on a curvilinear grid. Does the dataset have variables that
describe the area of cells? Some datasets do include that information.
If so then we could find a way to create a mask using the curvilinear
coordinate variables, along the lines of
let mask = if curv_lat gt -30 and curv_lat lt 30 then 1
and compute the average of the data multiplied by that mask. Another
option would be to regrid the data to a rectilinear grid and take the
average of the regridded field over the region.
Ansley
On 11/3/2011 6:09 AM, markus.mingel@xxxxxxxxx wrote:
Dear All,
I am trying to perform a spatial average on irregular domain.
I know how to do that on regular domains:
let regional_ SST = SST[x=-180:180@ave,y=-30:30@ave]
however this command does not work or curvilinear grids. Could you please
suggest me how to compute spatial averages in such case?
Thanks for help
Regards
Markus