class documentation

class CleanModified(Base):

View In Hierarchy

A modified verison of the CLEAN algorithm, designed to account for extended emission.

# ARGUMENTS #
n_iter : int = 1000
Number of iterations to perform
loop_gain : float = 0.02
Fraction of emission that could be accounted for by a PSF added to components with each iteration. Higher values are faster but unstable
threshold : float = 0.3
Fraction of maximum brightness of residual above which pixels will be included in CLEAN step, if negative will use the "maximum fractional difference otsu threshold". 0.3 is a good default value, if stippling becomes an issue, reduce or set to a negative value. Lower positive numbers will require more iterations, but give a more "accurate" result.
n_positive_iter : int = 0
Number of iterations to do that only "adds" emission, before switching to "adding and subtracting" emission.
noise_std : float = 1E-1
Estimate of the deviation of the noise present in the observation
rms_frac_threshold : float = 1E-3
Fraction of original RMS of residual at which iteration is stopped, lower values continue iteration for longer.
fabs_frac_threshold : float = 1E-3
Fraction of original Absolute Brightest Pixel of residual at which iteration is stopped, lower values continue iteration for longer.
max_stat_increase : float = np.inf
Maximum fractional increase of a statistic before terminating
min_frac_stat_delta : float = 1E-3
Minimum fractional standard deviation of statistics before assuming no progress is being made and terminating iteration.
give_best_result : bool = True
If True, will return the best (measured by statistics) result instead of final result.
# RETURNS #

A "CleanModified" instance. Run the model using the __call__(...) method. e.g. ``` from aopp_deconv_tool.algorithm.deconv.clean_modified import CleanModified

deconvolver = CleanModified() ... deconv_components, deconv_residual, deconv_iters = deconvolver(processed_obs, normed_psf)

``` See aopp_deconv_tool.deconvolve for a full example.

Method choose_residual_extrema Undocumented
Method get_components Undocumented
Method get_iters Undocumented
Method get_residual Undocumented
Class Variable clean_beam_sigma Undocumented
Class Variable fabs_frac_threshold Undocumented
Class Variable give_best_result Undocumented
Class Variable loop_gain Undocumented
Class Variable max_stat_increase Undocumented
Class Variable min_frac_stat_delta Undocumented
Class Variable n_iter Undocumented
Class Variable n_positive_iter Undocumented
Class Variable noise_std Undocumented
Class Variable rms_frac_threshold Undocumented
Class Variable threshold Undocumented
Instance Variable progress_string Undocumented
Method _init_algorithm Perform any initialisation that needs to be done before the algorithm runs.
Method _iter Perform a single iteration of the algorithm.
Method _stopping_criteria Undocumented
Instance Variable _accumulator Undocumented
Instance Variable _choose_update_pixels Undocumented
Instance Variable _components Undocumented
Instance Variable _components_best Undocumented
Instance Variable _current_cleaned Undocumented
Instance Variable _current_convolved Undocumented
Instance Variable _fabs_threshold Undocumented
Instance Variable _flux_correction_factor Undocumented
Instance Variable _get_pixel_threshold Undocumented
Instance Variable _i_best Undocumented
Instance Variable _iter_stat_names Undocumented
Instance Variable _iter_stat_record Undocumented
Instance Variable _loop_gain_correction_factor Undocumented
Instance Variable _obs Undocumented
Instance Variable _pixel_threshold label_map, n_labels = sp.ndimage.label(self._selected_map) # order labels by number of pixels they contain
Instance Variable _psf Undocumented
Instance Variable _px_choice_img_ptr Undocumented
Instance Variable _residual Undocumented
Instance Variable _residual_copy Undocumented
Instance Variable _rms_threshold Undocumented
Instance Variable _selected_map Undocumented
Instance Variable _selected_px Undocumented
Instance Variable _stats_best Undocumented
Instance Variable _stats_delta Undocumented
Instance Variable _tmp_r Undocumented

Inherited from Base:

Method __call__ Apply algorithm to obs and psf, parameters are set at instantiation, but can be overwritten for a single call by passing new values via **kwargs. Initialises and iterates the algorithm. Subclasses should overload the ...
Method get_parameters Undocumented
Method set_parameters Undocumented
Class Variable final_hooks Undocumented
Class Variable n_iter_stopped Undocumented
Class Variable post_init_hooks Undocumented
Class Variable post_iter_hooks Undocumented
Class Variable pre_init_hooks Undocumented
Class Variable pre_iter_hooks Undocumented
Method _set_last_parameters Undocumented
Instance Variable _i Undocumented
Instance Variable _last_parameters Undocumented
def choose_residual_extrema(self):

Undocumented

def get_components(self) -> np.ndarray:

Undocumented

def get_iters(self):

Undocumented

def get_residual(self) -> np.ndarray:

Undocumented

clean_beam_sigma: float =

Undocumented

fabs_frac_threshold: float =

Undocumented

give_best_result: bool =

Undocumented

loop_gain: float =

Undocumented

max_stat_increase: float =

Undocumented

min_frac_stat_delta: float =

Undocumented

n_positive_iter: int =

Undocumented

noise_std: float =

Undocumented

rms_frac_threshold: float =

Undocumented

threshold: float =

Undocumented

def _init_algorithm(self, obs, psf):

Perform any initialisation that needs to be done before the algorithm runs.

def _iter(self, obs, psf) -> bool:

Perform a single iteration of the algorithm.

def _stopping_criteria(self):

Undocumented

_accumulator: np.ndarray =

Undocumented

_choose_update_pixels: Any =

Undocumented

_components_best: np.ndarray =

Undocumented

_current_cleaned: np.ndarray =

Undocumented

_current_convolved: np.ndarray =

Undocumented

_fabs_threshold: float =

Undocumented

_flux_correction_factor: Any =

Undocumented

_get_pixel_threshold: Any =

Undocumented

_i_best: int =

Undocumented

_iter_stat_names: tuple[str, ...] =

Undocumented

_iter_stat_record: Any =

Undocumented

_loop_gain_correction_factor: Any =

Undocumented

_obs: np.ndarray =

Undocumented

_pixel_threshold: Any =

label_map, n_labels = sp.ndimage.label(self._selected_map) # order labels by number of pixels they contain

ordered_labels = list(range(1,n_labels+1)) # label 0 is background ordered_labels.sort(key = lambda x: np.count_nonzero(label_map == x), reverse=True)

self._selected_map *= False for i in range(n_labels):

if np.count_nonzero(label_map == ordered_labels[i]) >= min_region_size:
self._selected_map |= (label_map == ordered_labels[i])
_psf: np.ndarray =

Undocumented

_px_choice_img_ptr: Pointer =

Undocumented

_residual_copy: np.ndarray =

Undocumented

_rms_threshold: float =

Undocumented

_selected_map: np.ndarray =

Undocumented

_selected_px: np.ndarray =

Undocumented

_stats_best: np.ndarray =

Undocumented

_stats_delta: np.ndarray =

Undocumented

_tmp_r: np.ndarray =

Undocumented