![]() |
![]() |
Suppose we want to put some MODIS 500 m snow cover swath data covering Colorado into an Azimuthal Equal Area spherical projection centered on 40 N 105 W with the vertical axis of the grid through the center pointing due north towards the top of the grid. We want the grid resolution to be 500 m and we want to use a spherical earth radius value of 6370.997 km. We want the upper left corner of the grid to be at about 44 N 110 W and the lower right corner of the grid to be at about 36 N 100 W. We want to grid all available MOD10_L2 "channels." These include channel 1 Snow Cover and channel 2 Snow Cover Pixel QA. We could simply order MOD10_L2 data; however, as we can see in Supported Data Sets, the latlon data are stored at only 5 km resolution in MOD10_L2 granules. We could have mod10_l2.pl work with only the MOD10_L2 granules (i.e. by setting latlonlistfile to "none"); however we decide to order the corresponding MOD03 granules as well in order to minimize interpolation error.
NOTE: To run this example, you'll need a machine with at least 100 MB of memory and at least 300 MB of free disk space.
Let's assume that we happen to know that the afternoon of September 25, 2000 was fairly clear over Colorado and that there was a significant amount of snow on the ground, so we use the EDG to order two MOD10_L2 granules and the corresponding two MOD03 granules acquired on September 25, 2000 at 1745 and 1750 that appear to cover Colorado and the neighboring region. You can use the following values for performing the search using the EDG:
Data Set
MODIS/TERRA SNOW COVER 5-MIN L2 SWATH 500M
MODIS/TERRA GEOLOCATION FIELDS 5-MIN L1A SWATH 1KM
Search Area
Type in Lat/Lon Range:
Northern latitude: 44.0000
Southern latitude: 36.0000
Western longitude: -110.0000
Eastern longitude: -100.0000
Start Date: 2000-09-25 Time (UTC): 17:00:00
End Date: 2000-09-25 Time (UTC): 18:00:00
The search should find four granules having the following names:
MOD03.A2000269.1745.002.2000282120258.hdf
MOD03.A2000269.1750.002.2000282120547.hdf
MOD10_L2.A2000269.1745.002.2000290231013.hdf
MOD10_L2.A2000269.1750.002.2000290231230.hdf
Note that September 25, 2000 is day-of-year 269.
Order and download the above files to some directory we'll call the tutorial_3 directory where you have at least 300 MB 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_3 directory called colo_2000269_1745.csh containing the following line:
mod10_l2.pl . colo_2000269_1745 listfile.txt Colorado500.gpd 12 latlonlist.txt
This command specifies the following information (see mod10_l2.pl):
Make colo_2000269_1745.csh executable by typing:
chmod +x colo_2000269_1745.csh
Create a text file called listfile.txt in the tutorial_3 directory containing the following two lines:
MOD10_L2.A2000269.1745.002.2000290231013.hdf
MOD10_L2.A2000269.1750.002.2000290231230.hdf
Note that we list the MOD10_L2 files to be gridded.
See Points, Pixels, Grids, and Cells for a description of the gpd and mpp file formats used by the mapx library in defining a grid and its associated map projection. In the previous two tutorials, we modified existing gpd files and used an existing mpp file (namely N200correct.mpp) that specified EASE-Grid projections. Here we are going to create gpd and mpp files from scratch. We'll start with creating the mpp file, which we'll call Colorado.mpp, in the ms2gt/grids directory (or, if you don't want to type it in, copy Colorado.mpp from the ms2gt/tutorial_3 directory to the ms2gt/grids directory):
Azimuthal Equal-Area
40.0 -105.0 lat0 lon0
0.0
rotation
100.0
scale (km/map unit)
40.0 -105.0 center lat lon
20.0 60.0 lat min max
-135.0 -75.00 lon min max
10.00 15.00 grid
0.00 0.00 label lat lon
1 0 0
cil bdy riv
6370.997 Earth equatorial
radius (km) -- gctp
In preparing the gpd file which will define our grid, we will need to know following:
We now have all the information we need to create the gpd file which we'll call Colorado500.gpd in the ms2gt/grids directory (or, if you don't want to type it in, copy Colorado500.gpd from the ms2gt/tutorial_3 directory to the ms2gt/grids directory):
Colorado.mpp map projection parameters
# azimuthal equal area
1700 1776 columns rows
#
200
grid cells per map unit
# 500 meters
849.5 887.5 origin column, row
# center at 40N 150W
Once Colorado500.gpd has been created in the ms2gt/grids directory, we can use gtest to check that the latitude and longitude values of the upper left and lower right corners are close to what we want and that the center is exactly what we want:
gtest
enter .gpd file name: Colorado500.gpd
> assuming old style fixed format file
gpd: Colorado500.gpd
mpp:Colorado.mpp
forward_grid:
enter lat lon:
inverse_grid:
enter r s: 0 0
lat,lon = 43.875530 -110.300537 status = 1
col,row = -0.000061 0.000366 status = 1
enter r s: 1699 1775
lat,lon = 35.909435 -100.283951 status = 1
col,row = 1699.000000 1774.999634 status = 1
enter r s: 849.5 887.5
lat,lon = 40.000000 -105.000000 status = 1
col,row = 849.500000 887.500000 status = 1
enter r s:
enter .gpd file name:
So we see that the upper left corner values of 43.875530 -110.300537 are close to our target values of 44 N and 110 W and that the lower right corner values of 35.909435 -100.283951 are close to our target values of 36 N and 100 W. The center values are exactly equal to our target value of 40 N 105 W.
Create a text file in the tutorial_3 directory called latlonlist.txt containing the following two lines:
MOD03.A2000269.1745.002.2000282120258.hdf
MOD03.A2000269.1750.002.2000282120547.hdf
Note that we list the MOD03 files from which we wish to extract the 1 km latitude and longitude data to be used in place of the latlon data in the corresponding MOD10_L2 files in listfile.
Run the shell script containing the mod10_l2.pl command by changing to the tutorial_3 directory, and then typing:
colo_2000269_1745.csh
You'll see lots of messages displayed while the mod10_l2.pl script runs various IDL and C programs. In this example, the programs are:
The final message should contain the string:
MOD10_L2: MESSAGE: done
Enter the command:
ls -l *.img
You should see something like this:
-rw-r--r-- 1 haran nsidc
3019200 Apr 27 13:04 colo_2000269_1745_rawm_snow_01700_01776.img
-rw-r--r-- 1 haran nsidc
3019200 Apr 27 13:04 colo_2000269_1745_rawm_snqa_01700_01776.img
Each file contains a gridded array of 1700 columns and 1776 rows of binary byte values (1700 * 1776 * 1 = 3019200 bytes).
The file naming convention for gridded MOD10_L2 files is as follows:
<tag>_<conversion><weight_type>_<chan>_<columns>_<rows>.img
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