7. Compositors

Compositors are optional components of Polar2Grid that can be used after remapping, but before a backend. A compositor can be used to combine multiple Polar2Grid bands to create a new product. Normally these types of operations would be done in a frontend to create a secondary product. However, sometimes calculations require combining products of different sizes and resolutions or creating a product with multiple levels like RGB images. These operations are much easier to handle after remapping, which is where compositors come in.

Compositors can be specified on the command line for the glue script or can be called from within python. Compositors can be used from the CSPP software bundle by specifying their names as the first arguments to a glue script, but the usual case of creating true color images is already the default for the crefl2gtiff.sh script.

Compositors can be used from the python command line access by either calling the glue script:

p2g_glue <frontend> <backend> [<compositor> ...] ...

What compositors are available can be customized with a configuration file specified with the --compositor-configs flag.

Note

Compositor’s require a specific set of products to complete their calculations. If any required information is missing then the compositor will fail.

Compositors that come with Polar2Grid are described below. Instructions for creating your own custom RGB composite are also below.

Note

Compositors and the way they are implemented will change in future releases after collaboration with the PyTroll team.

7.1. RGB Compositors

The following are common compositors that create RGB images.

7.1.1. True Color

The True Color Compositor is intended for corrected reflectance data from the CREFL (crefl) frontend. By default it is configured to work with the crefl products, but may be customized with a compositor configuration file. The True Color Compositor expects a red, green, and blue product that are pan sharpened using an additional high-resolution red product. This compositor works for VIIRS and MODIS corrected reflectance products and produces a new product called “true_color”.

7.1.2. False Color

The False Color Compositor is intended for corrected reflectance data from the CREFL (crefl) frontend. It operates similarly to the True Color Compositor described above, but with different bands to use by default. It expects a red, green, and blue product that are then pan sharpened using an additional high-resolution blue product. This compositor works for VIIRS and MODIS corrected reflectance products and produces a new product called “false_color”.

7.1.3. RGB

The RGB Compositor is a generic compositor for creating RGB products. It should be configured in a custom configuration file. The following steps will walk you through creating a custom RGB product and using it with the a software bundle glue script.

  1. Decide on products to use in the RGB. This example uses m05, m07, and m15 from the VIIRS frontend and will create a geotiff.

  2. Create a “my_composites.conf” file with the following contents:

    [compositor:my_rgb]
    composite_name=my_rgb_name
    composite_products=m05,m07,m15
    
  3. Run the following command:

    viirs2gtiff.sh my_rgb --compositor-configs my_composites.conf -f /path/to/files -p m05 m07 m15
    

Note

The “-p m05 m07 m15” is optional since those products are created by default, but since no other products are needed we request only these 3.

  1. The command above will create a file named “npp_viirs_my_rgb_name_20120225_180540_wgs84_fit.tif” by default. The default scaling is linear with dynamic limits per band. To create nicer looking images a custom rescaling configuration would be required.

author:David Hoese (davidh)
organization:Space Science and Engineering Center (SSEC)
copyright:Copyright (c) 2014 University of Wisconsin SSEC. All rights reserved.
date:Dec 2014
license:GNU GPLv3