Today I will discuss the usage of maskout function, which is simple but powerful.
syntax:
maskout(expression, mask)
It basically means using a mask from 'mask' file/variable to remove the corresponding grids in 'expression' data/variable.
(1) If you already have some mask files:
ga->d maskout(data,mask(t=1))
this command will suffice.
Remember to put (t=1) behind the mask, because most of well-made mask files don't have time step.
if the mask is 0 and 1, then you either change the undef value in the mask control file into 0 (the actual missing value in the binary file); or just use maskout(data,data-0.5), then all the value below 0 will be maskout.
(2) If you need to make mask files by yourself:
for example,
if you want to mask out the value lower than 100, in other words, you want to leave the value greater than 100,
ga->define mask = const(maskout(data,data-100),1)
if you want to mask out the slope that insignificant with p>0.05,
ga->define mask = const(maskout(p,0.05-p),1)
Notice the difference here, for conditioning data > value, then the mask = data-value; for conditioning data < value, then the mask = value-data.
Besides using with const() function to produce mask, maskout can also be combined with aave and tloop to plot time series.
ga->d tloop(aave(maskout(data,mask(t=1)),g))
The idea here is to upscale by spatial averaging the masked region.
syntax:
maskout(expression, mask)
It basically means using a mask from 'mask' file/variable to remove the corresponding grids in 'expression' data/variable.
(1) If you already have some mask files:
ga->d maskout(data,mask(t=1))
this command will suffice.
Remember to put (t=1) behind the mask, because most of well-made mask files don't have time step.
if the mask is 0 and 1, then you either change the undef value in the mask control file into 0 (the actual missing value in the binary file); or just use maskout(data,data-0.5), then all the value below 0 will be maskout.
(2) If you need to make mask files by yourself:
for example,
if you want to mask out the value lower than 100, in other words, you want to leave the value greater than 100,
ga->define mask = const(maskout(data,data-100),1)
if you want to mask out the slope that insignificant with p>0.05,
ga->define mask = const(maskout(p,0.05-p),1)
Notice the difference here, for conditioning data > value, then the mask = data-value; for conditioning data < value, then the mask = value-data.
Besides using with const() function to produce mask, maskout can also be combined with aave and tloop to plot time series.
ga->d tloop(aave(maskout(data,mask(t=1)),g))
The idea here is to upscale by spatial averaging the masked region.
No comments:
Post a Comment