Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyoneda committed Jun 12, 2024
1 parent bdb65a3 commit a712652
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cosipy/image_deconvolution/RichardsonLucy.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, initial_model, dataset, mask, parameter):
logger.info(f"Gaussian filter with FWHM of {self.smoothing_fwhm} will be applied to delta images ...")

self.do_bkg_norm_optimization = parameter.get('background_normalization_optimization', False)
if self.do_bkg_norm_fitting:
if self.do_bkg_norm_optimization:
self.dict_bkg_norm_range = parameter.get('background_normalization_range', {key: [0.0, 100.0] for key in self.dict_bkg_norm.keys()})

self.save_results = parameter.get('save_results', False)
Expand Down Expand Up @@ -98,7 +98,7 @@ def initialization(self):
logger.info("The expected count histograms were calculated with the initial model map.")

# calculate summed background models for M-step
if self.do_bkg_norm_fitting:
if self.do_bkg_norm_optimization:
self.dict_summed_bkg_model = {}
for key in self.dict_bkg_norm.keys():
self.dict_summed_bkg_model[key] = self.calc_summed_bkg_model(key)
Expand Down Expand Up @@ -128,7 +128,7 @@ def Mstep(self):
self.delta_model = self.model * (sum_T_product/self.summed_exposure_map - 1)

# background normalization optimization
if self.do_bkg_norm_fitting:
if self.do_bkg_norm_optimization:
for key in self.dict_bkg_norm.keys():

sum_bkg_T_product = self.calc_summed_bkg_model_product(key, ratio_list)
Expand Down
4 changes: 2 additions & 2 deletions cosipy/image_deconvolution/model_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class ModelBase(Histogram, ABC):
Subclasses must override these methods. The `ImageDeconvolution` class will use them in the initialization process.
Attributes:
Methods:
- instantiate_from_parameters(cls, parameter)
- set_values_from_parameters(self, parameter):
- set_values_from_parameters(self, parameter)
"""

def __init__(self, edges, contents = None, sumw2 = None,
Expand Down

0 comments on commit a712652

Please sign in to comment.