Dear all, I want to mask a coarse resolution data (upper left plot) outside a region of interest. I can do that (upper right plot) but the probelm is: because of corase data resolution only portion of desired area is covered (and also some undesired area outside the boundary). I can solved the problem of coverage by first interpolating the coarse resolution data to a high resolution grid (lower left plot) but the problem is: data is now smoothened. What I want is: to keep the original magnitude at each location but also be able to mask out data outside region of interest. Someone suggested this could be done by resampling data but I have no idea how to do that. I would appreciate any suggestions. Below is my script for generating those plots sh d currently SET data sets: 1> GPCPv2.2.precip.JJAS.mean.nc name title I J K L PRECIP Average Monthly Rate of Precipi 1:144 1:72 ... 1:19 2> NPL_adm0_box.nc (default) name title I J K L MASK IF PT_IN_POLY(TEMP[L=1,D=3],LON 1:455 1:300 1:1 1:1 ! originial data set vi ul shade/nolab precip[d=1,l=1,x=79:89,y=25:31];go land 1,,1 ! mask interpolated to the data grid of 2.5 deg resolution set vi ur def grid/x=mask[d=2,gxy=precip[d=1]]/y=mask[d=2,gxy=precip[d=1]] gxy1 let dummy1=0*x[gx=gxy1]*y[gy=gxy1] let N_NoTime1=reshape(mask[d=2,l=1,gxy=gxy1],dummy1); let Nmask1= if N_NoTime1 then 1 let prm1=precip[d=1]*nmask1 shade/nolab/lev prm1[l=1,x=79:89,y=25:31];go land 1,,1 ! mask and data interpolated to a fine grid of 0.1 deg resolution set vi ll def axis/x=78E:91E:0.1 xax; def axis/y=25N:31N:0.1 yax; def grid/x=xax/y=yax gxy2 let dummy2=0*x[gx=gxy2]*y[gy=gxy2] let N_NoTime2=reshape(mask[d=2,l=1,gxy=gxy2],dummy2); let Nmask2= if N_NoTime2 then 1 let prm2=precip[d=1,gxy=nmask2]*nmask2 shade/nolab/lev prm2[l=1,x=79:89,y=25:31];go land 1,,1 Best regards, Jagadish
Attachment:
Picture1.png
Description: PNG image