diff --git a/ompy/firstgeneration.py b/ompy/firstgeneration.py index b71f9c2a..51629d06 100644 --- a/ompy/firstgeneration.py +++ b/ompy/firstgeneration.py @@ -56,8 +56,6 @@ class FirstGeneration: multiplicity_estimation (str): Selects which method should be used for the multiplicity estimation. Can be either "statistical", or "total". Default is "statistical". - window_size (int or np.ndarray): window_size for (fill and) remove - negatives on output. Defaults to 20. statistical_upper (float): Threshold for upper limit in `statistical` multiplicity estimation. Defaults to 430 keV. statistical_lower (float): Threshold for lower limit in @@ -87,7 +85,6 @@ class FirstGeneration: def __init__(self): self.num_iterations: int = 10 self.multiplicity_estimation: str = 'statistical' - self.window_size = 20 self.statistical_upper: float = 430.0 # MAMA ThresSta self.statistical_lower: float = 200.0 # MAMA ThresTot @@ -401,14 +398,15 @@ def allgen_from_primary(fg: Matrix, return ag def remove_negative(self, matrix: Matrix): - """ (Fill and) remove negative counts + """ Wrapper for Matrix.remove_negative() - Wrapper for Matrix.fill_and_remove_negative() + Put in as an extra method to facilitate replacing this by eg. + `fill_and_remove_negatve` Args: matrix: Input matrix """ - matrix.fill_and_remove_negative(window_size=self.window_size) + matrix.remove_negative() def normalize_rows(array: np.ndarray) -> np.ndarray: diff --git a/ompy/unfolder.py b/ompy/unfolder.py index 326f2c1c..a74692f8 100644 --- a/ompy/unfolder.py +++ b/ompy/unfolder.py @@ -78,8 +78,6 @@ class Unfolder: fluctuations. Defaults to 0.2 minimum_iterations (int, optional): Minimum number of iterations. Defaults to 3. - window_size (int or np.ndarray): window_size for (fill and) remove - negatives on output. Defaults to 20. use_compton_subtraction (bool, optional): Set usage of Compton subtraction method. Defaults to `True`. response_tab (DataFrame, optional): If `use_compton_subtraction=True` @@ -105,7 +103,6 @@ def __init__(self, num_iter: int = 33, response: Optional[Matrix] = None): self.num_iter = num_iter self.weight_fluctuation: float = 0.2 self.minimum_iterations: int = 3 - self.window_size = 20 self._R: Optional[Matrix] = response self.raw: Optional[Matrix] = None @@ -431,14 +428,15 @@ def compton_subtraction(self, unfolded: np.ndarray) -> np.ndarray: return unfolded def remove_negative(self, matrix: Matrix): - """ (Fill and) remove negative counts + """ Wrapper for Matrix.remove_negative() - Wrapper for Matrix.fill_and_remove_negative() + Put in as an extra method to facilitate replacing this by eg. + `fill_and_remove_negatve` Args: matrix: Input matrix """ - matrix.fill_and_remove_negative(window_size=self.window_size) + matrix.remove_negative() def shift(counts_in, E_array_in, energy_shift):