yatsm.mapping.prediction module¶
Functions relevant for mapping statistical model predictions or fits
-
yatsm.mapping.prediction.
get_coefficients
(date, result_location, image_ds, bands, coefs, prefix='', amplitude=False, after=False, before=False, qa=False, ndv=-9999, pattern='yatsm_r*', warn_on_empty=False)[source]¶ Output a raster with coefficients from CCDC
Parameters: - date¶ – Ordinal date for prediction image
- result_location¶ – Location of the results
- bands¶ – Bands to predict
- coefs¶ – List of coefficients to output
- image_ds¶ – Example dataset
- prefix¶ – Use coef/rmse with refit prefix (default: ‘’)
- amplitude¶ – Map amplitude of seasonality instead of individual coefficient estimates for sin/cosine pair (default: False)
- after¶ – If date intersects a disturbed period, use next available time segment (default: False)
- before¶ – If date does not intersect a model, use previous non-disturbed time segment (default: False)
- qa¶ – Add QA flag specifying segment type (intersect, after, or before) (default: False)
- ndv¶ – NoDataValue (default: -9999)
- pattern¶ – filename pattern of saved record results
- warn_on_empty¶ – Log warning if result contained no result records (default: False)
Returns: - A tuple (np.ndarray, list) containing the 3D numpy.ndarray of
the coefficients (coefficient x band x pixel), and the band names for the output dataset
Return type:
-
yatsm.mapping.prediction.
get_prediction
(date, result_location, image_ds, bands='all', prefix='', after=False, before=False, qa=False, ndv=-9999, pattern='yatsm_r*', warn_on_empty=False)[source]¶ Output a raster with the predictions from model fit for a given date
Parameters: - date¶ – Ordinal date for prediction image
- result_location¶ – Location of the results
- image_ds¶ – Example dataset
- bands¶ – Bands to predict - ‘all’ for every band, or specify a list of bands
- prefix¶ – Use coef/rmse with refit prefix (default: ‘’)
- after¶ – If date intersects a disturbed period, use next available time segment
- before¶ – If date does not intersect a model, use previous non-disturbed time segment
- qa¶ – Add QA flag specifying segment type (intersect, after, or before)
- ndv¶ – NoDataValue
- pattern¶ – filename pattern of saved record results
- warn_on_empty¶ – Log warning if result contained no result records (default: False)
Returns: - A 3D numpy.ndarray containing the prediction for each band,
for each pixel
Return type: np.ndarray