21 from glue
import segments
22 from glue.ligolw
import ligolw
23 from glue.ligolw
import lsctables
24 from glue.ligolw
import utils
as ligolw_utils
25 from pylal.datatypes
import LIGOTimeGPS
44 lsctables.use_in(ContentHandler)
54 Given an xml file create a segment list that marks the time of an
55 injection with padding
57 - fname: the xml file name
58 - pad: duration in seconds to pad the coalescence time when producint a segment, e.g., [tc-pad, tc+pad)
63 seglist = segments.segmentlist()
67 xmldoc = ligolw_utils.load_filename(fname, contenthandler=ContentHandler, verbose=verbose)
71 for row
in lsctables.SimInspiralTable.get_table(xmldoc):
72 t = LIGOTimeGPS(row.get_time_geocent())
73 seglist.append(segments.segment(t-pad, t+pad))
79 return seglist.coalesce()