![]() |
![]() |
Suppose we want to put some MODIS 250 m Level 1b swath data covering all of Greenland into the same grid used in Tutorial 1, except that we want to change the resolution of the grid from 1.25 km to 250 m. We want to grid reflective channels 1 and 2, which are the only MODIS channels available at 250m. We need to order MOD02QKM data; however, as we can see in Supported Data Sets, the lat-lon data are stored at only 1 km resolution in MOD02QKM granules. Therefore, mod02.pl will need to interpolate the 1 km lat-lon data in the MOD02QKM granules to 250 m resolution. There is no need to work with MOD03 granules since the lat-lon data are also at 1 km resolution in MOD03 granules and we're not gridding any ancillary data.
NOTE: To run this example, you'll need a machine with at least 750 MB of memory and about 1.5 GB of free disk space.
Let's assume that we want to use data from the same date and time as in Tutorial 1, except that this time we want to search for MOD02QKM granules rather than MOD021KM and MOD03 granules. We use the EDG to order two MOD02QKM granules acquired on June 1, 2000 at 1445 and 1450 that appear to cover Greenland. You can use the following values for performing the search using the EDG:
Data Set
MODIS/TERRA CALIBRATED RADIANCES 5-MIN L1B SWATH 250M
Search Area
Type in Lat/Lon Range:
Northern latitude: 85.0000
Southern latitude: 60.0000
Western longitude: -80.0000
Eastern longitude: 10.0000
Start Date: 2000-06-01 Time (UTC): 14:00:00
End Date: 2000-06-01 Time (UTC): 15:00:00
The search should find two granules having the following names:
MOD02QKM.A2000153.1445.002.2000156075718.hdf
MOD02QKM.A2000153.1450.002.2000156075717.hdf
Note that June 1, 2000 is day-of-year 153.
Order and download the above files to some directory we'll call the tutorial_2 directory where you have at least 1.5 GB of free disk space. Note that you can also download the *.met files that accompany the *.hdf files, but the MS2GT software doesn't use them.
Create a text file in the tutorial_2 directory called gl250_2000153_1445.csh containing the following line:
mod02.pl . gl250_2000153_1445 listfile.txt Gl0250.gpd chanfile.txt none Q
This command specifies the following information (see mod02.pl):
Make gl250_2000153_1445.csh executable by typing:
chmod +x gl250_2000153_1445.csh
Create a text file called listfile.txt in the tutorial_2 directory containing the following two lines:
MOD02QKM.A2000153.1445.002.2000156075718.hdf
MOD02QKM.A2000153.1450.002.2000156075717.hdf
Note that we list the MOD02QKM files to be gridded.
Let's review the Gl1250.gpd file we created in Tutorial 1:
N200correct.mpp map projection parameters
# EASE-Grid
1860 1740 columns rows
# Greenland
160
grid cells per map unit
# 1.25 km
1949.5 -250.5 map origin column,row
We wish now to create Gl0250.gpd which will specify the same grid but at 250 m resolution rather than 1.25 km. The mpp file will be the same, namely N200correct.mpp. Note that 1250 / 250 = 5, so the number of columns and rows in Gl0250.gpd will be 5 * 1860 = 9300 columns and 5 * 1740 = 8700 rows. The grid cells per map unit will be 5 * 160 = 800. The map origin column will be 5 * (1949.5 + 0.5) - 0.5 = 9749.5 and the map origin row will be 5 * (-250.5 + 0.5) - 0.5 = -1250.5. We now have all the information we need to create Gl0250.gpd in the ms2gt/grids directory (if you don't want to type the file in, then just copy Gl0250.gpd from the ms2gt/tutorial_2 directory to the ms2gt/grids directory):
N200correct.mpp map projection parameters
# EASE-Grid
9300 8700 columns rows
# Greenland
800
grid cells per map unit
# 250 m
9749.5 -1250.5 map origin column,row
Once Gl0250.gpd has been created in the ms2gt/grids directory, we can use gtest again to check that the latitude and longitude values of the upper left and lower right corners match those in Gl1250.gpd:
gtest
enter .gpd file name: Gl1250.gpd
> assuming old style fixed format file
gpd: /hosts/snow/AVHRR/pathfinder/grids/Gl1250.gpd
mpp:/hosts/snow/AVHRR/pathfinder/grids/N200correct.mpp
forward_grid:
enter lat lon:
inverse_grid:
enter r s: -0.5 -0.5
lat,lon = 67.700233 -82.694237 status = 1
col,row = -0.500000 -0.499863 status = 1
enter r s: 1859.5 1739.5
lat,lon = 67.400612 -2.589502 status = 1
col,row = 1859.500000 1739.500000 status = 0
enter r s:
enter .gpd file name: Gl0250.gpd
> assuming old style fixed format file
gpd: Gl0250.gpd
mpp:/hosts/snow/AVHRR/pathfinder/grids/N200correct.mpp
forward_grid:
enter lat lon:
inverse_grid:
enter r s: -0.5 -0.5
lat,lon = 67.700233 -82.694237 status = 1
col,row = -0.500000 -0.499390 status = 1
enter r s: 9299.5 8699.5
lat,lon = 67.400612 -2.589502 status = 1
col,row = 9299.500000 8699.500000 status = 0
enter r s:
enter .gpd file name:
Note that we used -0.5 -0.5 to specify the upper left corner of the upper left pixel (rather than 0 0 which would be the center of the upper left pixel) for both Gl1250.gpd and Gl0250.gpd, and that the resulting latitude and longitude values were the same, namely 67.700233 N and 82.694237 W, respectively. Similarly, we used 1859.5 1739.5 for the lower right corner of the lower right pixel for Gl1250.gpd and 9299.5 8699.5 for the lower right corner of the lower right pixel for Gl0250.gpd, and that the resulting latitude and logitude values were the same, namely 67.400612 N and 2.589502 W, respectively.
Create a text file in the tutorial_2 directory called chanfile.txt containing the following two lines:
1 reflectance
2 reflectance
Here we specify that we want two output grids to be created containing channel 1 reflectance and channel 2 reflectance, respectively. Each file will consist of an array of binary floating-point numbers. Since we didn't specify weight type or fill, they are set to their default values, namely "avg" and "0".
Run the shell script containing the mod02.pl command by changing to the tutorial_2 directory, and then typing:
gl250_2000153_1445.csh
You'll see lots of messages displayed while the mod02.pl script runs various IDL and C programs. In this example, the programs include:
The final message should contain the string:
MOD02: MESSAGE: done
Enter the command:
ls -l *.img
You should see something like this:
-rw-r--r-- 1 haran nsidc
323640000 Apr 23 13:26 gl250_2000153_1445_refa_ch01_09300_08700.img
-rw-r--r-- 1 haran nsidc
323640000 Apr 23 13:29 gl250_2000153_1445_refa_ch02_09300_08700.img
Each file contains a gridded array of 9300 columns and 8700 rows of binary floating-point values (9300 * 8700 * 4 = 323640000 bytes).
The file naming convention for gridded channel files can be found in Tutorial 1.
Last updated: January 2, 2002 by
Terry Haran
NSIDC-CIRES
449 UCB
University of Colorado
Boulder, CO 80309-0449
303-492-1847
tharan@nsidc.org