Skip to content

Commit

Permalink
docstring edits
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondet authored Apr 26, 2024
1 parent b7d2829 commit 39cf4d3
Showing 1 changed file with 70 additions and 72 deletions.
142 changes: 70 additions & 72 deletions src/pygama/pargen/data_cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,44 +373,44 @@ def generate_cuts(
Parameters
----------
data : lh5 table, dictionary of arrays or pandas dataframe
data to calculate cuts on
data to calculate cuts on
parameters : dict
dictionary of the form:
{
"output_parameter_name": {
"cut_parameter": "parameter_to_cut_on",
"cut_level": number_of_sigmas,
"mode": "inclusive" or "exclusive"
}
}
number of sigmas can instead be a dictionary to specify different cut levels for low and high side
or to only have a one sided cut only specify one of the low or high side
e.g.
{
"output_parameter_name": {
"cut_parameter": "parameter_to_cut_on",
"cut_level": {"low_side": 3, "high_side": 2},
"mode": "inclusive" or "exclusive"
}
}
alternatively can specify hit dict fields to just copy dict into output dict e.g.
{
"is_valid_t0":{
"expression":"(tp_0_est>a)&(tp_0_est<b)",
"parameters":{"a":46000, "b":52000}
}
}
or
{
"is_valid_cal":{
"expression":"(~is_pileup_tail)&(~is_pileup_baseline)"
}
}
dictionary of the form:
{
"output_parameter_name": {
"cut_parameter": "parameter_to_cut_on",
"cut_level": number_of_sigmas,
"mode": "inclusive" or "exclusive"
}
}
number of sigmas can instead be a dictionary to specify different cut levels for low and high side
or to only have a one sided cut only specify one of the low or high side
e.g.
{
"output_parameter_name": {
"cut_parameter": "parameter_to_cut_on",
"cut_level": {"low_side": 3, "high_side": 2},
"mode": "inclusive" or "exclusive"
}
}
alternatively can specify hit dict fields to just copy dict into output dict e.g.
{
"is_valid_t0":{
"expression":"(tp_0_est>a)&(tp_0_est<b)",
"parameters":{"a":46000, "b":52000}
}
}
or
{
"is_valid_cal":{
"expression":"(~is_pileup_tail)&(~is_pileup_baseline)"
}
}
rounding : int
number of decimal places to round to
number of decimal places to round to
display : int
if 1 will display plots of the cuts
if 0 will not display plots
if 1 will display plots of the cuts
if 0 will not display plots
Returns
-------
Expand All @@ -424,7 +424,6 @@ def generate_cuts(
}
plot_dict
dictionary of plots
"""

output_dict = {}
Expand Down Expand Up @@ -566,44 +565,44 @@ def generate_cut_classifiers(
Parameters
----------
data : lh5 table, dictionary of arrays or pandas dataframe
data to calculate cuts on
data to calculate cuts on
parameters : dict
dictionary of the form:
{
"output_parameter_name": {
"cut_parameter": "parameter_to_cut_on",
"cut_level": number_of_sigmas,
"mode": "inclusive" or "exclusive"
}
}
number of sigmas can instead be a dictionary to specify different cut levels for low and high side
or to only have a one sided cut only specify one of the low or high side
e.g.
{
"output_parameter_name": {
"cut_parameter": "parameter_to_cut_on",
"cut_level": {"low_side": 3, "high_side": 2},
"mode": "inclusive" or "exclusive"
}
}
alternatively can specify hit dict fields to just copy dict into output dict e.g.
{
"is_valid_t0":{
"expression":"(tp_0_est>a)&(tp_0_est<b)",
"parameters":{"a":46000, "b":52000}
}
}
or
{
"is_valid_cal":{
"expression":"(~is_pileup_tail)&(~is_pileup_baseline)"
}
}
dictionary of the form:
{
"output_parameter_name": {
"cut_parameter": "parameter_to_cut_on",
"cut_level": number_of_sigmas,
"mode": "inclusive" or "exclusive"
}
}
number of sigmas can instead be a dictionary to specify different cut levels for low and high side
or to only have a one sided cut only specify one of the low or high side
e.g.
{
"output_parameter_name": {
"cut_parameter": "parameter_to_cut_on",
"cut_level": {"low_side": 3, "high_side": 2},
"mode": "inclusive" or "exclusive"
}
}
alternatively can specify hit dict fields to just copy dict into output dict e.g.
{
"is_valid_t0":{
"expression":"(tp_0_est>a)&(tp_0_est<b)",
"parameters":{"a":46000, "b":52000}
}
}
or
{
"is_valid_cal":{
"expression":"(~is_pileup_tail)&(~is_pileup_baseline)"
}
}
rounding : int
number of decimal places to round to
number of decimal places to round to
display : int
if 1 will display plots of the cuts
if 0 will not display plots
if 1 will display plots of the cuts
if 0 will not display plots
Returns
-------
Expand All @@ -617,7 +616,6 @@ def generate_cut_classifiers(
}
plot_dict
dictionary of plots
"""

output_dict = {}
Expand Down

0 comments on commit 39cf4d3

Please sign in to comment.