fitting¶
Functions and classes for fitting contours using PISA.
- graphnet.pisa.fitting.config_updater(config_path, new_config_path, dummy_section)[source]¶
Update config files and saves them to file.
- Parameters:
config_path (
str
) – Path to original config file.new_config_path (
Optional
[str
], default:None
) – Path to save updated config file.dummy_section (
str
, default:'temp'
) – Dummy section name to use for config files without section headers.
- Yields:
ConfigUpdater instance for programatically updating config file.
- Return type:
ConfigUpdater
- class graphnet.pisa.fitting.WeightFitter(database_path, truth_table, index_column, statistical_fit)[source]¶
Bases:
object
Class for fitting weights using PISA.
Construct WeightFitter.
- Parameters:
database_path (str) –
truth_table (str) –
index_column (str) –
statistical_fit (bool) –
- fit_weights(config_outdir, weight_name, pisa_config_dict, add_to_database)[source]¶
Fit flux weights to each neutrino event in self._database_path.
If statistical_fit=True, only statistical effects are accounted for. If True, certain systematic effects are included, but not hypersurfaces.
- Parameters:
config_outdir (
str
) – The output directory in which to store the configuration.weight_name (
str
, default:''
) – The name of the weight. If add_to_database=True, this will be the name of the table.pisa_config_dict (
Optional
[Dict
], default:None
) – The dictionary of PISA configurations. Can be used to change assumptions regarding the fit.add_to_database (
bool
, default:False
) – If True, a table will be added to the database called weight_name with two columns: [index_column, weight_name]
- Return type:
DataFrame
- Returns:
A dataframe with columns [index_column, weight_name].
- class graphnet.pisa.fitting.ContourFitter(outdir, pipeline_path, post_fix, model_name, include_retro, statistical_fit)[source]¶
Bases:
object
Class for fitting contours using PISA.
Construct ContourFitter.
- Parameters:
outdir (str) –
pipeline_path (str) –
post_fix (str) –
model_name (str) –
include_retro (bool) –
statistical_fit (bool) –
- fit_1d_contour(run_name, config_dict, grid_size, n_workers, theta23_minmax=(36.0, 54.0), dm31_minmax=(2.3, 2.7))[source]¶
Fit 1D contours.
- Return type:
None
- Parameters:
run_name (str) –
config_dict (Dict) –
grid_size (int) –
n_workers (int) –
theta23_minmax (Tuple[float, float]) –
dm31_minmax (Tuple[float, float]) –
- fit_2d_contour(run_name, config_dict, grid_size, n_workers, theta23_minmax=(36.0, 54.0), dm31_minmax=(2.3, 2.7))[source]¶
Fit 2D contours.
- Return type:
None
- Parameters:
run_name (str) –
config_dict (Dict) –
grid_size (int) –
n_workers (int) –
theta23_minmax (Tuple[float, float]) –
dm31_minmax (Tuple[float, float]) –