eumap.gapfiller.time_first_space_later¶
- time_first_space_later(fn_files=None, data=None, time_strategy=<class 'eumap.gapfiller.TMWM'>, time_args={}, space_strategy=<class 'eumap.gapfiller.InPainting'>, space_args={}, space_flag_val=100)[source]¶
Helper function to gapfill all the missing pixels using first a temporal strategy (
TMWM
,TLI
,SSA
) and later a spatial strategy (InPainting
).- Parameters
fn_files (
Optional
[List
]) – Raster file paths to be read and gapfilled.data (
Optional
[array
]) – 3D array where the last dimension is the time.time_strategy (
ImageGapfill
) – One of the implemented temporal gapfilling approaches.time_args (
set
) – Aset
of parameters for the temporal gapfilling strategyspace_strategy (
ImageGapfill
) – One of the implemented spatial gapfilling approaches.space_args (
set
) – Aset
of parameters for the spatial gapfilling strategy.space_flag_val – The flag value used to indicate which pixels were gapfilled by the spatial gapfilling strategy.
Examples
>>> from eumap import gapfiller >>> >>> # For a 4-season time series >>> tfsl = gapfiller.time_first_space_later( >>> fn_files = fn_rasters, >>> time_strategy = gapfiller.TMWM, >>> time_args = { 'season_size': 4 }, >>> space_strategy = gapfiller.InPainting, >>> space_args = { 'space_win': 10 } >>> ) >>> >>> fn_rasters_tfsl = tfsl.save_rasters('./gapfilled_tmwm_inpaint', dtype='uint8', fn_files=fn_rasters)