05-prep-qa-chip-dataset.py

This script is used to prepare image chips that can be used by the data scientist to perform QA/QC and remove poor-quality observations from the training data in later steps. Assumes and requires that --write-chips was supplied as a flag when running bin/03-image-join.py.

usage: 05-prep-qa-chip-dataset.py [-h] [--day-tolerance DAY_TOLERANCE]
                                  [--cloud-thr CLOUD_THR]
                                  [--buffer-distance BUFFER_DISTANCE]
                                  [--mask-method1 {lulc,scl}]
                                  [--mask-method2 {mndwi,ndvi,""}]
                                  [--rgb-min RGB_MIN] [--rgb-max RGB_MAX]
                                  [--gamma GAMMA]

Named Arguments

--day-tolerance

Days of search around sample date for a matching Sentinel 2 image.

Default: 8

--cloud-thr

Percent of cloud cover acceptable in the Sentinel tile corresponding to the sample. If this threshold is surpassed, no Sentinel image chip will be collected for the sample.

Default: 80

--buffer-distance

Square search radius (in meters) to use for reflectance data aggregation. This determines the size of the image chip that will be extracted and processed.

Default: 500

--mask-method1

Possible choices: lulc, scl

Which data to use for masking (removing) non-water in order to calculate aggreated reflectance values for only water pixels? Choose (“scl”) to water pixels as identified based on the Scene Classification Layer that accompanies the Snetinel tile, or (“lulc”) to use Impact Observatory’s Land-Use/Land-Cover layer to identify water, and the Scene Classification Layer to remove clouds. Using “lulc” is strongly recommended.

Default: “lulc”

--mask-method2

Possible choices: mndwi, ndvi, “”

Which additional normalized index to use, if any, to update the mask to remove errors of ommission (pixels classified as water that shouldn’t be) prior to calculated aggregated reflectance? If “ndvi”, then only pixels with an NDVI value less than 0.25 will be retained. If “mndwi” (recommended) then only pixels with an MNDWI value greater than 0 will be retained. Of “”, then no secondary mask is used.

Default: “mndwi”

--rgb-min

Minimum reflectance value (corresponding to zero saturation of R, G, and B). Used for fine-tuning the visual representation of the chip both for app display and QA/QC chip creation.

Default: 100

--rgb-max

Maximum reflectance value (corresponding to full saturation of R, G, and B). Used for fine-tuning the visual representation of the chip both for app display and QA/QC chip creation.

Default: 4000

--gamma

Gamma correction to use when generating visual image chips. Used for fine-tuning the visual representation of the chip both for app display and QA/QC chip creation.

Default: 0.7