thermal_sharpener

highres_inputs(workdir, temporal_hr_input_data, static_hr_input_data, filter_times=None)

Create VRT files with all highres inputs per datetime.

Parameters
  • workdir (str) – Folder in which to store the VRT files.

  • temporal_hr_input_data (list) – Paths to the input highres data.

  • static_hr_input_data (list) – Paths to static highres data.

Returns

Paths to VRT files.

Return type

list

lowres_inputs(workdir, temporal_lr_input_data)

Create VRT files with all lowres inputs per datetime.

Parameters
  • workdir (str) – Folder in which to store the VRT files.

  • temporal_hr_input_data (list) – Paths to the input lowres data.

Returns

Paths to VRT files.

Return type

list

preprocess(ds)

Adds a time dimension to ds. Used internally by sharpen when calling xr.open_mfdataset to create a stacking dimension.

Parameters

ds (xr.Dataset) – Input dataset.

Returns

Dataset with added time dimension.

Return type

xr.Dataset

plot_sharpening(lr_fn, hr_fn, var, workdir)

Create a plot of a sharpened image.

Parameters
  • lr_fn (str) – Path to lowres file.

  • hr_fn (str) – Path to highres file.

  • var (str) – Name of var.

  • workdir (str) – Path to folder in which to save graphs.

sharpen(dss, var, folder, *args, make_plots=False, req_vars=['nmdi', 'bsi', 'mndwi', 'vari_red_edge', 'psri', 'nir', 'green'])

Thermal sharpen datasets.

Parameters
  • dss (dict) – Keys are variable names, values are xr.Datasets which contain the lowres and highres input data.

  • var (str) – Variable name of the lowres input data (usually lst).

  • folder (str) – Path to folder in which to store (intermediate) files.

  • make_plots (bool, optional) – Whether or not to create plots, by default False.

  • vars_for_sharpening (list, optional) – Variables to use as sharpening features, by default [‘nmdi’, ‘bsi’, ‘mndwi’, ‘cos_solar_zangle’, ‘vari_red_edge’, ‘psri’, ‘nir’, ‘green’, ‘z’, ‘aspect’, ‘slope’].

Returns

Keys are variable names, values are (sharpened) datasets.

Return type

dict

get_cos_solar_zangle(dss, var, folder)

Calculate the cosine solar zenith angle.

Parameters
  • dss (dict) – Keys are variables, values are datasets.

  • var (str) – Variable from which the time is used to calculate cos_solar_zangle at.

  • folder (str) – Path to folder to store files.

Returns

Keys are variables, values are datasets.

Return type

dict