03-image-join.py
This script queries the STAC API (the catalog of all remote sensing URLs that exist on Azure) for field based observations of suspended sediment concentration, and returns a list of image URLs and aggregated features that match the observations with respect to space and time. This script prepares inputs and writes them to Azure Blob Storage for use in bin/04-data-merge.py Optionally, images can be written to cloud storage for use in subsequent QA/QC and modeling steps.
usage: 03-image-join.py [-h] [--data-src {itv,ana,usgs,usgsi}]
[--day-tolerance DAY_TOLERANCE]
[--cloud-thr CLOUD_THR]
[--buffer-distance BUFFER_DISTANCE] [--write-to-csv]
[--write-chips] [--mask-method1 {lulc,scl}]
[--mask-method2 {mndwi,ndvi,""}]
Named Arguments
- --data-src
Possible choices: itv, ana, usgs, usgsi
For which data source should this script run?
- --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
- --write-to-csv
Write out CSVs to data/ on the local machine?
Default: False
- --write-chips
Write image chips to blob storage? Should be set to true unless troubleshooting.
Default: False
- --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”