Skip to content

Commit

Permalink
gw_summary: cleaned up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmmacleod committed Mar 19, 2019
1 parent a947987 commit 92318a2
Showing 1 changed file with 32 additions and 22 deletions.
54 changes: 32 additions & 22 deletions bin/gw_summary
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ from glue.lal import LIGOTimeGPS
time.LIGOTimeGPS = LIGOTimeGPS
_tconvert.LIGOTimeGPS = LIGOTimeGPS

import os
import datetime
import argparse
import calendar
import datetime
import getpass
import os
import re
import warnings
import httplib
import importlib

from collections import OrderedDict
from urlparse import urlparse
try:
from urllib.parse import urlparse
except ImportError: # python < 3
from urlparse import urlparse

from dateutil.relativedelta import relativedelta

Expand All @@ -59,25 +60,36 @@ use('Agg')

from glue.lal import Cache

try:
from lal import lal
except ImportError:
HASLAL = False
else:
HASLAL = True

from gwpy.detector import Channel
from gwpy.segments import (Segment, SegmentList)
from gwpy.signal.fft import lal as fft_lal
from gwpy.time import (tconvert, to_gps, Time)

from gwsumm import (globalv, mode, __version__)
from gwsumm.config import *
from gwsumm.channels import get_channels
from gwsumm import (
__version__,
archive,
globalv,
mode,
)
from gwsumm.config import (
DEFAULTSECT,
GWSummConfigParser,
NoOptionError,
NoSectionError,
)
from gwsumm.segments import get_segments
from gwsumm.tabs import (TabList, get_tab)
from gwsumm.utils import *
from gwsumm.state import *
from gwsumm.state import (
ALLSTATE
)
from gwsumm.tabs import (
TabList,
get_tab,
)
from gwsumm.utils import (
get_default_ifo,
mkdir,
re_flagdiv,
vprint,
)
from gwsumm.data import get_timeseries_dict

__author__ = 'Duncan Macleod <duncan.macleod@ligo.org>'
Expand Down Expand Up @@ -517,7 +529,6 @@ elif opts.archive is True:
archives = []

if opts.archive:
from gwsumm import archive
archivedir = os.path.join(path, 'archive')
mkdir(archivedir)
opts.archive = os.path.join(archivedir, '%s-%s-%d-%d.h5'
Expand All @@ -532,7 +543,6 @@ if opts.archive:
# read daily archive for week/month/... mode
if hasattr(opts, 'daily_archive') and opts.daily_archive:
# find daily archive files
from gwsumm import archive
archives.extend(archive.find_daily_archives(
opts.gpsstart, opts.gpsend, ifo, args.daily_archive, archivedir))
# then don't read any actual data
Expand Down

0 comments on commit 92318a2

Please sign in to comment.