[Thread Prev][Thread Next][Index]

Re: masking of land data(problem solved)



Hello Mick,

The problem is solved fully concerning the above subject problem.

I saved the files like :
save/file=land_mask_data.nc/append co2_ocean

after appending the variable.

I want to give thanks again to you.

Regards,
Yogesh

.Spillane@noaa.gov wrote:
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







--

===========================================
Yogesh K. Tiwari,
Max-Planck Institute for Biogeochemistry,
Beutenberg Campus, Hans-Knoell-Strasse 10,
D-07745 Jena,
Germany

Office   : 0049 3641 576 376
Home     : 0049 3641 223 163
Fax      : 0049 3641 577 300
Cell     : 0049 1520 4591 008
e-mail   : yogesh.tiwari@bgc-jena.mpg.de
===========================================



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement