time_slides_vacuum¶
- igwn_ligolw.utils.time_slide.time_slides_vacuum(time_slides, verbose=False)¶
Given a dictionary mapping time slide IDs to instrument–>offset mappings, for example as returned by the as_dict() method of the TimeSlideTable class in igwn_ligolw.lsctables, construct and return a mapping indicating time slide equivalences. This can be used to delete redundant time slides from a time slide table, and then also used via the applyKeyMapping() method of igwn_ligolw.table.Table instances to update cross references (for example in the coinc_event table).
Example:
>>> from lalburst.offsetvector import offsetvector >>> slides = {0: offsetvector({"H1": 0, "H2": 0}), 1: offsetvector({"H1": 10, "H2": 10}), 2: offsetvector({"H1": 0, "H2": 10})} >>> time_slides_vacuum(offsetvector(slides)) {0: 1}
indicating that time slide ID 1 describes a time slide that is equivalent to time slide ID 0. The calling code could use this information to delete time slide ID 1 from the time_slide table, and replace references to that ID in other tables with references to time slide ID 0.