segmentlistdict_from_short_string¶
- igwn_segments.utils.segmentlistdict_from_short_string(s, boundtype=<class 'int'>)¶
Parse a string representation of a set of named segmentlists into a segmentlistdict object. The string encoding is that generated by segmentlistdict_to_short_string(). The optional boundtype argument will be passed to from_range_strings() when parsing the segmentlist objects from the string.
Example:
>>> segmentlistdict_from_short_string("H1=0:10,35,100:/L1=5:15,45:60") {'H1': [segment(0, 10), segment(35, 35), segment(100, infinity)], 'L1': [segment(5, 15), segment(45, 60)]}
This function, and its inverse segmentlistdict_to_short_string(), are intended to be used to allow small segmentlistdict objects to be encoded in command line options and config files. For large segmentlistdict objects or when multiple sets of segmentlists are required, the LIGO Light Weight XML encoding available through the igwn_ligolw library should be used.