[Thread Prev][Thread Next][Index]

Re: [ferret_users] Replacing values of rectangular region in Variable



Dear Satyesh,

On Wed, Oct 21, 2020 at 2:39 PM Satyesh Ghetiya <satyeshghetiya@xxxxxxxxx> wrote:

I have two variables having same temporal range, but different spatial range. Let say name of the variable having larger region is big and name of the variable having smaller region (subset region of big) is small. 
e.g.,    big has spatial range   40:150 E, -30:30 N
and small has spatial range    50:100 E, 0:10 N    (subset region of big)

I want to replace values of big with that of small in the region 50:100 E, 0:10 N. In short, I want to replace the values of big so that it has values of small in subregion rectangle.

That can be accomplished in two steps:

1) Extend the domain of "small" to that of "big"
 → The extended "small" will be undefined outside the original small domain.

2) Merge, using "small" where it's defined or "big" otherwise.

I'm attaching a self-contained example, which you can run on your ferret command line.

Ryo
-------------
set data coads_climatology

! create a fake "small" datafile.
save/clobber/file=small.nc SST[x=120E:180,y=0:40N]

set data small.nc

let big   = UWND[d=coads_climatology]
let small = SST[d=small]

let small_extended = small[g=big]  ! (1) extend
let merged = missing(small_extended, big)  ! (2) merge

fill/l=1 small
pause
fill/l=1 small_extended
pause
fill/l=1 big
pause
fill/l=1 merged


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement