Skip to content

Commit

Permalink
codes in bin
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Jan 8, 2025
1 parent ec7e3b0 commit 3c8a089
Show file tree
Hide file tree
Showing 19 changed files with 15 additions and 44 deletions.
4 changes: 1 addition & 3 deletions bin/pycbc_banksim_combine_banks
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ files. It is assumed that input files have analysed the same set of injections.
Concatenation of injections is done separately.
"""

from os.path import isfile
import argparse
import logging
from numpy import *
from numpy import dtype, array

import pycbc

Expand Down
9 changes: 4 additions & 5 deletions bin/pycbc_banksim_skymax
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,23 @@
"""Calculate the fitting factors of simulated signals with a template bank."""


import sys
import logging
from numpy import complex64, float32, sqrt, argmax, real, array
from numpy import complex64, sqrt, argmax, real, array
from argparse import ArgumentParser
from math import ceil, log
from tqdm import tqdm

from ligo.lw import utils as ligolw_utils
from ligo.lw import lsctables

from pycbc.pnutils import mass1_mass2_to_mchirp_eta, f_SchwarzISCO
from pycbc.pnutils import mass1_mass2_to_mchirp_eta
from pycbc.pnutils import nearest_larger_binary_number
from pycbc.pnutils import mass1_mass2_to_tau0_tau3
from pycbc.waveform import get_td_waveform, get_fd_waveform, td_approximants, fd_approximants
from pycbc.waveform.utils import taper_timeseries
from pycbc import DYN_RANGE_FAC
from pycbc.types import FrequencySeries, TimeSeries, zeros, real_same_precision_as, complex_same_precision_as
from pycbc.filter import match, sigmasq, resample_to_delta_t
from pycbc.types import FrequencySeries, TimeSeries, zeros, complex_same_precision_as
from pycbc.filter import sigmasq
from pycbc.filter import overlap_cplx, matched_filter
from pycbc.filter import compute_max_snr_over_sky_loc_stat
from pycbc.filter import compute_max_snr_over_sky_loc_stat_no_phase
Expand Down
5 changes: 0 additions & 5 deletions bin/pycbc_compress_bank
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,12 @@ hdf file."""

import argparse
import numpy
import h5py
import logging

import pycbc
from pycbc import psd, DYN_RANGE_FAC
from pycbc.waveform import compress
from pycbc import waveform
from pycbc.types import FrequencySeries, real_same_precision_as
from pycbc import pnutils
from pycbc import filter


parser = argparse.ArgumentParser(description=__description__)
pycbc.add_common_pycbc_options(parser)
Expand Down
3 changes: 1 addition & 2 deletions bin/pycbc_convertinjfiletohdf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import numpy
import shutil

import pycbc
from pycbc.inject import InjectionSet, CBCHDFInjectionSet
from pycbc.types import float64, float32
from pycbc.inject import CBCHDFInjectionSet
from pycbc.io.record import FieldArray
from pycbc.io.hdf import HFile

Expand Down
3 changes: 0 additions & 3 deletions bin/pycbc_create_injections
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,13 @@ import sys
import argparse
import logging
import numpy
import h5py
from numpy.random import uniform

import pycbc
from pycbc.inject import InjectionSet
from pycbc import distributions
from pycbc import transforms
from pycbc.distributions import JointDistribution
from pycbc.io import record
from pycbc.waveform import parameters
from pycbc.workflow import configuration
from pycbc.workflow import WorkflowConfigParser

Expand Down
1 change: 0 additions & 1 deletion bin/pycbc_data_store
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""
import logging
import argparse
import numpy

import pycbc
import pycbc.strain
Expand Down
2 changes: 1 addition & 1 deletion bin/pycbc_faithsim_collect_results
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ computing the match between them and creating a .dat file with the results.
import argparse
import numpy as np

from ligo.lw import utils, table, lsctables
from ligo.lw import utils, lsctables

from pycbc import add_common_pycbc_options, init_logging
from pycbc.io.ligolw import LIGOLWContentHandler
Expand Down
3 changes: 1 addition & 2 deletions bin/pycbc_get_ffinal
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ the duration of time domain waveforms.
__prog__ = 'pycbc_get_ffinal'
__author__ = 'Collin Capano <[email protected]>'

import os, sys
import sys
import numpy
import argparse

import pycbc
from pycbc import waveform

from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw import table
from ligo.lw.utils import process
Expand Down
2 changes: 0 additions & 2 deletions bin/pycbc_hdf5_splitbank
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ smaller banks where the number of smaller banks is a user input

import argparse
import numpy
import h5py
import logging
from numpy import random

Expand Down Expand Up @@ -92,7 +91,6 @@ if args.random_sort:
tmplt_bank.table = templates

if args.mchirp_sort:
from pycbc import pnutils
mcsort = numpy.argsort(templates.mchirp)
templates = templates[mcsort]
tmplt_bank.table = templates
Expand Down
5 changes: 2 additions & 3 deletions bin/pycbc_inspiral
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ import copy
import logging
import argparse
import numpy
import itertools
import time
from pycbc.pool import BroadcastPool as Pool

