NuRadioReco.modules.io.eventWriter module
- class NuRadioReco.modules.io.eventWriter.eventWriter[source]
Bases:
object
save events to file
Methods
begin
(filename[, max_file_size, ...])begin method
run
(evt[, det, mode])writes NuRadioReco event into a file
end
- begin(filename, max_file_size=1024, check_for_duplicates=False, events_per_file=None, log_level=0)[source]
begin method
- Parameters:
- filename: string
Name of the file into which events shall be written
- max_file_size: maximum file size in Mbytes
(if the file exceeds the maximum file the output will be split into another file)
- check_for_duplicates: bool (default False)
if True, the event writer raises an exception when an event with a (run,eventid) pair is written that is already present in the data file
- events_per_file: int
Maximum number of events to be written into the same file. After more than events_per_file have been written into the same file, the output will be split into another file. If max_file_size and events_per_file are both set, the file will be split whenever any of the two conditions is fullfilled.
- log_level: int, default=logging.NOTSET
Use this to override the logging level for this module.
- run(evt, det=None, mode=None)[source]
writes NuRadioReco event into a file
- Parameters:
- evt: NuRadioReco event object
- det: detector object
If a detector object is passed, the detector description for the events is written in the file as well
- mode: dictionary, optional
Specifies what will be saved into the *.nur output file. Can contain the following keys:
‘Channels’: if True channel traces of Stations will be saved
‘ElectricFields’: if True (reconstructed) electric field traces of Stations will be saved
‘SimChannels’: if True SimChannels of SimStations will be saved
‘SimElectricFields’: if True electric field traces of SimStations will be saved
if no dictionary is passed, the default option is to save all of the above