i3extractor¶
Base I3Extractor class(es).
- class graphnet.data.extractors.icecube.i3extractor.I3Extractor(extractor_name, exclude=[None], is_corsika)[source]¶
Bases:
Extractor
Base class for extracting information from physics I3-frames.
Contains functionality required to extract data from i3 files, used by the IceCube Neutrino Observatory.
All classes inheriting from I3Extractor should implement the __call__ method.
Construct I3Extractor.
- Parameters:
extractor_name (
str
) – Name of the I3Extractor instance. Used to keep track of the provenance of different data, and to name tables to which this data is saved.exclude (
list
, default:[None]
) – List of keys to exclude from the extracted data.is_corsika (
bool
, default:False
) – Boolean indicating if the event files being processed are Corsika simulations. Defaults to False.
- set_gcd(i3_file, gcd_file)[source]¶
Extract GFrame and CFrame from i3/gcd-file pair.
Information from these frames will be set as member variables of I3Extractor.
- Parameters:
i3_file (
str
) – Path to i3 file that is being converted.gcd_file (
Optional
[str
], default:None
) – Path to GCD file. Defaults to None. If no GCD file is given, the method will attempt to find C and G frames in the i3 file instead. If either one of those are not present, RuntimeErrors will be raised.
- Return type:
None
- check_primary_energy(frame, primaries)[source]¶
Check that primary energy exists for the particle(s).
If the primary energy is not available, the daughters of the primary particle(s) are returned instead.
- Parameters:
frame (
I3Frame
) – I3Frame object.primaries (
Union
[ListI3Particle
,I3Particle
]) – Primary particle or a list of primary particles.
- Return type:
Union
[ListI3Particle
,I3Particle
]
- get_primaries(frame, daughters)[source]¶
Get the primary particles in the event.
For Corsika events the primary particles are all the primaries, for Nugen we are only interested in the in-ice neutrino. Input: frame: I3Frame object daughters: If True, then ensure that for nugen the primaries are
only the in-ice neutrinos, otherwise all primaries are returned.
- Return type:
ListI3Particle
- Parameters:
frame (icecube.icetray.I3Frame)
daughters (bool)