darsia.BaseCorrection#

class BaseCorrection[source]#

Bases: ABC

Abstract base correction, providing template for tailored corrections.

Methods

correct_array(image)

Correction routine on array level, to be specified for tailored correction.

correct_metadata([metadata])

Correction routine on metadata level.

load(path)

Load the correction from a file.

save(path)

Save the correction to a file.

abstractmethod correct_array(image)[source]#

Correction routine on array level, to be specified for tailored correction.

Parameters:
imagearray

Image array.

Returns:
array

Corrected image array.

correct_metadata(metadata={})[source]#

Correction routine on metadata level.

Parameters:
metadatadict

Metadata dictionary.

Returns:
dict

Corrected metadata dictionary.

abstractmethod load(path)[source]#

Load the correction from a file.

The method should load a npz file, containing the class name and required data for loading the correction from file.

Parameters:
pathstr

Path to the file.

abstractmethod save(path)[source]#

Save the correction to a file.

The method should store a npz file, continaing the class name and required data for loading the correction from file.

Parameters:
pathstr

Path to the file.