import pycbc
from pycbc import vetoes, psd, waveform, strain, scheme, fft, DYN_RANGE_FAC, events
from pycbc.vetoes.sgchisq import SingleDetSGChisq
from pycbc.filter import MatchedFilterControl, make_frequency_series, qtransform
from pycbc.types import TimeSeries, FrequencySeries, zeros, float32, complex64
from pycbc.filter import MatchedFilterControl, qtransform
from pycbc.types import zeros, float32, complex64
import pycbc.opt
import pycbc.inject

Expand Down
4 changes: 2 additions & 2 deletions bin/pycbc_inspiral_skymax
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import numpy
from pycbc import vetoes, psd, waveform, events, strain, scheme, fft
from pycbc.vetoes.sgchisq import SingleDetSGChisq
from pycbc import DYN_RANGE_FAC
from pycbc.filter import MatchedFilterSkyMaxControl, make_frequency_series, MatchedFilterSkyMaxControlNoPhase
from pycbc.types import TimeSeries, FrequencySeries, zeros, float32, complex64
from pycbc.filter import MatchedFilterSkyMaxControl, MatchedFilterSkyMaxControlNoPhase
from pycbc.types import zeros, float32, complex64
import pycbc.fft.fftw
import pycbc.opt

Expand Down
4 changes: 1 addition & 3 deletions bin/pycbc_live
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ launched with mpirun.
See https://arxiv.org/abs/1805.11174 for an overview."""

import sys
import argparse, numpy, pycbc, logging, cProfile, h5py, lal, json
import argparse, numpy, pycbc, logging, cProfile, h5py, json
import os.path
import itertools
import platform
import subprocess
import multiprocessing
from multiprocessing.dummy import threading
from matplotlib import use
use('agg')
Expand Down Expand Up @@ -43,7 +42,6 @@ from pycbc.detector import ppdets
from pycbc.filter import resample
from pycbc.psd import estimate
from pycbc.psd import variation
from pycbc.live import snr_optimizer
from pycbc import conversions as conv

# Use cached class-based FFTs in the resample and estimate module
Expand Down
1 change: 0 additions & 1 deletion bin/pycbc_make_faithsim
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def mkdir(dir_name):
pass

def matches_in_list(slist, match):
import re
matches = []
for st in slist:
if st.startswith(match):
Expand Down
4 changes: 0 additions & 4 deletions bin/pycbc_make_html_page
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@
import argparse
import os
import stat
import random
import shutil
import zipfile
import codecs
from jinja2 import Environment, FileSystemLoader

import igwn_segments as segments

import pycbc.results
from pycbc.results.render import get_embedded_config, render_workflow_html_template, setup_template_render
from pycbc.workflow import segment

def examine_dir(cwd):
"""
Expand Down
5 changes: 2 additions & 3 deletions bin/pycbc_make_skymap
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ from matplotlib import use as mpl_use_backend
mpl_use_backend('agg')

import numpy as np
import h5py

from ligo.gracedb.rest import GraceDb

import pycbc
from pycbc.filter import sigmasq
from pycbc.io import gracedb as pycbc_gracedb, WaveformArray
from pycbc.types import (TimeSeries, FrequencySeries, load_timeseries,
from pycbc.types import (load_timeseries,
load_frequencyseries, MultiDetMultiColonOptionAction,
MultiDetOptionAction, MultiDetOptionAppendAction)
from pycbc.pnutils import nearest_larger_binary_number
Expand Down Expand Up @@ -605,4 +604,4 @@ if __name__ == '__main__':
segment_source=opt.segment_source, segment_server=opt.segment_server,
veto_definer=opt.veto_definer, injection_file=opt.injection_file,
fake_strain=opt.fake_strain, fake_strain_from_file=opt.fake_strain_from_file, fake_strain_seed=opt.fake_strain_seed,
rescale_loglikelihood=opt.rescale_loglikelihood)
rescale_loglikelihood=opt.rescale_loglikelihood)
1 change: 0 additions & 1 deletion bin/pycbc_merge_inj_hdf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Merge hdf injection files
import logging
import argparse
import numpy as np
import h5py

import pycbc
import pycbc.inject
Expand Down
1 change: 0 additions & 1 deletion bin/pycbc_multi_inspiral
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ from pycbc import (
add_common_pycbc_options,
)
from pycbc.events import ranking, coherent as coh, EventManagerCoherent
from pycbc.io.hdf import HFile
from pycbc.filter import MatchedFilterControl
from pycbc.types import zeros, float32, complex64, angle_as_radians
from pycbc.vetoes import sgchisq
Expand Down
1 change: 0 additions & 1 deletion bin/pycbc_randomize_inj_dist_by_optsnr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ from argparse import ArgumentParser

from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw import table

import pycbc
from pycbc.io.ligolw import LIGOLWContentHandler
Expand Down
1 change: 0 additions & 1 deletion bin/pycbc_source_probability_offline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Compute source probabilities using mchirp estimation method for all events
in a chunk with an IFAR above certain threshold.
"""
import h5py
import json
import tqdm
import argparse
Expand Down

0 comments on commit 3c8a089

Please sign in to comment.