NuRadioReco.modules.io package

Submodules

NuRadioReco.modules.io.NuRadioRecoio module

class NuRadioReco.modules.io.NuRadioRecoio.NuRadioRecoio(filenames, parse_header=True, parse_detector=True, fail_on_version_mismatch=True, fail_on_minor_version_mismatch=False, max_open_files=10, log_level=None, buffer_size=104857600)

Bases: object

close_files()
get_detector()

If parse_detector was set True in the __init__() function, this function return the detector description (assuming there is one in the files). If several files with different detectors are read, the detector for the last returned event is given.

get_event(event_id)
get_event_i(event_number)
get_event_ids()

returns a list of (run, eventid) tuples of all events contained in the data file

get_events()
get_filenames()
get_header()
get_n_events()
openFile(filenames)

NuRadioReco.modules.io.eventReader module

class NuRadioReco.modules.io.eventReader.eventReader

Bases: object

read events from file

begin(filename, read_detector=False, log_level=30)

Setup function for the eventReader module

filename: array if strings

names of the input files

read_detector: boolean
If True, the eventReader will parse the detector description and event event headers

in the event files. This is necessary to use the get_detector functions

log_level: logging enum

end()
get_detector()

If read_detector was set True in the begin() function, this function return the detector description (assuming there is one in the files). If several files with different detectors are read, the detector for the last returned event is given.

get_header()

returns the header information of all events, useful to get a quick overview of all events without looping through all events

run()

NuRadioReco.modules.io.eventWriter module

class NuRadioReco.modules.io.eventWriter.eventWriter

Bases: object

save events to file

begin(filename, max_file_size=1024, check_for_duplicates=False)

begin method

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

end()
run(evt, det=None, mode=None)

writes NuRadioReco event into a file

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 (default: {‘Channels’: True, ‘ElectricFields’: True, ‘SimChannels’: True, ‘SimElectricFields’: True})

specifies what will saved into the *.nur output file can contain the strings * ‘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

NuRadioReco.modules.io.eventWriter.get_header(evt)

Module contents