class CleanModified(Base):
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 |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Class Variable | clean |
Undocumented |
Class Variable | fabs |
Undocumented |
Class Variable | give |
Undocumented |
Class Variable | loop |
Undocumented |
Class Variable | max |
Undocumented |
Class Variable | min |
Undocumented |
Class Variable | n |
Undocumented |
Class Variable | n |
Undocumented |
Class Variable | noise |
Undocumented |
Class Variable | rms |
Undocumented |
Class Variable | threshold |
Undocumented |
Instance Variable | progress |
Undocumented |
Method | _init |
Perform any initialisation that needs to be done before the algorithm runs. |
Method | _iter |
Perform a single iteration of the algorithm. |
Method | _stopping |
Undocumented |
Instance Variable | _accumulator |
Undocumented |
Instance Variable | _choose |
Undocumented |
Instance Variable | _components |
Undocumented |
Instance Variable | _components |
Undocumented |
Instance Variable | _current |
Undocumented |
Instance Variable | _current |
Undocumented |
Instance Variable | _fabs |
Undocumented |
Instance Variable | _flux |
Undocumented |
Instance Variable | _get |
Undocumented |
Instance Variable | _i |
Undocumented |
Instance Variable | _iter |
Undocumented |
Instance Variable | _iter |
Undocumented |
Instance Variable | _loop |
Undocumented |
Instance Variable | _obs |
Undocumented |
Instance Variable | _pixel |
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 |
Undocumented |
Instance Variable | _residual |
Undocumented |
Instance Variable | _residual |
Undocumented |
Instance Variable | _rms |
Undocumented |
Instance Variable | _selected |
Undocumented |
Instance Variable | _selected |
Undocumented |
Instance Variable | _stats |
Undocumented |
Instance Variable | _stats |
Undocumented |
Instance Variable | _tmp |
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 |
Undocumented |
Method | set |
Undocumented |
Class Variable | final |
Undocumented |
Class Variable | n |
Undocumented |
Class Variable | post |
Undocumented |
Class Variable | post |
Undocumented |
Class Variable | pre |
Undocumented |
Class Variable | pre |
Undocumented |
Method | _set |
Undocumented |
Instance Variable | _i |
Undocumented |
Instance Variable | _last |
Undocumented |
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])