diff --git a/cosipy/image_deconvolution/deconvolution_algorithm_base.py b/cosipy/image_deconvolution/deconvolution_algorithm_base.py index 4947fad0..63d6a2f5 100644 --- a/cosipy/image_deconvolution/deconvolution_algorithm_base.py +++ b/cosipy/image_deconvolution/deconvolution_algorithm_base.py @@ -56,7 +56,11 @@ def __init__(self, initial_model, dataset, mask, parameter): logger.debug(f'dict_bkg_norm: {self.dict_bkg_norm}') logger.debug(f'dict_dataset_indexlist_for_bkg_models: {self.dict_dataset_indexlist_for_bkg_models}') - self.minimum_flux = parameter.get('minimum_flux:value', 0.0) * u.Unit(parameter.get('minimum_flux:unit', initial_model.unit)) + self.minimum_flux = parameter.get('minimum_flux:value', 0.0) + + minimum_flux_unit = parameter.get('minimum_flux:unit', initial_model.unit) + if minimum_flux_unit is not None: + self.minimum_flux = self.minimum_flux*u.Unit(minimum_flux_unit) # parameters of the iteration self.iteration_count = 0 diff --git a/cosipy/image_deconvolution/model_base.py b/cosipy/image_deconvolution/model_base.py index 9a55a345..4b7ab9f4 100644 --- a/cosipy/image_deconvolution/model_base.py +++ b/cosipy/image_deconvolution/model_base.py @@ -62,7 +62,7 @@ def mask_pixels(self, mask, fill_value = 0): fill_value: float or :py:class:`astropy.units.quantity.Quantity` """ - if not isinstance(fill_value, u.quantity.Quantity): + if not isinstance(fill_value, u.quantity.Quantity) and self.unit is not None: fill_value *= self.contents.unit model_new = copy.deepcopy(self)