icecube.steamshovel.util.rangefinder module

icecube.steamshovel.util.rangefinder.getRangeHistogram(frame, key, timeRange)

Given a frame, a key, and a tuple (start,end), attempt to create a histogram for the timeline widget.

The returned histogram should be a dataclasses.I3VectorFloat with all values between 0 and 1.

As with getTimeRange, this function may return None, or throw any exception, to indicate that producing a histogram with the given key is not possible.

icecube.steamshovel.util.rangefinder.getTimeRange(frame, key)

Return the visible time range of frame[key], if one can be extracted.

This is the backend of the python RangeFinder in TimelineWidget. It returns a tuple of ints (start,end) incating the beginning and end of the given event according to the arbitrary frame object frame[key]. In general this is meant to detect the range of a RecoPulseSeriesMap or similar object.

If no range can be gathered, this function returns None or throws an exception. Any python exception may be thrown; this simply indicates the key cannot be used for the given frame.

Exotic types from unusual projects may be added here as well, but this module should not throw an exception when imported, so projects that aren’t in offline-software should be loaded in a try block.