4.4. Corrected Reflectance Reader

The Corrected Reflectance Reader operates on corrected reflectance files created from VIIRS Science Data Record (SDR) files or MODIS Level 1B (L1B) files, in either IMAPP or NASA Archive naming conventions. Currently corrected reflectance files are created by third party software developed by NASA. The CREFL_SPA algorithm for MODIS and CVIIRS_SPA algorithm for VIIRS can be found here: http://directreadout.sci.gsfc.nasa.gov/?id=software .

Polar2Grid uses its own patched version of the CREFL processing code for VIIRS data. This code is available in the main code repository and fixes a few bugs that were not fixed in the original CREFL code at the time of writing.

Output CREFL software HDF4 product naming conventions are:

MODIS (250m, 500m and 1 km)

VIIRS (I and M Bands)

a1 or t1.YYDDD.HHMM.crefl.1000m.hdf

CREFLI_npp_dYYYYMMDD_tHHMMSSS_eHHMMSSS.hdf

a1 or t1.YYDDD.HHMM.crefl.500m.hdf

CREFLM_npp_dYYYYMMDD_tHHMMSSS_eHHMMSSS.hdf

a1 or t1.YYDDD.HHMM.crefl.250m.hdf

After processing the output can be provided to Polar2Grid to create true color images or other RGB images.

The CREFL reader can create True Color and False Color RGB composites when the corresponding --true-color and --false-color flags are specified. The default is to create a True Color image if no parameters are specified. However when used with the AWIPS scmi writer the default is to apply a ratio sharpening between low and high resolution bands to produce better quality single band images since AWIPS does not support 3-dimensional arrays. These defaults can all be turned off with the --no-compositors flag.

The CREFL reader accepts output from MODIS and VIIRS corrected reflectance processing. If provided with L1B or SDR files it will attempt to call the proper programs to convert the files. The required commands that must be available are:

  • h5SDS_transfer_rename

  • cviirs (for VIIRS corrected reflectance)

  • crefl (for MODIS corrected reflectance)

The CREFL software also requires ancillary data in the form of tbase.hdf and CMGDEM.hdf files for the MODIS and VIIRS processing respectively. These files are provided in the CSPP software bundle and are automatically detected by the software. Alternate locations can be specified with the P2G_CMODIS_ANCPATH and P2G_CVIIRS_ANCPATH environment variables.

This reader’s default resampling algorithm is ewa for Elliptical Weighted Averaging resampling. The --fornav-D option is set to 40 and the --fornav-d option is set to 2. Note that for working with MODIS data it may produce lower quality images with these settings so the --fornav-D option should be set to 10 on the command line:

--fornav-D 10

The following products are provided by this reader:

Product Name

Description

viirs_crefl01

Corrected Reflectance from VIIRS M05 Band

viirs_crefl02

Corrected Reflectance from VIIRS M07 Band

viirs_crefl03

Corrected Reflectance from VIIRS M03 Band

viirs_crefl04

Corrected Reflectance from VIIRS M04 Band

viirs_crefl05

Corrected Reflectance from VIIRS M08 Band

viirs_crefl06

Corrected Reflectance from VIIRS M10 Band

viirs_crefl07

Corrected Reflectance from VIIRS M11 Band

viirs_crefl08

Corrected Reflectance from VIIRS I01 Band

viirs_crefl09

Corrected Reflectance from VIIRS I02 Band

viirs_crefl10

Corrected Reflectance from VIIRS I03 Band

modis_crefl01_1000m

Corrected Reflectance from MODIS Band 1

modis_crefl02_1000m

Corrected Reflectance from MODIS Band 2

modis_crefl03_1000m

Corrected Reflectance from MODIS Band 3

modis_crefl04_1000m

Corrected Reflectance from MODIS Band 4

modis_crefl05_1000m

Corrected Reflectance from MODIS Band 5

modis_crefl06_1000m

Corrected Reflectance from MODIS Band 6

modis_crefl07_1000m

Corrected Reflectance from MODIS Band 7

modis_crefl01_500m

Corrected Reflectance from MODIS Band 1

modis_crefl02_500m

Corrected Reflectance from MODIS Band 2

modis_crefl03_500m

Corrected Reflectance from MODIS Band 3

modis_crefl04_500m

Corrected Reflectance from MODIS Band 4

modis_crefl05_500m

Corrected Reflectance from MODIS Band 5

modis_crefl06_500m

Corrected Reflectance from MODIS Band 6

modis_crefl07_500m

Corrected Reflectance from MODIS Band 7

modis_crefl01_250m

Corrected Reflectance from MODIS Band 1

modis_crefl02_250m

Corrected Reflectance from MODIS Band 2

modis_crefl03_250m

Corrected Reflectance from MODIS Band 3

modis_crefl04_250m

Corrected Reflectance from MODIS Band 4

4.4.1. Command Line Arguments

usage: polar2grid.sh crefl <writer> [-h] [--list-products] [--no-tc]
                                    [-p PRODUCTS [PRODUCTS ...]]
                                    [--true-color] [--false-color]
                                    [--no-compositors]

4.4.1.1. Frontend Initialization

swath extraction initialization options

--list-products

List available frontend products and exit

Default: False

--no-tc

Don’t use terrain-corrected navigation (VIIRS products only)

Default: True

4.4.1.2. Frontend Swath Extraction

swath extraction options

-p, --products

Specify frontend products to process

--true-color

Attempt to extract the products that could be used to create true color images

--false-color

Attempt to extract the products that could be used to create false color images

--no-compositors

Force no compositors to be used during glue script execution

Default: False

