Skip to content

Commit

Permalink
migrate from ligo-segments to igwn-segments (#4999)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmmacleod authored Jan 7, 2025
1 parent bfdd804 commit 1e5f12f
Show file tree
Hide file tree
Showing 47 changed files with 109 additions and 110 deletions.
2 changes: 1 addition & 1 deletion bin/all_sky_search/pycbc_add_statmap
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
with more than one ifo combination available. Cluster to keep foreground
coincs with the highest stat value.
"""
import igwn_segments as segments
import numpy as np, argparse, logging, pycbc, pycbc.events, pycbc.io
import pycbc.version
import pycbc.conversions as conv
from pycbc.events import coinc, significance
from ligo import segments
import sys, copy

def get_ifo_string(fi):
Expand Down
2 changes: 1 addition & 1 deletion bin/all_sky_search/pycbc_bin_trigger_rates_dq
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import argparse
import numpy as np
import h5py as h5

from ligo.segments import segmentlist
from igwn_segments import segmentlist

import pycbc
from pycbc.events import stat as pystat
Expand Down
2 changes: 1 addition & 1 deletion bin/all_sky_search/pycbc_calculate_psd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ from pycbc.io import HFile
from pycbc.pool import BroadcastPool as Pool
from pycbc.fft.fftw import set_measure_level
from pycbc.workflow import resolve_td_option
from ligo.segments import segmentlist, segment
from igwn_segments import segmentlist, segment
set_measure_level(0)

parser = argparse.ArgumentParser(description=__doc__)
Expand Down
2 changes: 1 addition & 1 deletion bin/all_sky_search/pycbc_coinc_findtrigs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
import copy, argparse, logging, numpy, numpy.random
import shutil, uuid, os.path, atexit
from ligo.segments import infinity
from igwn_segments import infinity
import pycbc
from pycbc.events import veto, coinc, stat, ranking, cuts
from pycbc.io import HFile
Expand Down
2 changes: 1 addition & 1 deletion bin/all_sky_search/pycbc_coinc_hdfinjfind
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ files.

import argparse, logging, types, numpy, os.path
from ligo.lw import lsctables, utils as ligolw_utils
from ligo import segments
import igwn_segments as segments
import pycbc
from pycbc import events, init_logging
from pycbc.events import indices_within_segments
Expand Down
2 changes: 1 addition & 1 deletion bin/all_sky_search/pycbc_combine_statmap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ significant foreground, but leaves the background triggers alone.
"""

import numpy, argparse, logging, pycbc, pycbc.events, pycbc.io, lal
from ligo import segments
import igwn_segments as segments

parser = argparse.ArgumentParser()
pycbc.add_common_pycbc_options(parser)
Expand Down
2 changes: 1 addition & 1 deletion bin/all_sky_search/pycbc_prepare_xml_for_gracedb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import lal
import lal.series
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.segments import segment, segmentlist
from igwn_segments import segment, segmentlist

import pycbc
from pycbc.io import HFile
Expand Down
2 changes: 1 addition & 1 deletion bin/all_sky_search/pycbc_sngls_findtrigs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
import argparse, logging, h5py, numpy as np
from ligo.segments import infinity
from igwn_segments import infinity
from numpy.random import seed, shuffle

import pycbc
Expand Down
2 changes: 1 addition & 1 deletion bin/all_sky_search/pycbc_sngls_pastro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from ligo.lw import lsctables, utils as ligolw_utils
from pycbc import conversions as conv
from pycbc.events import veto, stat, ranking, coinc, single as sngl
from pycbc.io.ligolw import LIGOLWContentHandler
from ligo.segments import segment, segmentlist
from igwn_segments import segment, segmentlist
import matplotlib
matplotlib.use('agg')
from matplotlib import pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion bin/live/pycbc_live_collate_triggers
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import os
import logging
from datetime import datetime, timedelta

from ligo.segments import segmentlist, segment
from igwn_segments import segmentlist, segment

import pycbc
from pycbc.io import live as liveio
Expand Down
2 changes: 1 addition & 1 deletion bin/live/pycbc_live_combine_single_significance_fits
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import argparse
import logging
import numpy as np

from ligo.segments import segment, segmentlist
from igwn_segments import segment, segmentlist

import pycbc
from pycbc.io.hdf import HFile
Expand Down
2 changes: 1 addition & 1 deletion bin/minifollowups/pycbc_upload_prep_minifollowup
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import logging
import re
import numpy as np

from ligo import segments
import igwn_segments as segments

from pycbc import init_logging, add_common_pycbc_options
import pycbc.workflow as wf
Expand Down
2 changes: 1 addition & 1 deletion bin/plotting/pycbc_page_ifar
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import pylab
import matplotlib as mpl
mpl.use('Agg')

from ligo import segments
import igwn_segments as segments

from pycbc import init_logging, add_common_pycbc_options
import pycbc.results
Expand Down
2 changes: 1 addition & 1 deletion bin/plotting/pycbc_page_segtable
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import pycbc.results
import sys
import itertools

from ligo import segments
import igwn_segments as segments

from pycbc.events.veto import get_segment_definer_comments
from pycbc.results import save_fig_with_metadata
Expand Down
10 changes: 5 additions & 5 deletions bin/pycbc_gwosc_segment_query
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import argparse
import shutil
from urllib.request import urlopen

import ligo.segments
import igwn_segments

import pycbc
from pycbc.workflow import SegFile
Expand All @@ -31,9 +31,9 @@ def query_gwosc(ifo, segment_name, gps_start_time, duration):
Returns
---------
segment_list : ligo.segments.segmentlist
segment_list : igwn_segments.segmentlist
The interval returned by GWOSC
segment_summary : ligo.segments.segmentlist
segment_summary : igwn_segments.segmentlist
The segments returned by GWOSC
"""

Expand All @@ -44,11 +44,11 @@ def query_gwosc(ifo, segment_name, gps_start_time, duration):
logging.info(response.info())
json_segment_data = json.loads(response.read())

summary_segment = ligo.segments.segmentlist([ligo.segments.segment(
summary_segment = igwn_segments.segmentlist([igwn_segments.segment(
json_segment_data['start'],
json_segment_data['end'])])

segments = ligo.segments.segmentlist([ligo.segments.segment(
segments = igwn_segments.segmentlist([igwn_segments.segment(
x[0],x[1]) for x in json_segment_data['segments']])

return summary_segment, segments
Expand Down
2 changes: 1 addition & 1 deletion bin/pycbc_make_html_page
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import zipfile
import codecs
from jinja2 import Environment, FileSystemLoader

from ligo import segments
import igwn_segments as segments

import pycbc.results
from pycbc.results.render import get_embedded_config, render_workflow_html_template, setup_template_render
Expand Down
2 changes: 1 addition & 1 deletion bin/pycbc_upload_xml_to_gracedb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import lal
import lal.series
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.segments import segment, segmentlist
from igwn_segments import segment, segmentlist

import pycbc
from pycbc.io.gracedb import gracedb_tag_with_version
Expand Down
4 changes: 2 additions & 2 deletions bin/pygrb/pycbc_grb_inj_finder
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import h5py

from gwdatafind.utils import filename_metadata

from ligo.segments import segmentlist
from ligo.segments.utils import fromsegwizard
from igwn_segments import segmentlist
from igwn_segments.utils import fromsegwizard

from pycbc import add_common_pycbc_options, init_logging
from pycbc.inject import InjectionSet
Expand Down
4 changes: 2 additions & 2 deletions bin/pygrb/pycbc_grb_trig_combiner
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import h5py

from gwdatafind.utils import (file_segment, filename_metadata)

from ligo import segments
from ligo.segments.utils import fromsegwizard
import igwn_segments as segments
from igwn_segments.utils import fromsegwizard

from pycbc import add_common_pycbc_options, init_logging
from pycbc.results.pygrb_postprocessing_utils import template_hash_to_id
Expand Down
2 changes: 1 addition & 1 deletion bin/pygrb/pycbc_make_offline_grb_workflow
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import logging
import matplotlib
matplotlib.use('agg')

from ligo.segments import segment, segmentlistdict
from igwn_segments import segment, segmentlistdict

from pycbc import init_logging, add_common_pycbc_options
import pycbc.workflow as _workflow
Expand Down
2 changes: 1 addition & 1 deletion bin/workflows/pycbc_make_bank_verifier_workflow
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import os
import argparse
import shutil

from ligo import segments
import igwn_segments as segments

from pycbc import add_common_pycbc_options, init_logging
import pycbc.version
Expand Down
2 changes: 1 addition & 1 deletion bin/workflows/pycbc_make_inference_plots_workflow
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import sys
import shlex
import numpy

from ligo import segments
import igwn_segments as segments

from pycbc import results, init_logging, add_common_pycbc_options
from pycbc.results import layout
Expand Down
2 changes: 1 addition & 1 deletion bin/workflows/pycbc_make_inference_workflow
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import socket
import sys
import numpy

from ligo import segments
import igwn_segments as segments

import pycbc
import pycbc.workflow.minifollowups as mini
Expand Down
2 changes: 1 addition & 1 deletion bin/workflows/pycbc_make_offline_search_workflow
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import numpy
import datetime
import itertools

import igwn_segments as segments
import lal
from ligo import segments

import pycbc.events
import pycbc.workflow as wf
Expand Down
2 changes: 1 addition & 1 deletion bin/workflows/pycbc_make_psd_estimation_workflow
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import logging
import datetime
import sys

from ligo import segments as _segments
import igwn_segments as _segments
import lal

import pycbc
Expand Down
2 changes: 1 addition & 1 deletion docs/workflow/datafind.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Using this module requires a number of things

* A configuration file (or files) containing the information needed to tell this module how to generate the segments (described below).
* An initialized instance of the pycbc workflow class, containing the ConfigParser.
* An ifo-keyed dictionary of ligo.segments.segmentlist instances containing the times that should be analysed for each ifo. See :ref:`workflowsegmentsmod` for documentation of the segments module, which in most cases should be used to obtain this input.
* An ifo-keyed dictionary of igwn_segments.segmentlist instances containing the times that should be analysed for each ifo. See :ref:`workflowsegmentsmod` for documentation of the segments module, which in most cases should be used to obtain this input.

-------------------------
Configuration file setup
Expand Down
2 changes: 1 addition & 1 deletion examples/workflow/dayhopecheck/dayhopecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import os
import logging
import argparse
from ligo import segments
import igwn_segments as segments
import pycbc.workflow as _workflow

from ligo.lw import ligolw
Expand Down
6 changes: 3 additions & 3 deletions pycbc/dq.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import logging
import json
import numpy
from ligo.segments import segmentlist, segment
from igwn_segments import segmentlist, segment
from pycbc.frame.gwosc import get_run
from pycbc.io import get_file

Expand Down Expand Up @@ -152,7 +152,7 @@ def query_flag(ifo, segment_name, start_time, end_time,
Returns
---------
segments: ligo.segments.segmentlist
segments: igwn_segments.segmentlist
List of segments
"""
flag_segments = segmentlist([])
Expand Down Expand Up @@ -279,7 +279,7 @@ def query_cumulative_flags(ifo, segment_names, start_time, end_time,
Returns
---------
segments: ligo.segments.segmentlist
segments: igwn_segments.segmentlist
List of segments
"""
total_segs = segmentlist([])
Expand Down
2 changes: 1 addition & 1 deletion pycbc/events/veto.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""
import logging
import numpy
from igwn_segments import segment, segmentlist
from ligo.lw import table, lsctables, utils as ligolw_utils
from ligo.segments import segment, segmentlist

logger = logging.getLogger('pycbc.events.veto')

Expand Down
2 changes: 1 addition & 1 deletion pycbc/psd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import copy
from ligo import segments
import igwn_segments as segments
from pycbc.psd.read import *
from pycbc.psd.analytical import *
from pycbc.psd.analytical_space import *
Expand Down
2 changes: 1 addition & 1 deletion pycbc/results/followup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
if 'matplotlib.backends' not in sys.modules:
matplotlib.use('agg')
import pylab, mpld3, mpld3.plugins
from ligo.segments import segment
from igwn_segments import segment
from pycbc.io.hdf import HFile

def columns_from_file_list(file_list, columns, ifo, start, end):
Expand Down
2 changes: 1 addition & 1 deletion pycbc/results/pygrb_plotting_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import copy
import numpy
from ligo import segments
import igwn_segments as segments
from pycbc.results import save_fig_with_metadata


Expand Down
4 changes: 2 additions & 2 deletions pycbc/results/pygrb_postprocessing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
import copy
import numpy
import h5py
import igwn_segments as segments

from scipy import stats
from ligo import segments
from ligo.segments.utils import fromsegwizard
from igwn_segments.utils import fromsegwizard
from pycbc.events.coherent import reweightedsnr_cut
from pycbc.events import veto
from pycbc import add_common_pycbc_options
Expand Down
2 changes: 1 addition & 1 deletion pycbc/workflow/coincidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import os
import logging

from ligo import segments
import igwn_segments as segments

from pycbc.workflow.core import FileList, make_analysis_dir, Executable, Node, File

Expand Down
Loading

0 comments on commit 1e5f12f

Please sign in to comment.