5. Remapping

Remapping is the process of mapping satellite data to a uniform grid. Mapping data to a uniform grid makes it easier to view, manipulate, and store the data. Some instrument data is provided to the user already gridded (ex. VIIRS EDR Flood) and others are not (ex. VIIRS SDR). In Polar2Grid it is possible to perform the gridding (reprojecting) process for ungridded data or to re-project already gridded data. Mapping input data in order to create a high quality image can be a complicated process. There are different techniques that can be used to create an output image based on what grid (projection) is chosen and what algorithm is used to map input pixel to output pixel. Polar2Grid provides default options for each reader, but users can customize these options. The various options are described below.

5.1. Elliptical Weighted Averaging Resampling

Elliptical Weighted Averaging (EWA) resampling is the default resampling method for a lot of scan-based polar-orbiting instrument data. This method uses the size of each instrument scan to determine a weight for each pixel. All input pixels that map to output pixels are weighted and averaged. This helps produce an image that is typically higher quality than those produced by nearest neighbor.

5.2. Nearest Neighbor Resampling

Nearest neighbor resampling is the most basic form of resampling when gridding data to another grid. This type of resampling will find the nearest valid input pixel for each pixel in the output image. If a valid pixel can’t be found near a location then an invalid (transparent) pixel is put in its place. Controlling this search distance and other options are described below in the Command Line Arguments section. Nearest neighbor resampling can be specified on the command line with --method nearest. It is the default resampling method when EWA resampling can not be used.

5.3. Grids

Polar2Grid uses the idea of “grids” to define the output geographic location that images will be remapped to. Grids are also known as “areas” in the SatPy library. These terms may be used interchangeably through this documentation, especially in low-level parts.

Polar2Grid uses grids defined by a PROJ.4 projection specification. Other parameters that define a grid like its width and height can be determined dynamically during this step. A grid is defined by the following parameters:

  • Grid Name

  • PROJ.4 String (either lat/lon or metered projection space)

  • Width (number of pixels in the X direction)

  • Height (number of pixels in the Y direction)

  • Cell Width (pixel size in the X direction in grid units)

  • Cell Height (pixel size in the Y direction in grid units)

  • X Origin (upper-left X coordinate in grid units)

  • Y Origin (upper-left Y coordinate in grid units)

Polar2Grid supports static and dynamic grids. Grids are static if they have all of the above attributes defined. Grids are dynamic if some of the attributes are not defined. These attributes are then computed at run time based on the data being remapped. Only width/height and x/y origin can be unspecified in dynamic grids.

For information on defining your own custom grids see the Custom Grid documentation.

5.4. Command Line Argument

usage: polar2grid.sh <reader> <writer> [-h]
                                       [--grid-configs GRID_CONFIGS [GRID_CONFIGS ...]]
                                       [-g FORCED_GRIDS [FORCED_GRIDS ...]]
                                       [--method {ewa,nearest,sensor}]
                                       [--swath-usage SWATH_USAGE]
                                       [--grid-coverage GRID_COVERAGE]
                                       [--fornav-D FORNAV_D]
                                       [--fornav-d FORNAV_D]
                                       [--maximum-weight-mode]
                                       [--distance-upper-bound DISTANCE_UPPER_BOUND]
                                       [--no-share-mask] [--no-share-grid]

5.4.1. Remapping Initialization

--grid-configs

Specify additional grid configuration files (‘grids.conf’ for built-ins)

Default: ()

5.4.2. Remapping

-g, --grids

Force remapping to only some grids, defaults to ‘wgs84_fit’, use ‘all’ for determination

--method

Possible choices: ewa, nearest, sensor

Remapping algorithm to use

--swath-usage

Fraction of swath that must be used to continue remapping/processing

Default: 0

--grid-coverage

Fraction of grid that must be covered with valid data to continue processing (default 0.1)

--fornav-D

Specify the -D option for fornav

--fornav-d

Specify the -d option for fornav

--maximum-weight-mode

Use maximum weight mode in fornav (-m)

--distance-upper-bound

Nearest neighbor search distance upper bound in units of grid cell

--no-share-mask

Don’t share invalid masks between nearest neighbor resampling (slow)

--no-share-grid

Calculate dynamic grid attributes for every grid (instead of sharing highest resolution)