• ← raven_query
  • raven_coinc_far →

raven_search¶

#!/usr/bin/env python
#
# Project Librarian: Brandon Piotrzkowski
#              Graduate Student
#              UW-Milwaukee Department of Physics
#              Center for Gravitation & Cosmology
#              <brandon.piotrzkowski@ligo.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

"""
Script to query GraceDB looking for a possible coincidence, using the time window
and searching for a candidate with the properties given. If a coincidence is found
then uploads a message to GraceDB.
"""

__author__ = "Brandon Piotrzkowski <brandon.piotrzkowski@ligo.org>"



# Global imports.
import numpy as np
from ligo.raven import search
from ligo.gracedb.rest import GraceDb

import argparse


# Command line options.
parser = argparse.ArgumentParser(description='Perform query of GraceDB and upload log message')
parser.add_argument("-i", "--graceid", metavar="(S,E,MS,M)XXXXXX",
                    default=None,
                    help="GraceDB ID of event querying on (required)")
parser.add_argument("-w", "--window", nargs=2, metavar="t", type=int,
                    action="append", default=None,
                    help="Time window [tl, th] seconds to search around event time (required with th > th)"),
parser.add_argument("-u", "--gracedb_url", metavar="https://gracedb.ligo.org/api/",
                    default="https://gracedb.ligo.org/api/",
                    help="Gracedb url"),
parser.add_argument("-g", "--group", metavar="CBC or Burst", default=None,
                    help="Group of GW event searching for."),
parser.add_argument("-p", "--pipelines", nargs='+', metavar="Fermi Swift AGILE INTEGRAL",
                    default=None,
                    help="Pipelines of external event searching for."),
parser.add_argument("-s", "--searches", nargs='+', metavar="GRB SubGRB SubGRBTargeted MDC",
                    default=None,
                    help="Searches of external event searching for.")
parser.add_argument("-S", "--se_searches", nargs='+', metavar="AllSky BBH IMBH MDC",
                    default=None,
                    help="Searches of superevent searching for.")
args = parser.parse_args()
print(args)


# Check required options are there
if not args.graceid:
    raise AssertionError('gracedb id not given')
else:
    graceid = str(args.graceid)

if not args.window:
    raise AssertionError('search window not given')
else:
    tl, th = int(args.window[0][0]), int(args.window[0][1])


# Load other options
if args.gracedb_url:
    gracedb = GraceDb(str(args.gracedb_url))
else:
    gracedb = None

group = args.group

if args.pipelines:
    pipelines = args.pipelines
else:
    pipelines = []

if args.searches:
    searches = args.searches
else:
    searches = []

if args.se_searches:
    se_searches = args.se_searches
else:
    se_searches = []

results = search.search(graceid, tl, th, gracedb=gracedb, group=group,
                        pipelines=pipelines, searches=searches,
                        se_searches=se_searches)
print(results)
 
  • ← raven_query
  • raven_coinc_far →

Logo

ligo-raven

Low-latency coincidence search between external triggers and GW candidates

Navigation

Contents:

  • Quick start
  • Examples
  • API Reference
  • Command line scripts
    • raven_query
    • raven_search
    • raven_coinc_far
    • raven_calc_signif_gracedb
    • raven_skymap_overlap
  • Joint FAR calculation
  • Online search
  • Contributing
  • Deployment

Git:

  • Git repository
  • Changelog

Related Topics

  • Documentation overview
    • Command line scripts
      • Previous: raven_query
      • Next: raven_coinc_far

Quick search

©. | Powered by Sphinx 7.0.0 & Alabaster 0.7.13 | Page source