1
|
#! /bin/bash
|
2
|
|
3
|
mkdir /tmp/tmp1
|
4
|
cd /tmp/tmp1
|
5
|
|
6
|
url="ftp://ladsweb.nascom.nasa.gov/allData/6/MOD35_L2/2009/029/"
|
7
|
## two granules that still show interpolation artifacts
|
8
|
granule="MOD35_L2.A2009029.0500.006.2012245113542.hdf"
|
9
|
granule="MOD35_L2.A2009029.0320.006.2012245113606.hdf"
|
10
|
|
11
|
## get swath data
|
12
|
wget $url$granule
|
13
|
|
14
|
## build parameter file
|
15
|
echo "
|
16
|
NUM_RUNS = 1
|
17
|
|
18
|
BEGIN
|
19
|
INPUT_FILENAME = $granule
|
20
|
OBJECT_NAME = mod35
|
21
|
FIELD_NAME = Cloud_Mask|
|
22
|
BAND_NUMBER = 1
|
23
|
OUTPUT_PIXEL_SIZE_X = 1013.0
|
24
|
OUTPUT_PIXEL_SIZE_Y = 1013.0
|
25
|
SPATIAL_SUBSET_UL_CORNER = ( 89.929451 -179.998932 )
|
26
|
SPATIAL_SUBSET_LR_CORNER = ( 64.8638 179.998108 )
|
27
|
RESAMPLING_TYPE = NN
|
28
|
OUTPUT_PROJECTION_TYPE = SIN
|
29
|
ELLIPSOID_CODE = WGS84
|
30
|
OUTPUT_PROJECTION_PARAMETERS = ( 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 )
|
31
|
OUTPUT_FILENAME = out_$granule
|
32
|
OUTPUT_TYPE = HDFEOS
|
33
|
END
|
34
|
" > params.txt
|
35
|
|
36
|
### run it
|
37
|
/usr/local/heg/2.12/bin/swtif -p params.txt -d -tmpLatLondir /tmp/tmp1
|
38
|
|
39
|
## now view the output file in
|