yatsm.mapping.changes module¶
Functions relevant for mapping abrupt changes
-
yatsm.mapping.changes.
get_change_date
(start, end, result_location, image_ds, first=False, out_format='%Y%j', magnitude=False, ndv=-9999, pattern='yatsm_r*', warn_on_empty=False)[source]¶ Output raster with changemap
Parameters: - start¶ – Ordinal date for start of map records
- end¶ – Ordinal date for end of map records
- result_location¶ – Location of results
- image_ds¶ – Example dataset
- first¶ – Use first change instead of last
- out_format¶ – Output date format
- magnitude¶ – output magnitude of each change?
- ndv¶ – NoDataValue
- pattern¶ – filename pattern of saved record results
- warn_on_empty¶ – Log warning if result contained no result records (default: False)
Returns: - A 2D np.ndarray array containing the changes between the
start and end date. Also includes, if specified, a 3D np.ndarray of the magnitude of each change plus the indices of these magnitudes
Return type:
-
yatsm.mapping.changes.
get_change_num
(start, end, result_location, image_ds, ndv=-9999, pattern='yatsm_r*', warn_on_empty=False)[source]¶ Output raster with changemap
Parameters: - start¶ – Ordinal date for start of map records
- end¶ – Ordinal date for end of map records
- result_location¶ – Location of results
- image_ds¶ – Example dataset
- ndv¶ – NoDataValue
- pattern¶ – filename pattern of saved record results
- warn_on_empty¶ – Log warning if result contained no result records (default: False)
Returns: - 2D numpy array containing the number of changes
between the start and end date; list containing band names
Return type: np.ndarray
-
yatsm.mapping.changes.
get_magnitude_indices
(results)[source]¶ Finds indices of result containing magnitude of change information
Parameters: results¶ – list of result files to check within Returns: - indices containing magnitude change information from the
- tested indices
Return type: np.ndarray Raises: KeyError
– Raise KeyError when a required result output is missing from the saved record structure