pisa.stages.data package
pisa.stages.data.csv_data_hist module
A Stage to load data from a CSV datarelease format file into a PISA pi ContainerSet
-
class pisa.stages.data.csv_data_hist.csv_data_hist(events_file, **std_kwargs)[source]
Bases: Stage
CSV file loader PISA Pi class
- Parameters:
events_file (csv file path)
-
setup_function()[source]
Implement in services (subclasses of Stage)
-
pisa.stages.data.csv_data_hist.init_test(**param_kwargs)[source]
Instantiation example
pisa.stages.data.csv_icc_hist module
A Stage to load data from a CSV datarelease format file into a PISA pi ContainerSet
-
class pisa.stages.data.csv_icc_hist.csv_icc_hist(events_file, **std_kwargs)[source]
Bases: Stage
CSV file loader PISA class
- Parameters:
events_file (csv file path)
-
apply_function()[source]
Implement in services (subclasses of Stage)
-
setup_function()[source]
Implement in services (subclasses of Stage)
-
pisa.stages.data.csv_icc_hist.init_test(**param_kwargs)[source]
Instantiation example
pisa.stages.data.csv_loader module
A Stage to load data from a CSV datarelease format file into a PISA pi ContainerSet
-
class pisa.stages.data.csv_loader.csv_loader(events_file, output_names, **std_kwargs)[source]
Bases: Stage
CSV file loader PISA Pi class
- Parameters:
-
-
apply_function()[source]
Implement in services (subclasses of Stage)
-
setup_function()[source]
Implement in services (subclasses of Stage)
-
pisa.stages.data.csv_loader.init_test(**param_kwargs)[source]
Initialisation example
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)
-
apply_function()[source]
Implement in services (subclasses of Stage)
-
setup_function()[source]
Implement in services (subclasses of Stage)
-
pisa.stages.data.grid.init_test(**param_kwargs)[source]
Instantiation example
pisa.stages.data.licloader_weighter module
pisa.stages.data.meows_loader module
A class to load in the MEOWS hdf5 files
-
pisa.stages.data.meows_loader.init_test(**param_kwargs)[source]
Instantiation example
-
class pisa.stages.data.meows_loader.meows_loader(events_file: str, n_files: int, output_names, **std_kwargs)[source]
Bases: Stage
Docstring incoming…
-
apply_function()[source]
Resets all the weights to the initial weights
-
setup_function()[source]
Go over all those input files and load them in.
We load the first data in specifically to setup the containers, and afterwards go through appending to the end of those arrays
pisa.stages.data.simple_data_loader module
A Stage to load data from a PISA style hdf5 file into a PISA pi ContainerSet
-
pisa.stages.data.simple_data_loader.init_test(**param_kwargs)[source]
Initialisation example
-
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, …
fraction_events_to_keep (float) – Fraction of loaded events to use (use to downsample).
Must be in range [0.,1.], or disable by setting to None.
Default in None.
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.
-
apply_cuts_to_events()[source]
Just apply any cuts that the user defined
-
apply_function()[source]
Implement in services (subclasses of Stage)
-
load_events()[source]
Loads events from events file
-
record_event_properties()[source]
Adds fields present in events file and selected in self.data_dict
into containers for the specified output names. Also ensures the
presence of a set of nominal weights.
-
setup_function()[source]
Store event properties from events file at
service initialisation. Cf. Stage docs.
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
-
pisa.stages.data.simple_signal.init_test(**param_kwargs)[source]
Initialisation example
-
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
-
setup_function()[source]
This is where we figure out how many events to generate,
define their weights relative to the data statistics
and initialize the container we will need
This function is run once when we instantiate the pipeline
pisa.stages.data.sqlite_loader module
A Stage to load data from an sqlite database
-
pisa.stages.data.sqlite_loader.init_test(**param_kwargs)[source]
Instantiation example
-
class pisa.stages.data.sqlite_loader.sqlite_loader(database, output_names, post_fix='_pred', **std_kwargs)[source]
Bases: Stage
SQLite loader PISA Pi class
:param database:
:type database: path to sqlite database
:param **kwargs: Passed to Stage
-
add_aeff_weight(container, truth, n_files)[source]
-
add_reco(container, reco)[source]
Adds reconstructed quantities to container
-
add_truth(container, truth, nubar, flavor)[source]
Adds truth to container
-
apply_function()[source]
Implement in services (subclasses of Stage)
-
get_pid_and_interaction_type(name)[source]
Sorry
-
initialize_weights(container)[source]
-
query_database(interaction_type, pid)[source]
-
setup_function()[source]
Implement in services (subclasses of Stage)
pisa.stages.data.toy_event_generator module
Stage to generate some random data
-
pisa.stages.data.toy_event_generator.init_test(**param_kwargs)[source]
Initialisation example
-
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:
-
-
apply_function()[source]
Implement in services (subclasses of Stage)
-
setup_function()[source]
Implement in services (subclasses of Stage)