コード例 #1
0
    parser.add_argument(
        '-j', '--jobs', type=int, default=1, const=None, nargs='?',
        help='Number of threads [default: %(default)s]')
    parser.add_argument(
        '-p', '--contour', default=[], nargs='+', type=float, metavar='PERCENT',
        help='Report the area of the smallest contour and the number of modes '
        'containing this much probability.')
    parser.add_argument(
        '-a', '--area', default=[], nargs='+', type=float, metavar='DEG2',
        help='Report the largest probability contained within any region '
        'of this area in square degrees. Can be repeated multiple times.')
    parser.add_argument(
        '--modes', default=False, action='store_true',
        help='Compute number of disjoint modes [default: %(default)s]')
    parser.add_argument(
        'db', type=command.SQLiteType('r'), metavar='DB.sqlite',
        help='Input SQLite database from search pipeline')
    parser.add_argument(
        'fitsfilenames', metavar='GLOB.fits[.gz]', nargs='+', action='glob',
        help='Input FITS filenames and/or globs')
    opts = parser.parse_args()


# Imports.
import sqlite3
from lalinference.io import fits
from lalinference.bayestar import distance, postprocess


def startup(dbfilename, opts_contour, opts_modes, opts_area):
    global db, contours, modes, areas
    parser.add_argument(
        '-a',
        '--area',
        default=[],
        nargs='+',
        type=float,
        metavar='DEG2',
        help='Report the largest probability contained within any region '
        'of this area in square degrees. Can be repeated multiple times.')
    parser.add_argument(
        '--modes',
        default=False,
        action='store_true',
        help='Compute number of disjoint modes [default: %(default)s]')
    parser.add_argument('db',
                        type=command.SQLiteType('r'),
                        metavar='DB.sqlite',
                        help='Input SQLite database from search pipeline')
    parser.add_argument('fitsfilenames',
                        metavar='GLOB.fits[.gz]',
                        nargs='+',
                        action='glob',
                        help='Input FITS filenames and/or globs')
    opts = parser.parse_args()

# Imports.
import sqlite3
import numpy as np
from lalinference.io import fits
from lalinference.bayestar.postprocess import find_injection_moc
コード例 #3
0
parser.add_argument(
    '--annotate', default=False, action='store_true',
    help='annotate plot with information about the event')
parser.add_argument(
    '--contour', metavar='PERCENT', type=float, nargs='+',
    help='plot contour enclosing this percentage of'
    ' probability mass [may be specified multiple times, default: none]')
parser.add_argument(
    '--colorbar', default=False, action='store_true',
    help='Show colorbar [default: %(default)s]')
parser.add_argument(
    '--radec', nargs=2, metavar='deg', type=float, action='append',
    default=[], help='right ascension (deg) and declination (deg) to mark'
    ' [may be specified multiple times, default: none]')
parser.add_argument(
    '--inj-database', metavar='FILE.sqlite', type=command.SQLiteType('r'),
    help='read injection positions from database [default: none]')
parser.add_argument(
    '--geo', action='store_true', default=False,
    help='Plot in geographic coordinates, (lat, lon) instead of (RA, Dec)'
    ' [default: %(default)s]')
parser.add_argument(
    'input', metavar='INPUT.fits[.gz]', type=argparse.FileType('rb'),
    default='-', nargs='?', help='Input FITS file [default: stdin]')
opts = parser.parse_args()

# Late imports

import os
import json
import numpy as np