This script will produce two new files: *.land and *.water where:
*.land=the part of the input file underlain by land.
*.water=the part of th input file underlain by water.
The script is below between the horizontal rules.
echo making land mask emath expr_vars="lsmask" \ expression="x1>0" \ var_name="land" \ var_units="" \ var_type="fl" \ Master land.mask echo making water mask emath expr_vars="lsmask" \ expression="x1<1" \ var_name="water" \ var_units="" \ var_type="fl" \ Master water.mask echo assembling mask file assemble include_vars="land water" \ extend_names="no" \ instantiate="yes" \ land.mask water.mask mask.file \rm land.mask water.mask for I in `ls $1*.reg | cut -c1-14 | sort | uniq` do echo masking $I.reg emath2 file1_vars="avhrr_ch4" \ file2_vars="land" \ expression="x1/x2" \ var_name="avhrr_ch4" \ var_type="fl" \ var_units="" \ $I.reg mask.file land4 emath2 file1_vars="avhrr_ch5" \ file2_vars="land" \ expression="x1/x2" \ var_name="avhrr_ch5" \ var_type="fl" \ var_units="" \ $I.reg mask.file land5 emath2 file1_vars="avhrr_ch4" \ file2_vars="water" \ expression="x1/x2" \ var_name="avhrr_ch4" \ var_type="fl" \ var_units="" \ $I.reg mask.file water4 emath2 file1_vars="avhrr_ch5" \ file2_vars="water" \ expression="x1/x2" \ var_name="avhrr_ch5" \ var_type="fl" \ var_units="" \ $I.reg mask.file water5 assemble include_vars="avhrr_ch4 avhrr_ch5" \ extend_names="no" \ instantiate="yes" \ land4 land5 $I.land assemble include_vars="avhrr_ch4 avhrr_ch5" \ extend_names="no" \ instantiate="yes" \ water4 water5 $I.water \rm land4 land5 water4 water5 done