Skip to content

Commit

Permalink
bugfix computation of convergence rate
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume.grolleron committed Nov 28, 2023
1 parent 3a881aa commit d63767f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nectarchain/makers/component/FlatFieldSPEComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def finish(self,*args,**kwargs) :
if not(is_empty) :
spe_fit = eval(self.SPEfitalgorithm).create_from_chargesContainer(self._chargesContainers,parent = self,**self._SPEfitalgorithm_kwargs)
fit_output = spe_fit.run(pixels_id = self.asked_pixels_id, *args, **kwargs)
conv_rate = np.sum(spe_fit.results.is_valid)/len(self.asked_pixels_id)
n_asked_pix = len(self._chargesContainers.pixels_id) if self.asked_pixels_id is None else len(self.asked_pixels_id)
conv_rate = np.sum(spe_fit.results.is_valid)/n_asked_pix
self.log.info(f"convergence rate : {conv_rate}")
return spe_fit.results
else :
Expand Down

0 comments on commit d63767f

Please sign in to comment.