Extractor Function

Functions

xr_fresh.extractors_series.extract_features_series(gw_series, feature_dict, band_name, output_dir, num_workers=-1, nodata=nan)[source]

Extracts features from a geospatial time series and saves them as TIFF files.

Parameters:
  • gw_series (geowombat.Dataset) – Geospatial time series dataset.

  • feature_dict (dict) – Dictionary containing feature names and parameters.

  • band_name (str) – Name of the band.

  • output_dir (str) – Directory to save the output TIFF files.

Returns:

None

Example

# Define the feature dictionary
feature_dict = {
"abs_energy": [{}],
"autocorr": [{"lag": 1}, {"lag": 2}, {"lag": 3}],
"ratio_beyond_r_sigma": [{"r": 1}, {"r": 2}],
"skewness": [{}],
}

# Define the band name and output directory
band_name = "B2"

# Create the output directory if it doesn't exist
output_directory = "../features"

# Extract features from the geospatial time series
extract_features_series(gw_series, feature_dict, band_name, output_directory)
xr_fresh.extractors_series.extract_grid(band_name)[source]

Extracts grid value from the band_name using regular expressions.

Parameters:

band_name (str) – Name of the band.

Returns:

Extracted grid value.

Return type:

grid (str)

xr_fresh.extractors_series.extract_key_value_names(band_name)[source]

Extracts key_names and value_names from the band_name using regular expressions.

Parameters:

band_name (str) – Name of the band.

Returns:

Extracted key names. value_names (str): Extracted value names.

Return type:

key_names (str)