5. Remapping

Remapping is the process of mapping satellite data swaths to a uniform grid. Mapping data to a uniform grid makes it easier to view, manipulate, and store the data. In Polar2Grid, this is usually done using a 2-step process.

5.1. Gridding

The first step is called 'll2cr' which stands for "longitude/latitude to column/row". This step maps the pixel location (lon/lat space) into grid space. 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.2. Resampling

The second step of remapping is to resample the input swath pixels to each output grid pixel. Polar2Grid provides an 'elliptical weight averaging' or 'EWA' resampling method as well as the traditional nearest neighbor method, with other algorithms planned for future releases. In the past both of these steps were handled by third-party software, but have been rewritten to be directly accessed from python.

Note

The nearest neighbor resampling method (nearest) is experimental and will be replaced by a more stable implementation in future releases.

5.3. Command Line Arguments

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]
Options:
--grid-configs=()
 Specify additional grid configuration files ('grids.conf' for built-ins)
-g, --grids Force remapping to only some grids, defaults to 'wgs84_fit', use 'all' for determination
--method

Remapping algorithm to use

Possible choices: ewa, nearest, sensor

--swath-usage=0
 Fraction of swath that must be used to continue remapping/processing (default 0)
--grid-coverage=0.1
 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=True
 Don't share invalid masks between nearest neighbor resampling (slow)
--no-share-grid=True
 Calculate dynamic grid attributes for every grid (instead of sharing highest resolution)