4.4.2. Example 1 - Create True Color GeoTIFFs and KML/KMZ

The Polar2Grid software can create reprojected true color and false color GeoTIFF output from input VIIRS corrected reflectance (CREFL) HDF4 input files and VIIRS Geolocation files (Terrain Corrected (GITCO* and GMTCO* or non-Terrain Corrected (GMODO* and GIMGO*)) as well as MODIS Level 1B (L1B) files, in either IMAPP or NASA Archive naming conventions.

Polar2Grid software creates and combines single band CREFL VIIRS Red (M-Band 5), Green (M- Band 4) and Blue (M-Band 3) wavelength data or CREFL MODIS Red (MODIS Band 1), Green (MODIS Band 4) and Blue (MODIS Band 3) wavelength data to create true color images. If the VIIRS I-Band 1 data is also present in a CREFL file, then it will be used to spatially sharpen the image to about 350m resolution. For MODIS, Polar2Grid uses the 1km CREFL file to create a true color image, but if the 250m L1B CREFL file is available then it will be used to spatially sharpen the image to about 250m. For the highest quality and resolution MODIS images, all three 1km, 500m and 250m input Level 1B files should be used.

The CREFL software performs a simple atmospheric Rayleigh scattering correction but with no adjustment for aerosol scattering (smoke and aerosols are still visible).

If no CREFL files are presented to the Polar2Grid CREFL reader, the files will automatically be created as part of the execution.

In this example, we start with the creation of a true color VIIRS GeoTIFF files. If you are interested in a KMZ formatted file, a GeoTIFF must be created first:

$POLAR2GRID_HOME/bin/polar2grid.sh crefl gtiff -f /path/to/my_sdrs/

This will create a series of corrected reflectance GeoTIFF files that are used to produce the final 24 bit true color GeoTIFF with the .tif file extension. To create a KMZ file (a compressed KML) to show in Google Earth or other program use the gtiff2kmz.sh script provided in the software bundle:

$POLAR2GRID_HOME/bin/gtiff2kmz.sh input_true_color.tif output_true_color.kmz

Where the input_true_color.tif file is one of the files created from the crefl2gtiff.sh command and output_true_color.kmz is the name of the KMZ file to create.

For more information see the documentation for the the GeoTIFF Writer and GeoTIFF to KMZ Conversion documentation.

4.4.3. Example 2 - Creating False Color GeoTIFFs and KML/KMZ

A false color image is any combination of 3 bands outside of those used to create a “true color” image. The Polar2Grid can also readily create a false color Red/Green/Blue 24 bit GeoTIFF using Red:VIIRS M-Band 11 (2.25 μm) or MODIS Band 7 (2.21 μm), Green:VIIRS M-Band 7 (.87 μm) or MODIS Band 2 (.86 μm) and Blue:VIIRS M-Band 5 (.67 μm) or MODIS Band 1 (.65 μm). If the I-Band 2 data is also present in a CREFL file, then it will be used to spatially sharpen the image. This band combination is very effective at distinguishing land/water boundaries as well as burn scars.

To create a Polar2Grid False Color GeoTIFF file, execute the following command:

$POLAR2GRID_HOME/bin/polar2grid.sh crefl gtiff --false-color -f /path/to/my_sdrs/

And just like the true color image, use the following to create a KMZ file:

$POLAR2GRID_HOME/bin/gtiff2kmz.sh input_false_color.tif output_false_color.kmz

Further examples of executing the Correct Reflectance Reader follow.

4.4.4. Execution Examples

crefl2gtiff.sh -f /data/modis/level1b

crefl2gtiff.sh --true-color --false-color -f ../l1b/a1.17006.1855.{250m,500m,1000m,geo}.hdf

crefl2gtiff.sh --true-color --false-color -f ../sdr/SV{I01,M03,M04,M05,M07,M11}_*.h5 ../sdr/GMTCO*.h5 ../sdr/GITCO*.h5

polar2grid.sh crelf gtiff -f /data/modis/MOD0{21KM,2HKM,2QKM,3}.*.hdf

crefl2gtiff.sh --false-color -f ../l1b/a1.17006.1855.{250m,500m,1000m,geo}.hdf

polar2grid.sh crefl gtiff -f /imapp/modis/a1.17006.1855.{250m,500m,1000m,geo}.hdf

crefl2gtiff.sh --true-color -f /data/modis/a1.17006.1855.crefl.250m.hdf /data/modis/a1.17006.1855.crefl.500m.hdf /data/modis/a1.17006.1855.geo.hdf

polar2grid.sh crefl gtiff --true-color --false-color -f ../crefl/t1.17004.1732.crefl.{250,500,1000}m.hdf ../l1b/MOD03.A2017004.1732.005.2017023210017.hdf

polar2grid.sh crefl gtiff --true-color -g wgs84_fit_250 --fornav-D 10 -f MYD021KM.A2017004.1732.006.2017023210017.hdf MYD02HKM.A2017004.1732.005.2017023210017.hdf MYD02QKM.A2017004.1732.005.2017023210017.hdf MYD03.A2017004.1732.005.2017023210017.hdf

polar2grid.sh crefl scmi --grid-coverage=0 -g lcc_conus_1km --sector-id LCC --letters --compress -f /home/data/t1*.hdf

polar2grid.sh crefl scmi --sector-id Pacific -g merc_pacific_1km --letters --compress -f /modis/data/MYD*.hdf

polar2grid.sh crefl scmi --true-color --false-color --sector-id LCC -g lcc_conus_300m --letters -f /viirs/SV*.h5 /viirs/GMTCO*.h5 /viirs/GITCO*.h5