diff --git a/bin/plotting/pycbc_banksim_plot_eff_fitting_factor b/bin/plotting/pycbc_banksim_plot_eff_fitting_factor index 4e1d5abc5c2..3d7e8cb8d6c 100644 --- a/bin/plotting/pycbc_banksim_plot_eff_fitting_factor +++ b/bin/plotting/pycbc_banksim_plot_eff_fitting_factor @@ -22,7 +22,6 @@ point-source files. import sys import numpy import argparse -import logging import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt diff --git a/bin/plotting/pycbc_banksim_plot_fitting_factors b/bin/plotting/pycbc_banksim_plot_fitting_factors index 49d78839d2f..e071ecd30a4 100644 --- a/bin/plotting/pycbc_banksim_plot_fitting_factors +++ b/bin/plotting/pycbc_banksim_plot_fitting_factors @@ -20,7 +20,6 @@ import sys import argparse import numpy -import logging import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt diff --git a/bin/plotting/pycbc_banksim_table_point_injs b/bin/plotting/pycbc_banksim_table_point_injs index d91957aac7a..5d6ec5192b5 100644 --- a/bin/plotting/pycbc_banksim_table_point_injs +++ b/bin/plotting/pycbc_banksim_table_point_injs @@ -20,7 +20,6 @@ import sys import argparse import numpy -import logging import pycbc.version from pycbc import results diff --git a/bin/plotting/pycbc_faithsim_plots b/bin/plotting/pycbc_faithsim_plots index 4d692e1f0e8..fbb7ab8069b 100755 --- a/bin/plotting/pycbc_faithsim_plots +++ b/bin/plotting/pycbc_faithsim_plots @@ -9,13 +9,11 @@ import argparse import matplotlib matplotlib.use("Agg") import matplotlib.cm -from matplotlib.ticker import MultipleLocator, FormatStrFormatter +from matplotlib.ticker import MultipleLocator import pylab import numpy as np -from ligo.lw import utils, table, lsctables - -from pycbc import pnutils, init_logging, add_common_pycbc_options +from pycbc import init_logging, add_common_pycbc_options from pycbc.conversions import ( mtotal_from_mass1_mass2, q_from_mass1_mass2, diff --git a/bin/plotting/pycbc_page_banktriggerrate b/bin/plotting/pycbc_page_banktriggerrate index e0639bcb20d..b457437870c 100644 --- a/bin/plotting/pycbc_page_banktriggerrate +++ b/bin/plotting/pycbc_page_banktriggerrate @@ -3,7 +3,7 @@ """ import matplotlib matplotlib.use('Agg') -import numpy, argparse, os, pylab, pycbc.pnutils +import numpy, argparse, pylab, pycbc.pnutils from pycbc.io.hdf import HFile from pycbc import init_logging, add_common_pycbc_options diff --git a/bin/plotting/pycbc_page_foundmissed b/bin/plotting/pycbc_page_foundmissed index f45c959553e..f1d16519641 100644 --- a/bin/plotting/pycbc_page_foundmissed +++ b/bin/plotting/pycbc_page_foundmissed @@ -3,7 +3,6 @@ """ import numpy import logging -import os.path import argparse import sys import matplotlib @@ -12,7 +11,6 @@ import matplotlib.pyplot as plot import pycbc.results.followup, pycbc.pnutils, pycbc.results import pycbc.pnutils -from pycbc import init_logging, add_common_pycbc_options from pycbc.detector import Detector from pycbc.io.hdf import HFile @@ -66,7 +64,7 @@ parser.add_argument('--missed-on-top', action='store_true', "high FAR on top of low FAR") args = parser.parse_args() -init_logging(args.verbose) +pycbc.init_logging(args.verbose) logging.info('Read in the data') f = HFile(args.injection_file, 'r') diff --git a/bin/plotting/pycbc_page_ifar b/bin/plotting/pycbc_page_ifar index 9d95b27c227..9fcc7d459ee 100644 --- a/bin/plotting/pycbc_page_ifar +++ b/bin/plotting/pycbc_page_ifar @@ -23,8 +23,6 @@ import pylab import matplotlib as mpl mpl.use('Agg') -import igwn_segments as segments - from pycbc import init_logging, add_common_pycbc_options import pycbc.results from pycbc.events import veto diff --git a/bin/plotting/pycbc_page_recovery b/bin/plotting/pycbc_page_recovery index 2bc5ed05ace..f960f325e88 100644 --- a/bin/plotting/pycbc_page_recovery +++ b/bin/plotting/pycbc_page_recovery @@ -6,7 +6,7 @@ matplotlib.use("Agg") import matplotlib.pyplot as plot import pycbc.detector -from pycbc import pnutils, results +from pycbc import results from pycbc.events import triggers from pycbc.io.hdf import HFile diff --git a/bin/plotting/pycbc_page_segplot b/bin/plotting/pycbc_page_segplot index dd595a558b8..9809e50781b 100644 --- a/bin/plotting/pycbc_page_segplot +++ b/bin/plotting/pycbc_page_segplot @@ -20,15 +20,12 @@ import argparse import matplotlib; matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy, pylab, pycbc.events, mpld3, mpld3.plugins -import itertools, datetime, time import sys from itertools import cycle -from matplotlib.patches import Rectangle from pycbc import add_common_pycbc_options, init_logging from pycbc.events.veto import get_segment_definer_comments -from pycbc.results.color import ifo_color -from pycbc.results.mpld3_utils import MPLSlide, LineTooltip +from pycbc.results.mpld3_utils import LineTooltip from pycbc.workflow import SegFile # parse command line diff --git a/bin/plotting/pycbc_page_segtable b/bin/plotting/pycbc_page_segtable index e955b42cc85..4819c483886 100644 --- a/bin/plotting/pycbc_page_segtable +++ b/bin/plotting/pycbc_page_segtable @@ -17,7 +17,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import argparse -import logging import numpy import pycbc.results import sys diff --git a/bin/plotting/pycbc_page_snrchi b/bin/plotting/pycbc_page_snrchi index af7956ac1fb..ee775b34dfc 100644 --- a/bin/plotting/pycbc_page_snrchi +++ b/bin/plotting/pycbc_page_snrchi @@ -1,7 +1,6 @@ #!/usr/bin/env python import logging import numpy -import h5py import argparse import matplotlib import sys @@ -9,7 +8,6 @@ matplotlib.use('Agg') import pylab import pycbc.results -from pycbc.events import veto from pycbc.io import ( get_chisq_from_file_choice, chisq_choices, SingleDetTriggers, HFile ) diff --git a/bin/plotting/pycbc_page_snrifar b/bin/plotting/pycbc_page_snrifar index 26689724300..73264f7bd9c 100644 --- a/bin/plotting/pycbc_page_snrifar +++ b/bin/plotting/pycbc_page_snrifar @@ -3,7 +3,7 @@ ranking statistic, or make statistical significance vs ranking statistic cumulative histograms. """ -import argparse, h5py, numpy, logging, sys +import argparse, numpy, logging, sys import matplotlib matplotlib.use('Agg') import pylab diff --git a/bin/plotting/pycbc_page_versioning b/bin/plotting/pycbc_page_versioning index b05ef9ef37e..2bb083437b0 100755 --- a/bin/plotting/pycbc_page_versioning +++ b/bin/plotting/pycbc_page_versioning @@ -10,7 +10,6 @@ import argparse import logging import pycbc -from pycbc import init_logging, add_common_pycbc_options from pycbc.results import (save_fig_with_metadata, html_escape, get_library_version_info, get_code_version_numbers) @@ -26,7 +25,7 @@ parser.add_argument("--output-file", required=True, help="The directory for output html snippets") args = parser.parse_args() -init_logging(args.verbose) +pycbc.init_logging(args.verbose) if not len(args.executables) == len(args.executables_names): raise parser.error("--executables-files and executables-names must be " diff --git a/bin/plotting/pycbc_plot_background_coincs b/bin/plotting/pycbc_plot_background_coincs index 056315ef781..57c78d65d78 100644 --- a/bin/plotting/pycbc_plot_background_coincs +++ b/bin/plotting/pycbc_plot_background_coincs @@ -1,7 +1,6 @@ #!/usr/bin/env python """ Plot PyCBC's background coinc triggers """ -import numpy import argparse import matplotlib matplotlib.use('Agg') diff --git a/bin/plotting/pycbc_plot_bank_corner b/bin/plotting/pycbc_plot_bank_corner index 6d55b2fbcab..37d6e9db3b5 100644 --- a/bin/plotting/pycbc_plot_bank_corner +++ b/bin/plotting/pycbc_plot_bank_corner @@ -33,7 +33,6 @@ from pycbc.results.plot import (add_style_opt_to_parser, set_style_from_cli) from pycbc.io import FieldArray, HFile from pycbc.inference import option_utils from pycbc.tmpltbank import bank_conversions as bconv -from pycbc.pnutils import get_imr_duration from pycbc.results.scatter_histograms import create_multidim_plot from pycbc.results import metadata diff --git a/bin/plotting/pycbc_plot_dq_likelihood_vs_time b/bin/plotting/pycbc_plot_dq_likelihood_vs_time index aa0c52f4022..803bed718ad 100644 --- a/bin/plotting/pycbc_plot_dq_likelihood_vs_time +++ b/bin/plotting/pycbc_plot_dq_likelihood_vs_time @@ -1,7 +1,6 @@ #!/usr/bin/env python """Plot the DQ log likelihood versus time for a specific background bin """ -import logging import sys import argparse import numpy diff --git a/bin/plotting/pycbc_plot_dq_percentiles b/bin/plotting/pycbc_plot_dq_percentiles index e8c6c29f40e..845cfc91fe7 100644 --- a/bin/plotting/pycbc_plot_dq_percentiles +++ b/bin/plotting/pycbc_plot_dq_percentiles @@ -1,7 +1,6 @@ #!/usr/bin/env python """ Plot the log likelihood percentiles for a DQ bin """ -import logging import sys import argparse import numpy diff --git a/bin/plotting/pycbc_plot_gating b/bin/plotting/pycbc_plot_gating index d75e877b4fc..3fef74d0c00 100644 --- a/bin/plotting/pycbc_plot_gating +++ b/bin/plotting/pycbc_plot_gating @@ -14,7 +14,6 @@ import mpld3.plugins import pycbc from pycbc.results.color import ifo_color -from pycbc.results.mpld3_utils import MPLSlide from pycbc.io.hdf import HFile diff --git a/bin/plotting/pycbc_plot_hist b/bin/plotting/pycbc_plot_hist index 04ae7eba99e..3b5ce12f917 100644 --- a/bin/plotting/pycbc_plot_hist +++ b/bin/plotting/pycbc_plot_hist @@ -4,7 +4,6 @@ import numpy import argparse -import logging import sys from itertools import cycle from matplotlib import use @@ -14,7 +13,7 @@ from matplotlib import pyplot import pycbc import pycbc.results import pycbc.io -from pycbc.events import background_bin_from_string, veto, ranking +from pycbc.events import background_bin_from_string, ranking parser = argparse.ArgumentParser(description=__doc__) pycbc.add_common_pycbc_options(parser) diff --git a/bin/plotting/pycbc_plot_qscan b/bin/plotting/pycbc_plot_qscan index e8bfae143d0..105bca313a9 100644 --- a/bin/plotting/pycbc_plot_qscan +++ b/bin/plotting/pycbc_plot_qscan @@ -25,8 +25,6 @@ information on the Q-transform and its parameters. import sys import argparse -import logging -import numpy import matplotlib matplotlib.use('Agg') diff --git a/bin/plotting/pycbc_plot_singles_vs_params b/bin/plotting/pycbc_plot_singles_vs_params index 98def36df48..cb995689ace 100644 --- a/bin/plotting/pycbc_plot_singles_vs_params +++ b/bin/plotting/pycbc_plot_singles_vs_params @@ -28,7 +28,6 @@ matplotlib.use('agg') import pylab as pl from matplotlib.colors import LogNorm from matplotlib.ticker import LogLocator -import h5py import sys from packaging.version import Version diff --git a/bin/plotting/pycbc_plot_throughput b/bin/plotting/pycbc_plot_throughput index 252b09ef9bd..892d4a03238 100755 --- a/bin/plotting/pycbc_plot_throughput +++ b/bin/plotting/pycbc_plot_throughput @@ -1,8 +1,6 @@ #!/usr/bin/env python import argparse -import logging -import numpy as np import matplotlib matplotlib.use('Agg') import pylab as pl diff --git a/bin/plotting/pycbc_plot_trigrate b/bin/plotting/pycbc_plot_trigrate index a0c538f2bae..12ce70bf7bb 100644 --- a/bin/plotting/pycbc_plot_trigrate +++ b/bin/plotting/pycbc_plot_trigrate @@ -19,7 +19,6 @@ import logging from matplotlib import use use('Agg') from matplotlib import pyplot as plt -import copy import numpy as np from scipy import stats as scistats diff --git a/bin/plotting/pycbc_plot_waveform b/bin/plotting/pycbc_plot_waveform index ff6aed5d507..25ca2caa298 100644 --- a/bin/plotting/pycbc_plot_waveform +++ b/bin/plotting/pycbc_plot_waveform @@ -18,18 +18,15 @@ """ # imports -import sys, argparse, matplotlib, numpy, math +import sys, argparse, matplotlib, numpy matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes -from mpl_toolkits.axes_grid1.inset_locator import mark_inset from pycbc import waveform, io from pycbc import results from pycbc import init_logging, add_common_pycbc_options -from pycbc.fft import ifft -from pycbc.types import complex_same_precision_as -from pycbc.types import TimeSeries, zeros, complex64 +from pycbc.types import zeros, complex64 parser = argparse.ArgumentParser(usage='', description=__doc__) add_common_pycbc_options(parser) @@ -157,8 +154,6 @@ if tmplt_length > 1.: x_zoom_fac*template_td.sample_times.max()]) axins.get_xaxis().set_ticks([]) axins.get_yaxis().set_ticks([]) - # Can't get this to work for what I'm doing :-( - #mark_inset(ax, axins, loc1=1, loc2=3, fc="none", ec="0.5") plt.subplot(2,1,2) plt.plot(template.sample_frequencies, abs(template))