Tools reference

Band Math

Apply arbitrary band math to produce derived raster products.

Band math expression can use normal arithmetic operations, as well as simple math operators supported in Python's numpy package. The numpypackage itself is available as "np" for specific methods needed from that package.

The bands of the input file are referenced as b1, b2, b3, b4, ... and it is only possible to create one output against a single product bundle. There is no support at this time for producing an output from multiple product bundles.

There is currently no mechanism to do non-local operations. For instance a 3x3 kernel may not currently be implemented because there is no way to reference neighbouring pixels to produce an output pixel.

Inputs

A single product bundle. This tool is applied at the bundle level, not the individual image level.

Outputs

One output file for each input file with the derived bands described in the band math parameters. The pixel type (byte, float, 16bit integer) of the outputs will be determined by the pixel_type parameter or default to the input type otherwise.

Parameters

b1 (string)

A math expression defining how output band 1 should be computed.

b2 (string)

A math expression defining how output band 2 should be computed. (optional)

b3 (string)

A math expression defining how output band 3 should be computed. (optional)

b4 (string)

A math expression defining how output band 4 should be computed. (optional)

b5 (string)

A math expression defining how output band 5 should be computed. (optional)

expression (string)

A math expression defining how output band 1 should be computed. This is essentially an alias for parameter b1.

pixel_type (string)

A value indicating what the output pixel type should be. One of "8U" (8bit unsigned), "16U" (16bit unsigned), "16S" (16bit signed), "32R" (32bit floating point) or "Auto" (determined based on source).

Example: NDVI

{
  "bandmath": {
    "pixel_type": "32R",
    "b1": "(b4 - b3) / (b4+b3)"
  }
}

Clip

Clip a raster to an Area of Interest: the AOI can be specified by a polygon or multipolygon feature, with up to 500 vertices. Note that clipping AOIs with greater than 500 vertices is not supported.

A special property of this clip operations is that if product bundles including support _metadata.xml files are passed through it, it will attempt to correct statistics and other information in the _metadata.xml to match the new clipped file.

Bundles that contain "basic_" assets are not currently supported with the Clip tool.

Inputs

Any GeoTIFFs. There is no need for the inputs to be of consistent band types, or coordinate system. Each is independently clipped.

Outputs

A clipped GeoTIFF for each input file that fills within the clip region (those completely outside will be discarded).

Parameters

aoi (dict)

This should be a GeoJSON geometry of type Polygon or MultiPolygon defining the clip region.

Example

{  
   "clip":{  
      "aoi":{  
         "type":"Polygon",
         "coordinates":[  
            [  
               [  
                  -163.828125,
                  -44.59046718130883
               ],
               [  
                  181.7578125,
                  -44.59046718130883
               ],
               [  
                  181.7578125,
                  78.42019327591201
               ],
               [  
                  -163.828125,
                  78.42019327591201
               ],
               [  
                  -163.828125,
                  -44.59046718130883
               ]
            ]
         ]
      }
   }
}

Compositing

Composite a set of raster files into one output.

Note: SkySat Collect is currently not supported with Composite.

The output will be produced at the resolution of the first input file.

Inputs

Any GeoTIFFs. All input files should be in the same coordinate system and band configuration. It is not required that they are all the same resolution.

If there are UDM files included in the inputs they will be composited separately from all the non-UDM files.

Outputs

One composited image, and possibly one composited UDM image file.

Parameters

(there are no parameters to this operation)

{  
   "composite":{  
   }
}

Reproject

Reproject, resample and rescale raster products to a new projected coordinate system, and resolution.

Inputs

Any GeoTIFFs. There is no need for the inputs to be of consistent band types, or coordinate system. Each is independently reprojected to the target configuration.

Outputs

A map projected GeoTIFF in the new projection.

Parameters

projection (string)

A coordinate system in the form EPSG:n, for instance EPSG:4326 for WGS84, EPSG:32611 for UTM 11 North (WGS84), or EPSG:3857 for Web Mercator. Some other "GDAL" support coordinate descriptions may also work.

resolution (float)

The width and height of a pixel in the output file in the output projection (coordinate system). Normally this is in meters, but if the coordinate system is geographic, like EPSG:4326 then it will be a pixel size in decimal degrees. If it is not provided, a resolution will be selected to approximately match the resolution of the input.

kernel (string)

The resampling kernel used. One of "near", "bilinear", "cubic", "cubicspline", "lanczos", "average" and "mode". See the gdalwarp "resampling_method" docs for details. The default is "near" for nearest neighbour. This parameter is overridden to be "near" for any UDM files in the inputs.

