Skip to content

Commit

Permalink
Merge day boundary (gwpy#146)
Browse files Browse the repository at this point in the history
* Address issue gwpy#126. Allow pyomicron to run from a frame cache without accessing dqsegdb. Add documentation for this

* Do not merge files if they overlap "metric days"

* Do not cross metric day boundaries.

Co-authored-by: Joseph Areeda <[email protected]>
  • Loading branch information
areeda and Joseph Areeda committed Nov 22, 2022
1 parent 73ceb29 commit 3798f20
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Documentation

workflow/index
configuration/index
workflow/simulations

**Utilities**

Expand Down
2 changes: 1 addition & 1 deletion omicron/cli/merge_with_gaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def valid_file(path, uint_bug):
table = EventTable.read(path, path='/triggers')
elif path.name.endswith('.xml.gz') or path.name.endswith('.xml'):
if uint_bug:
sed_cmd = ['sed', '-i', '-e', 's/uint_8s/int_8u/g', str(path.absolute())]
sed_cmd = ['sed', '-i', '', '-e', 's/uint_8s/int_8u/g', str(path.absolute())]
subprocess.run(sed_cmd)
table = EventTable.read(path, tablename='sngl_burst')
elif path.name.endswith('.root'):
Expand Down
10 changes: 10 additions & 0 deletions omicron/cli/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
"""
import time

from gwpy.segments import SegmentList, Segment

prog_start = time.time()
import argparse
import configparser
Expand Down Expand Up @@ -751,6 +754,13 @@ def main(args=None):
pad=statepad)
logger.info(f'Segment query took {time.time() - seg_qry_strt:.2f}s')

# Get segments from frame cache
elif args.cache_file:
cache = read_cache(str(args.cache_file))
cache_segs = segments.cache_segments(cache)
srch_span = SegmentList([Segment(datastart, dataend)])
segs = cache_segs & srch_span

# get segments from frame availability
else:
segs = segments.get_frame_segments(ifo, frametype, datastart, dataend)
Expand Down

0 comments on commit 3798f20

Please sign in to comment.