module documentation

Detects artefacts, returns a "badness map" that represents how much the algorithm thinks a particular pixel is an artefact.

Function exec_with_args Read arguments and run the module
Function generate_masks_from_thresholds Generator that returns multiple masks when passed an iterable of numbers that can be used as thresholds. The first mask will be everything <= the first threshold; the last mask will be everything > the last threshold; intermediate masks will be everything in between neighbouring threshold values.
Function get_ski_filter When given a scikit image filter, return a new function that will implement that filter on some data in a generic format, not just the one the scikit image filter wants.
Function go Thin wrapper around run() to accept string inputs. As long as the names of the arguments to this function are the same as the names expected from the command line we can do this programatically
Function parse_args Read command-line arguments when this module is called as a script.
Function run Perform the operation associated with this module.
Function to_dtype_range Rescale data so it fits into the range of the specified dtype, default is dtype=uint16.
Function to_unit_range Convert data to a unit range, will return the converted_data, offset, and range used in the conversion.
Function undo_range Undo the coversion from one range of data to another.
Function undo_unit_range Given some data (between 0,1), an offset (from zero) and a range (max-min). Will undo a conversion to unit range.
Variable artefact_detection_strategies Undocumented
Variable artefact_detection_strategy_choices Undocumented
Variable artefact_detection_strategy_choices_help_str Undocumented
Variable _lgr Undocumented
def exec_with_args(argv):

Read arguments and run the module

def generate_masks_from_thresholds(data, thresholds):

Generator that returns multiple masks when passed an iterable of numbers that can be used as thresholds. The first mask will be everything <= the first threshold; the last mask will be everything > the last threshold; intermediate masks will be everything in between neighbouring threshold values.

def get_ski_filter(ski_filter, undo_scaling=True, dtype=np.uint16):

When given a scikit image filter, return a new function that will implement that filter on some data in a generic format, not just the one the scikit image filter wants.

def go(fits_spec, output_path=None, strategy=None, **kwargs):

Thin wrapper around run() to accept string inputs. As long as the names of the arguments to this function are the same as the names expected from the command line we can do this programatically

def parse_args(argv):

Read command-line arguments when this module is called as a script.

def run(fits_spec, output_path, strategy: str, **kwargs: dict[str:Any]):

Perform the operation associated with this module.

def to_dtype_range(data, dtype=np.uint16):

Rescale data so it fits into the range of the specified dtype, default is dtype=uint16.

def to_unit_range(data):

Convert data to a unit range, will return the converted_data, offset, and range used in the conversion.

def undo_range(data, offset, range, final_range):

Undo the coversion from one range of data to another.

def undo_unit_range(data, offset, range):

Given some data (between 0,1), an offset (from zero) and a range (max-min). Will undo a conversion to unit range.

artefact_detection_strategies =

Undocumented

artefact_detection_strategy_choices =

Undocumented

artefact_detection_strategy_choices_help_str =

Undocumented

_lgr =

Undocumented