On Wed, 2 Mar 2005, Yogesh K. Tiwari wrote:
How to mask the land data to see the monthly
variation(time series) at only ocean and vice versa.
Hi Yogesh,
What you need to do is to access one of the bathymetry files
and use it to define a land/sea mask ON THE SAME GRID as your dataset.
Try the following ... good luck,
Mick
!-------- demo of land/sea mask generation -----------
! FERRET SESSION 1 - make a fake dataset in a lat-lon region
def axis/x=100e:160e:1/units=longitude xax
def axis/y=50s:10s:1/units=latitude yax
def grid/x=xax/y=yax grd
let v=randu(x[g=grd]+y[g=grd])
save/file=mydata.nc v
quit ! end the ferret session
! FERRET SESSION 2
! 1) read in the datafile (with no mask of its own) ...
use mydata.nc
shade v
! 2) pick a bathymetry file (a bit finer than your data grid)
use etopo20
! 3) see how it looks ...
shade/o/pal=grey if(rose ge 0)then 1
! 4) give a name to the grid of the variable you want to examine
def grid/like=v[d=1] grd
! 5) regrid "rose" to the grid of your variable and check it out
let myrose=rose[d=2,g=grd]
shade/o/pal=black if(myrose ge 0)then 1
! 6) define the mask and use it to define vland ...
let land=if(myrose ge 0)then 1 else 0
let vland=if(land eq 1)then v[d=1]
shade vland
! 7) ... and vsea
let vsea=if(land eq 0)then v[d=1]
shade vsea