Skip to content

Commit

Permalink
split survival fractions into own script
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmarshall committed Oct 24, 2024
1 parent 018cf61 commit 906d07c
Show file tree
Hide file tree
Showing 2 changed files with 641 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pygama/pargen/lq_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import pygama.math.histogram as pgh
import pygama.pargen.AoE_cal as AoE
from pygama.math.distributions import gaussian
from pygama.pargen.survival_fractions import compton_sf_sweep, get_sf_sweep

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -564,12 +565,10 @@ def calibrate(self, df, initial_lq_param):
f"({self.cal_energy_param}>{peak-emin})&({self.cal_energy_param}<{peak+emax})"
)

cut_df, sf, sf_err = AoE.compton_sf_sweep(
cut_df, sf, sf_err = compton_sf_sweep(
peak_df[self.cal_energy_param].to_numpy(),
peak_df[final_lq_param].to_numpy(),
self.cut_val,
peak,
fwhm,
cut_range=(0, 5),
n_samples=30,
mode="less",
Expand All @@ -587,7 +586,7 @@ def calibrate(self, df, initial_lq_param):
peak_df = select_df.query(
f"({self.cal_energy_param}>{fit_range[0]})&({self.cal_energy_param}<{fit_range[1]})"
)
cut_df, sf, sf_err = AoE.get_sf_sweep(
cut_df, sf, sf_err = get_sf_sweep(
peak_df[self.cal_energy_param].to_numpy(),
peak_df[final_lq_param].to_numpy(),
self.cut_val,
Expand Down
Loading

0 comments on commit 906d07c

Please sign in to comment.