New Cloud Map
Posted: 08.10.2008, 15:35
I decided to start a thread documenting the progress and problems I'm having with producing a new cloudmap with MODIS images. This will probably never be a project for the faint of heart. There is a lot of files to download. I haven't downloaded all the files I need yet and I even download some I didn't need. So far I'm pretty sure that the files needed are the 500m MOD02HKM(Terra) and MYD02HKM(Aqua) along with the MOD35_L2 and MOD06_L2 cloud products. The following images show some of the problems I'm having with producing a mosaic with HDFLook. You should be able to notice the tone difference between some of the shots, probably due to the different times of day the images were acquired. Some of low clouds also have a blocky look to them. And there is some noise from missing data in some of the areas being introduced by the cloud masks. This first version is in no way complete. I ran this to get an idea of what else needs to be done.
I'm pretty sure that I'm going to have to import raw unprojected images into ISIS to clean up some noise and tone match the images before projecting them. At that point I'm not sure what to do next. I think I'm going to have to figure out how to export them back to the hdf format and use HDFLOOK to do the mosaics.
Anyhow, just using HDFLOOK, I produced a 500m mosaic with the MOD02HKM files and a 1km cloud mask mosaic using the MOD35_L2 files.
Commands to produce the cloud mask:
HDFLOOK uses these command files (.com) to do the runs.
band1-mosaic-1strun-linear-topleft.comband1-mosaic-run-topleft-linear.com
Commands to produce the 500m mosaic:
Command files:
mosaic-1strun-linear.com
mosaic-run-all-linear.com
Here are some of the problem images. I'll post 3 images of the shots I'm somewhat pleased with in the following post.
After the cloud mask mosaic was produced, I had to change the file from 8 bit signed to 8 bit unsigned. I wrote a little program to do that. The reason being was that ISIS3 currently does not import 8 bit signed data. After the conversion, I imported the 2 files into ISIS3. I then ran fx on the 2 images. Here is the output from running the fx program:
127 was the value in the cloud mask for non cloudy land. I think. Anyhow, the fx equation used the pixel value from the 500meter mosaic if the cloud mask didn't have a value of 127. This was -1 in the original signed 8 bit file. Subtracting 128 at the end may be unnecessary.
After that I cropped the output 21600x21600 to produce files that are easier to work with and exported them to png format with isis2std.
cartrite
I'm pretty sure that I'm going to have to import raw unprojected images into ISIS to clean up some noise and tone match the images before projecting them. At that point I'm not sure what to do next. I think I'm going to have to figure out how to export them back to the hdf format and use HDFLOOK to do the mosaics.
Anyhow, just using HDFLOOK, I produced a 500m mosaic with the MOD02HKM files and a 1km cloud mask mosaic using the MOD35_L2 files.
Commands to produce the cloud mask:
Code: Select all
HDFLook band1-mosaic-1strun-linear-topleft.com
HDFLook band1-mosaic-run-topleft-linear.com
HDFLOOK uses these command files (.com) to do the runs.
band1-mosaic-1strun-linear-topleft.com
Code: Select all
verbose
clear_data
set_output_directory ../OUTPUTS/
set_input_directory ../IMAGES
set_projection_to_geometry ProjectionTo="LINEAR" WidthTo=43200 HeightTo=21600\
LatitudeMinTo=-90 LatitudeMaxTo=90.0 \
LongitudeMinTo=-180.0 LongitudeMaxTo=180.0 \
CenterLatitudeTo=0 CenterLongitudeTo=0
set_input_hdf_file MOD35_L2.A2008243.1600.005.2008244015648.hdf
select_SDS SDSname="Cloud_Mask"
create_MODIS_SDS_Mosaic FileName="band1-earth-clouds-mask.raw" Index=6 ClearFile=Yes
Code: Select all
verbose
clear_data
set_output_directory ../OUTPUTS/
set_input_directory ../IMAGES
set_projection_to_geometry ProjectionTo="LINEAR" WidthTo=43200 HeightTo=21600\
LatitudeMinTo=-90 LatitudeMaxTo=90.0 \
LongitudeMinTo=-180.0 LongitudeMaxTo=180.0 \
CenterLatitudeTo=0 CenterLongitudeTo=0
set_input_hdf_file ../IMAGES/MOD35_L2*
select_SDS SDSname="Cloud_Mask"
create_MODIS_SDS_Mosaic FileName="band1-earth-clouds-mask.raw" Index=6 ClearFile=NO
Commands to produce the 500m mosaic:
Code: Select all
HDFLook mosaic-1strun-linear.com
HDFLook mosaic-run-all-linear.com
Command files:
mosaic-1strun-linear.com
Code: Select all
verbose
clear_data
set_output_directory ../OUTPUTS/
set_input_directory ../IMAGES
set_projection_to_geometry ProjectionTo="LINEAR" WidthTo=86400 HeightTo=43200\
LatitudeMinTo=-90 LatitudeMaxTo=90.0 \
LongitudeMinTo=-180.0 LongitudeMaxTo=180.0 \
CenterLatitudeTo=0 CenterLongitudeTo=0
set_input_hdf_file MOD02HKM.A2008243.1600.005.2008244014050.hdf
select_SDS SDSname="EV_500_RefSB"
create_MODIS_SDS_Mosaic FileName="earth-clouds" Index=1 ClearFile=Yes
mosaic-run-all-linear.com
Code: Select all
verbose
clear_data
set_output_directory ../OUTPUTS/
set_input_directory ../IMAGES
set_projection_to_geometry ProjectionTo="LINEAR" WidthTo=86400 HeightTo=43200\
LatitudeMinTo=-90 LatitudeMaxTo=90.0 \
LongitudeMinTo=-180.0 LongitudeMaxTo=180.0 \
CenterLatitudeTo=0 CenterLongitudeTo=0
set_input_hdf_file ../IMAGES/MOD02HKM*
select_SDS SDSname="EV_500_RefSB"
create_MODIS_SDS_Mosaic FileName="earth-clouds" Index=1 ClearFile=NO
Here are some of the problem images. I'll post 3 images of the shots I'm somewhat pleased with in the following post.
After the cloud mask mosaic was produced, I had to change the file from 8 bit signed to 8 bit unsigned. I wrote a little program to do that. The reason being was that ISIS3 currently does not import 8 bit signed data. After the conversion, I imported the 2 files into ISIS3. I then ran fx on the 2 images. Here is the output from running the fx program:
Code: Select all
Object = fx
IsisVersion = "3.1.17 | 2008-09-10"
ProgramVersion = 2008-04-16
ProgramPath = /srv/disk5/isis3/isis/bin
ExecutionDateTime = 2008-10-08T01:58:47
HostName = linux-o863
UserName = cartrite
Description = "Generalized arithmetic operations using multiple cube
files"
Group = UserParameters
F1 = band1-earth-clouds.cub
F2 = cloudmask.cub
TO = earth-clouds2.cub
EQUATION = "(f1 * (f2!=127))-128"
MODE = CUBES
End_Group
127 was the value in the cloud mask for non cloudy land. I think. Anyhow, the fx equation used the pixel value from the 500meter mosaic if the cloud mask didn't have a value of 127. This was -1 in the original signed 8 bit file. Subtracting 128 at the end may be unnecessary.
After that I cropped the output 21600x21600 to produce files that are easier to work with and exported them to png format with isis2std.
cartrite