hirs_proc

Uses AVHRR and HIRS data from the same satellite swath, masks out bad data strips (calibration lines) from the HIRS data, and masks out the area of the volcanic cloud from the HIRS data using the AVHRR band 4-5 technique

The script is below between the horizontal rules.



:
echo -n "Enter input HIRS name: "
HIRS=`line`
if [ ! -f $HIRS ] ; then
	echo $HIRS: file does not exist
	exit
fi

echo -n "Enter input AVHRR name: "
AVHRR=`line`
if [ ! -f $AVHRR ] ; then
	echo $AVHRR: file does not exist
	exit
fi

if [ "$AVHRR" = "$HIRS" ] ; then
	echo Equal?????  use different names
fi

echo masking bad data....
echo making mask.....
emath expr_vars="hirs_ch2" \
expression="(x1*0)+1" \
var_name="mask" \
var_units="-" \
var_type="fl" \
$HIRS mask.stripe
 
for I in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19
do
	I2=`echo $I | sed 's/^0//'`
	echo processing channel${I}....
	emath2 file1_vars="mask" \
	file2_vars="*ch${I2}" \
	expression=x1*x2 \
	var_name="ch${I}" \
	var_units="-" \
	var_type="fl" \
	mask.stripe $HIRS  mask${I}.hirs
done

echo processing latitude....
emath2 file1_vars="mask" \
file2_vars="lat*" \
expression=x1*x2 \
var_name="lat" \
var_units="-" \
var_type="fl" \
mask.stripe $HIRS  masklt.hirs

echo processing longitude...
emath2 file1_vars="mask" \
file2_vars="long*" \
expression=x1*x2 \
var_name="lon" \
var_units="-" \
var_type="fl" \
mask.stripe $HIRS  masklo.hirs

echo assmbling variables.....
assemble include_vars="*" \
extend_names="no" \
instantiate="yes" \
mask*.hirs hirs.mask.stripe 

echo deleating temp variables....
\rm mask*.hirs mask.stripe

echo Registering HIRS data.....
fastreg master_file="Master" \
include_vars="-" \
poly_size="100" \
hirs.mask.stripe $HIRS.reg

echo doing avhrr band subtraction...
emath expr_vars="avhrr_ch4 avhrr_ch5" \
expression="(x1-x2)" \
var_name="4m5" \
var_units="-" \
var_type="fl" \
$AVHRR $AVHRR.4m5 

echo setting cutoff of 4m5 for cloud mask
inrange range_var="4m5" \
range_minmax="-25 -0.5" \
include_vars="-" \
$AVHRR.4m5 $AVHRR.4m5.masked

echo copying mask into avhrr file
copyvar include_vars="4m5" \
overwrite_vars="no" \
$AVHRR.4m5.masked $AVHRR

echo Registering AVHRR data.....
fastreg master_file="Master" \
include_vars="-" \
poly_size="100" \
$AVHRR $AVHRR.reg
 
echo masking volcanic cloud
echo making mask.....
emath expr_vars="4m5" \
expression="(x1*0)+1" \
var_name="mask" \
var_units="-" \
var_type="fl" \
$AVHRR.reg mask.cloud
 
for I in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19
do
	echo processing channel${I}....
	emath2 file1_vars="mask" \
	file2_vars="*ch${I}" \
	expression=x1*x2 \
	var_name="ch${I}" \
	var_units="-" \
	var_type="fl" \
	mask.cloud $HIRS.reg  mask_cloud${I}.hirs
done

echo processing latitude....
emath2 file1_vars="mask" \
file2_vars="lat*" \
expression=x1*x2 \
var_name="lat" \
var_units="-" \
var_type="fl" \
mask.cloud $HIRS.reg  mask_cloudlt.hirs

echo processing longitude...
emath2 file1_vars="mask" \
file2_vars="lon*" \
expression=x1*x2 \
var_name="lon" \
var_units="-" \
var_type="fl" \
mask.cloud $HIRS.reg  mask_cloudlo.hirs

echo assmbling variables.....
assemble include_vars="*" \
extend_names="no" \
instantiate="yes" \
mask_cloud*.hirs $HIRS.masked 

echo deleating temp variables....
\rm mask_cloud*.hirs mask.cloud

echo exporting ascii data
expasc include_vars="*" \
all_same_dim="yes" \
list_dims="no" \
$HIRS.masked hirs.mask.cloud.ascii

echo removing bad data.....
sed -e '/^[0-9]/!d' hirs.mask.cloud.ascii > $HIRS.ascii
echo removing temp variables....
\rm hirs.mask.cloud.ascii hirs.mask.stripe

echo computing stats....
wc -l $HIRS.ascii > a
stats include_vars="*" \
printout="no" \
$HIRS.reg > b
cat a b > $HIRS.stats
\rm a b

This page maintained by Dave Schneider (djschnei@mtu.edu)