Cross Src Fusion
The cross source fusion method performs fusion of geotiff files from different datasets. The datasets have to have the same resolution. This should be done in preprocessing. This process helps create more temporally consistent and spatially complete datasets since gaps by clouds can be filled with data from other datasets from the same time range.
This function scans through one or more directories, groups raster files by spectral band and their temporal range (based on timestamps in the filename), and merges them according to the specified fusion strategy. The order of the datasets is the order in which the fusion takes place. The first non nodata value is choosen as output pixel for the fised raster. To prioritize a dataset, put it at the beginning of the list.
The follwoing fusion strategies are currently implemented:
CrossSourceFusionType.OVERLAPPING: Fuses raster files with overlapping time ranges from all sources together.CrossSourceFusionType.COVERING: Fuses raster files together if the time range of raster A covers the time range of raster B.
The fused outputs are saved in the specified output_dir, retaining band-specific structure and preserving original metadata (e.g., scale factors, offsets). The output name will follow this naming convention: <start date>_<end date>_<original name w/o timestamps>.tif
Utilizes a NVIDIA GPU if available.
Parameters¤
| Name | Type | Description |
|---|---|---|
datasets |
list |
Input directory path. Can contain subfolders. To prioritize a dataset, put it at the beginning of the list.. Either the file or the directory should contain a date string. The date string can be in any of these formats: yyyymmddThhmmss,yyydddhhmmss, yyyymmdd,yyyyddd |
output_dir |
str |
The output directory will hold the fused images. The output file will be named with the time range fused. |
fusion_type |
CrossSourceFusionType |
Fusion method for handling time ranges. |