Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmarshall committed Dec 6, 2023
1 parent b38179b commit 61d1df8
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 16 deletions.
48 changes: 36 additions & 12 deletions scripts/complete_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,24 @@ def build_file_dbs(input_files, output_dir):
"evt": ut.tier_evt_path(setup).replace(os.getenv("PRODENV"), ""),
},
"file_format": {
"raw": pat.get_pattern_tier(setup, "raw").replace(ut.tier_raw_path(setup), ""),
"dsp": pat.get_pattern_tier(setup, "dsp").replace(ut.tier_dsp_path(setup), ""),
"hit": pat.get_pattern_tier(setup, "hit").replace(ut.tier_hit_path(setup), ""),
"pht": pat.get_pattern_tier(setup, "pht").replace(ut.tier_hit_path(setup), ""),
"evt": pat.get_pattern_tier(setup, "evt").replace(ut.tier_evt_path(setup), ""),
"tcm": pat.get_pattern_tier(setup, "tcm").replace(ut.tier_tcm_path(setup), ""),
"raw": pat.get_pattern_tier(setup, "raw", check_in_cycle=False).replace(
ut.tier_raw_path(setup), ""
),
"dsp": pat.get_pattern_tier(setup, "dsp", check_in_cycle=False).replace(
ut.tier_dsp_path(setup), ""
),
"hit": pat.get_pattern_tier(setup, "hit", check_in_cycle=False).replace(
ut.tier_hit_path(setup), ""
),
"pht": pat.get_pattern_tier(setup, "pht", check_in_cycle=False).replace(
ut.tier_hit_path(setup), ""
),
"evt": pat.get_pattern_tier(setup, "evt", check_in_cycle=False).replace(
ut.tier_evt_path(setup), ""
),
"tcm": pat.get_pattern_tier(setup, "tcm", check_in_cycle=False).replace(
ut.tier_tcm_path(setup), ""
),
},
"table_format": {
"raw": "ch{ch:07d}/raw",
Expand All @@ -205,12 +217,24 @@ def build_file_dbs(input_files, output_dir):
"evt": ut.tier_evt_path(setup),
},
"file_format": {
"raw": pat.get_pattern_tier(setup, "raw").replace(ut.tier_raw_path(setup), ""),
"dsp": pat.get_pattern_tier(setup, "dsp").replace(ut.tier_dsp_path(setup), ""),
"hit": pat.get_pattern_tier(setup, "hit").replace(ut.tier_hit_path(setup), ""),
"pht": pat.get_pattern_tier(setup, "pht").replace(ut.tier_hit_path(setup), ""),
"evt": pat.get_pattern_tier(setup, "evt").replace(ut.tier_evt_path(setup), ""),
"tcm": pat.get_pattern_tier(setup, "tcm").replace(ut.tier_tcm_path(setup), ""),
"raw": pat.get_pattern_tier(setup, "raw", check_in_cycle=False).replace(
ut.tier_raw_path(setup), ""
),
"dsp": pat.get_pattern_tier(setup, "dsp", check_in_cycle=False).replace(
ut.tier_dsp_path(setup), ""
),
"hit": pat.get_pattern_tier(setup, "hit", check_in_cycle=False).replace(
ut.tier_hit_path(setup), ""
),
"pht": pat.get_pattern_tier(setup, "pht", check_in_cycle=False).replace(
ut.tier_hit_path(setup), ""
),
"evt": pat.get_pattern_tier(setup, "evt", check_in_cycle=False).replace(
ut.tier_evt_path(setup), ""
),
"tcm": pat.get_pattern_tier(setup, "tcm", check_in_cycle=False).replace(
ut.tier_tcm_path(setup), ""
),
},
"table_format": {
"raw": "ch{ch:07d}/raw",
Expand Down
2 changes: 1 addition & 1 deletion scripts/pars_hit_ecal.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def energy_cal_th(
tail_weight=tail_weight,
)
full_object_dict[cal_energy_param].calibrate_parameter(data)
results_dict[cal_energy_param] = full_object_dict[energy_param].get_results_dict(data)
results_dict[cal_energy_param] = full_object_dict[cal_energy_param].get_results_dict(data)
hit_dict.update(full_object_dict[cal_energy_param].hit_dict)
if ~np.isnan(full_object_dict[cal_energy_param].pars).all():
plot_dict[cal_energy_param] = (
Expand Down
2 changes: 1 addition & 1 deletion scripts/pars_hit_lq.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pandas as pd
from legendmeta import LegendMetadata
from legendmeta.catalog import Props
from pygama.math.fitting import gauss_cdf
from pygama.math.peak_fitting import gauss_cdf
from pygama.pargen.lq_cal import * # noqa: F403
from pygama.pargen.lq_cal import cal_lq
from pygama.pargen.utils import get_tcm_pulser_ids, load_data
Expand Down
2 changes: 1 addition & 1 deletion scripts/pars_pht_lqcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pandas as pd
from legendmeta import LegendMetadata
from legendmeta.catalog import Props
from pygama.math.fitting import gauss_cdf
from pygama.math.peak_fitting import gauss_cdf
from pygama.pargen.lq_cal import * # noqa: F403
from pygama.pargen.lq_cal import cal_lq
from pygama.pargen.utils import get_tcm_pulser_ids, load_data
Expand Down
2 changes: 1 addition & 1 deletion scripts/pars_pht_partcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def run_splitter(files):
hit_dicts, ecal_results, plot_dict, ecal_obj = partition_energy_cal_th(
data,
cal_dict,
election_string=f"{kwarg_dict.pop('final_cut_field')}&(~is_pulser)",
selection_string=f"{kwarg_dict.pop('final_cut_field')}&(~is_pulser)",
**kwarg_dict,
)

Expand Down

0 comments on commit 61d1df8

Please sign in to comment.