diff --git a/bin/geomag.py b/bin/geomag.py index 283de23d8165f49afa584f971ff0de959f22a60e..1e5ec9188301d3e9d1911053aafc3a24ac3de84c 100755 --- a/bin/geomag.py +++ b/bin/geomag.py @@ -14,10 +14,10 @@ except: import geomagio.iaga2002 as iaga2002 import geomagio.edge as edge import geomagio.pcdcp as pcdcp -from geomagio.Algorithm import Algorithm +from geomagio import Algorithm, \ + Controller from geomagio.XYZAlgorithm import XYZAlgorithm -from geomagio.Controller import Controller -from obspy.core.utcdatetime import UTCDateTime +from obspy.core import UTCDateTime def main(): @@ -229,7 +229,7 @@ def parse_args(): help='Requires Host IP # and Port #') output_group.add_argument('--output-edge', nargs=3, metavar=('HOST', 'PORT', 'TAG'), - help='Requires Host IP #, Port # and ID TAG ') + help='Requires Host IP #, Port # and ID TAG') # Algorithms group algorithm_group = parser.add_mutually_exclusive_group() diff --git a/geomagio/__init__.py b/geomagio/__init__.py index 1f6c5db88288c9f7c41e730b50c53918189da1b7..5a391cae18114d948c0c2d27ded6aed0f1c69342 100644 --- a/geomagio/__init__.py +++ b/geomagio/__init__.py @@ -1,16 +1,23 @@ """ Geomag Algorithm Module """ -from Algorithm import Algorithm import ChannelConverter import StreamConverter + +from Algorithm import Algorithm +from AlgorithmException import AlgorithmException +from Controller import Controller from TimeseriesFactory import TimeseriesFactory from TimeseriesFactoryException import TimeseriesFactoryException +from XYZAlgorithm import XYZAlgorithm __all__ = [ 'Algorithm', + 'AlgorithmException', 'ChannelConverter', + 'Controller', 'StreamConverter', 'TimeseriesFactory', - 'TimeseriesFactoryException' + 'TimeseriesFactoryException', + 'XYZAlgorithm' ] diff --git a/geomagio/edge/EdgeFactory.py b/geomagio/edge/EdgeFactory.py index 3b093451aeede675910e79ea182210a4a7762d13..3c1d72db155345a85ab3bd49ce989e3200f74b5a 100644 --- a/geomagio/edge/EdgeFactory.py +++ b/geomagio/edge/EdgeFactory.py @@ -9,16 +9,17 @@ to take advantage of it's newer realtime abilities. Edge is the USGS earthquake hazard centers replacement for earthworm. """ -import obspy.core -from obspy.core.utcdatetime import UTCDateTime import numpy -from RawInputClient import RawInputClient -from geomagio import TimeseriesFactory, TimeseriesFactoryException -from geomagio import ChannelConverter +import numpy.ma +import obspy.core +from datetime import datetime from obspy import earthworm +from obspy.core import UTCDateTime +from geomagio import ChannelConverter, \ + TimeseriesFactory, \ + TimeseriesFactoryException from ObservatoryMetadata import ObservatoryMetadata -from datetime import datetime -import numpy.ma +from RawInputClient import RawInputClient class EdgeFactory(TimeseriesFactory): diff --git a/geomagio/edge/RawInputClient.py b/geomagio/edge/RawInputClient.py index e583c717e9a62bd8b911b4ba30812d54db366b36..e41206315c7c0c5e0e13fd677c7a41cc24f4123a 100644 --- a/geomagio/edge/RawInputClient.py +++ b/geomagio/edge/RawInputClient.py @@ -1,22 +1,13 @@ -# -*- coding: utf-8 -*- -""" -Input Client for Edge/CWB/QueryMom. - -:copyright: - USGS -:license: - GNU General Public License (GPLv2) - (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) -""" -from obspy.core.utcdatetime import UTCDateTime -from datetime import datetime -from geomagio import TimeseriesFactoryException -import struct import socket # noqa +import struct import sys +from datetime import datetime +from geomagio import TimeseriesFactoryException +from obspy.core import UTCDateTime from time import sleep + """ MAXINPUTSIZE: Edge uses a short for the data count, so the max input size for a single data packet to edge is 32767 diff --git a/geomagio/pcdcp/PCDCPFactory.py b/geomagio/pcdcp/PCDCPFactory.py index dbe71dea9cfa5631576d3ca27d21fbb29efd6441..e9fe5e8fa6b0a60ac715513e15b0209ded5cd6cc 100644 --- a/geomagio/pcdcp/PCDCPFactory.py +++ b/geomagio/pcdcp/PCDCPFactory.py @@ -1,12 +1,13 @@ """Factory that loads PCDCP Files.""" -import urllib2 import obspy.core import os -from geomagio import TimeseriesFactory, TimeseriesFactoryException +import urllib2 +from geomagio import ChannelConverter, \ + TimeseriesFactory, \ + TimeseriesFactoryException from PCDCPParser import PCDCPParser from PCDCPWriter import PCDCPWriter -from geomagio import ChannelConverter # pattern for pcdcp file names diff --git a/geomagio/pcdcp/PCDCPWriter.py b/geomagio/pcdcp/PCDCPWriter.py index 6c1ae0dc23da2c7019dad9d76e6801f42bb78be0..e26c29075ae4b3320619ac617ce5190babe4f767 100644 --- a/geomagio/pcdcp/PCDCPWriter.py +++ b/geomagio/pcdcp/PCDCPWriter.py @@ -1,10 +1,10 @@ -from cStringIO import StringIO -from geomagio import ChannelConverter import numpy -from obspy.core import Stream import PCDCPParser +from cStringIO import StringIO from datetime import datetime +from geomagio import ChannelConverter +from obspy.core import Stream class PCDCPWriter(object):