selections#
Dataset wrangling module.
Classes:
|
Data file repository. |
|
Background and signal data. |
Exceptions:
|
- class csky.selections.Repository(local_root=None, remote_root=None, username=None)[source]#
Bases:
object
Data file repository.
This class provides a mechanism for loading data from the UW-Madison stores. If working elsewhere, it is possible to mirror the required data on request.
Methods:
__init__
([local_root, remote_root, username])Construct a Repository.
ensure
(path)Ensure that the specified file is locally accessible.
load
(path[, backend, target_class, quiet, ...])Load a file.
- class csky.selections.Dataset(key, livetime, sig, data=None, bg=None, cascades=False, grl=None, range_sindec=(-1, 1))[source]#
Bases:
object
Background and signal data.
These normally should not be constructed directly; see
csky.utils.get_analysis()
.Methods:
- __init__(key, livetime, sig, data=None, bg=None, cascades=False, grl=None, range_sindec=(-1, 1))[source]#
Construct a
Dataset
.- Parameters:
key (str) – a unique identifier for these datasets
livetime (float) – The livetime of this analysis.
sig (mapping or object) – an object containing at least the following members or keys:
dec
,ra
,true_dec
,true_ra
,true_energy
,oneweight
(OneWeight/ngen). Corresponding values should be per-event numpy arrays.bg (mapping or object, optional) – like
data
, but must includeweight
.data (mapping or object, optional) – an object containing at least the following members or keys:
dec
,ra
,weight
. Corresponding values should be per-event numpy arrays, except forweight
which may be None.cascades (bool) – whether this is cascade data as opposed to tracks
grl (
csky.utils.Arrays
) – the good run list
One of
bg
ordata
must be provided.sig
,bg
, anddata
will generally need additional keys such asenergy
(for use with energy PDFs) and/orsigma
(for per-event Gaussian signal space PDFs).
- exception csky.selections.StopModifications(*a, **kw)[source]#
Bases:
Exception
Methods:
__init__
(*a, **kw)Exception.add_note(note) -- add a note to the exception
Exception.with_traceback(tb) -- set self.__traceback__ to tb and return self.
- add_note()#
Exception.add_note(note) – add a note to the exception
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.