{
  "reproject": {
    "projection": "EPSG:4326",
    "kernel": "cubic"
  }
}

Tile

Split an input file into a regular set of tiles based on a user described tiling system.

The tiling system is a mapping from the projected coordinate system coordinates to tiles reference by an x and y integer offset from the origin ({tilex} and {tiley} in the name_template). A common example is the web mercator tiling system where the origin is somewhere near the lower left corner of the world (in mercator), and tiles are numbers from that origin.

Note: if you do not particularly care about the tiling coordinate system, and just need things broken into regular chunks, you don't need to worry much about origin_x, origin_y, pixel_size or name_template. Just set tile_size to indicate the size in pixels of the chunks produced.

Inputs

One map projected GeoTIFF file.

Outputs

A set of map projected GeoTIFF files representing abutting tiles.

Parameters

origin_x (float) Tiling system x origin in projected coordinates (default is zero)

origin_y (float) Tiling system x origin in projected coordinates (default is zero)

pixel_size (float)

Tiling system pixel size in projected coordinates (defaults to pixel_size of input raster).

tile_size (integer)

Height and width of output tiles in pixels and lines (always square) (required)

name_template (string)

A naming template for creating output tile filenames. The default is "{tilex}_{tiley}.tif" resulting in filenames like 128_200.tif. The {tilex} and {tiley} parameters can be of the form {tilex:06d} to produce a fixed width field with leading zeros.

conformal_x_scaling (boolean)

If the coordinate system is conformal (such as WGS84) it may be desirable to scale output tiles in the X direction in order to minimize the distortion of shape as the poles are approached. Enabling this will reduce in the width of tiles being less than tile_size as one gets further away from the equator.

Example: Web Mercator Zoom 15

{  
   "tile":{  
      "origin_x":-20037508.340,
      "origin_y":-20037508.340,
      "pixel_size":3,
      "tile_size":256,
      "name_template":"{tilex:07d}_{tiley:07d}.tif"
   }
}

Top of Atmosphere Reflectance (TOAR)

You can apply the Top Of Atmosphere Reflectance tool to convert PlanetScope or RapidEye radiance products to Top Of Atmosphere Reflectance (TOAR). Analytic bundles are required to run this tool and XML asset will be consumed during the process. The expected output contains metadata XML as well.

Inputs

analytic assets (including the support XML files)

Outputs

16bit GeoTIFFs with the same set of bands holding scaled reflectance values.

Parameters

scale_factor (integer)

Scale factor applied to convert 0.0 to 1.0 reflectance floating point values to a value that fits in 16bit integer pixels. The Default is 10000. Values over 65535 could result in high reflectances not fitting in 16bit integers.

{
  "name": "TOAR example",
  "products": [
    {
      "item_ids": [
        "20170614_113217_3163208_RapidEye-5"
      ],
      "item_type": "REOrthoTile",
      "product_bundle": "analytic"
    }
  ],
  "tools": [
    {
      "toar": {
        "scale_factor": 10000
      }
    }
  ]
}

Harmonization

This tool enables radiometric harmonization of imagery captured by one satellite instrument type to imagery captured by another satellite instrument type. At this time, harmonization of Dove-R (instrument_id PS2.SD) to Dove Classic (insturment_id PS2) radiometry is supported.

Inputs

Analytic product bundles of PSScene3Band, PSScene4Band, and PSOrthotiles item types. Analytic Surface Reflectance product bundles will not be harmonized.

Harmonization is applied very early in an Order and will occur before other tools that modify pixel values such as TOAR or Band Math.

Outputs

One transformed/harmonized version of each input file. The transformation of each item will depend on the instrument used to capture the item and its relation to the target sensor. See Parameters below for more details.

Parameters

Target_sensor (string)

A value indicating what sensor the product bundles should be calibrated to. Each sensor value will transform items captured by a defined set of instrument ids. Items which have not been captured by that defined set of instrument ids will be unaffected by (pass through) the harmonization operation.

Example:

{
  "name": "Harmonization",
  "products": [
    {
      "item_ids": [
        "20190617_235702_20_1066",
        "20171217_143033_0e3a"
      ],
      "item_type": "PSScene4Band",
      "product_bundle": "analytic"
    }
  ],
  "tools": [
    {
      "harmonize": {
        "target_sensor": "PS2"
      }
    }
  ]
}