Base correction (darsia.corrections.basecorrection)#

Module containing a base implementation of an abstract correction.

Classes

BaseCorrection()

Abstract base correction, providing template for tailored corrections.

class BaseCorrection[source]#

Bases: ABC

Abstract base correction, providing template for tailored corrections.

abstractmethod correct_array(image)[source]#

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

Parameters:

image (array) – image array.

Returns:

corrected image array.

Return type:

array

correct_metadata(metadata={})[source]#

Correction routine on metadata level.

Parameters:

metadata (dict) – metadata dictionary.

Returns:

corrected metadata dictionary.

Return type:

dict

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:

path (str) – 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:

path (str) – path to the file