pisa.stages.data package
Submodules
pisa.stages.data.csv_data_hist module
A Stage to load data from a CSV datarelease format file into a PISA pi ContainerSet
pisa.stages.data.csv_icc_hist module
A Stage to load data from a CSV datarelease format file into a PISA pi ContainerSet
pisa.stages.data.csv_loader module
A Stage to load data from a CSV datarelease format file into a PISA pi ContainerSet
pisa.stages.data.grid module
Stage to create a grid of data
- class pisa.stages.data.grid.grid(grid_binning, entity='midpoints', output_names=None, **std_kwargs)[source]
Bases:
Stage
Create a grid of events
- Parameters:
generated (Binning object defining the grid to be)
- entitystr
entity arg to be passed to MultiDimBinning.meshgrid (see that fucntion docs for details)
pisa.stages.data.licloader_weighter module
pisa.stages.data.meows_loader module
A class to load in the MEOWS hdf5 files
pisa.stages.data.simple_data_loader module
A Stage to load data from a PISA style hdf5 file into a PISA pi ContainerSet
- class pisa.stages.data.simple_data_loader.simple_data_loader(events_file, mc_cuts, data_dict, neutrinos=True, required_metadata=None, fraction_events_to_keep=None, events_subsample_index=0, seed=123456, output_names=None, **std_kwargs)[source]
Bases:
Stage
HDF5 file loader PISA Pi class
- Parameters:
events_file (hdf5 file path) – output from make_events, including flux weights and Genie systematics coefficients
mc_cuts (cut expr) – e.g. ‘(true_coszen <= 0.5) & (true_energy <= 70)’
data_dict (str of a dict) – Dictionary to specify what keys from the hdf5 files to be loaded under what name. Entries can be strings that point to the right key in the hdf5 file or lists of keys, and the data will be stacked into a 2d array.
neutrinos (bool) – Flag indicating whether data events represent neutrinos In this case, special handling for e.g. nu/nubar, CC vs NC, …
required_metadata (sequence of str, default: None) – Optionally specify metadata keys to parse from the events_file metadata.
fraction_events_to_keep (float, default: None) – Fraction of loaded events to use (use to downsample). Must be in range [0.,1.]. Disabled by setting to None.
events_subsample_index (int >= 0, default: 0) – If fraction_events_to_keep is not None, determines which of the statistically independent sub-samples (uniquely determined by the seed below) to select.
seed (int, default: 123456) – If fraction_events_to_keep is not None, serves as random seed for generating reproducible sub-samples.
output_names (sequence of str, default: None) – Event categories to be recorded. If specified, needs to be a subset of names in events_file.
Notes
Looks for initial_weights fields in events file, which will serve as nominal weights for all events included. No fields named weights may already be present.
pisa.stages.data.simple_signal module
Stage to generate simple 1D data consisting of a flat background + gaussian peak with a mean and a width
- class pisa.stages.data.simple_signal.simple_signal(**std_kwargs)[source]
Bases:
Stage
random toy event generator PISA class
- Parameters:
params –
Expected params ..
n_events : int Number of events to be generated per output name random seed : int Seed to be used for random
- apply_function()[source]
This is where we re-weight the signal container based on a model gaussian with tunable parameters mu and sigma.
The background is left untouched in this step.
A possible upgrade to this function would be to make a small background re-weighting
This function will be called at every iteration of the minimizer
pisa.stages.data.sqlite_loader module
A Stage to load data from an sqlite database
pisa.stages.data.toy_event_generator module
Stage to generate some random data
- class pisa.stages.data.toy_event_generator.toy_event_generator(output_names, **std_kwargs)[source]
Bases:
Stage
random toy event generator PISA Pi class
- Parameters:
output_names (str) – list of output names
params –
Expected params ..
n_events : int Number of events to be generated per output name random seed : int Seed to be used for random