diff --git a/bin/geomag.py b/bin/geomag.py index 2c327e49f1d758a68f8dc8ae83579f7af5256a7b..b47039a577a6bcde6f725cff6d720533e91b338d 100755 --- a/bin/geomag.py +++ b/bin/geomag.py @@ -17,9 +17,6 @@ from geomagio.Algorithm import Algorithm from geomagio.XYZAlgorithm import XYZAlgorithm from geomagio.Controller import Controller from geomagio.iaga2002.IAGA2002Factory import IAGA_FILE_PATTERN -from geomagio.iaga2002.IAGA2002Factory import iaga_add_parse_arguments -from geomagio.XYZAlgorithm import XYZAlgorithm_add_parse_arguments -from geomagio.edge.EdgeFactory import edge_add_parse_arguments from obspy.core.utcdatetime import UTCDateTime @@ -145,10 +142,46 @@ def parse_args(): parser.add_argument('--algorithm', choices=['xyz', ]) - # Add I/O and Algorithm specific arguments - iaga_add_parse_arguments(parser) - edge_add_parse_arguments(parser) - XYZAlgorithm_add_parse_arguments(parser) + # iaga specific args. + parser.add_argument('--input-iaga-file', + help='Iaga2002 filename') + parser.add_argument('--input-iaga-magweb', + action="store_true", default=False, + help='Indicates iaga2002 files will be read from \ + http://magweb.cr.usgs.gov/data/magnetometer/') + parser.add_argument('--input-iaga-stdin', + action="store_true", default=False, + help='Indicates file will be redirected from stdin') + parser.add_argument('--input-iaga-url', + help='Url or Directory where Iaga2002 files can be read from') + parser.add_argument('--input-iaga-urltemplate', + help='Template for directory matching') + parser.add_argument('--input-iaga-filetemplate', + help='Template for iaga filenames') + + parser.add_argument('--output-iaga-url', + help='Url or Directory where IAGA2002 files should be written to') + parser.add_argument('--output-iaga-stdout', + action="store_true", default=False, + help='Indicates file will be directed to stdout') + parser.add_argument('--output-iaga-urltemplate', + help='Template for subdirectories') + parser.add_argument('--output-iaga-filetemplate', + help='Template for iaga filenames') + parser.add_argument('--output-iaga-file', + help='Output file name for single iaga file.') + + # edge specific args + parser.add_argument('--input-edge-host', + help='ip address of the edge input server') + parser.add_argument('--input-edge-port', type=int, + help='port number of the edge input server') + + # XYZ Algorithm specific args + parser.add_argument('--xyz-informat', + choices=['geo', 'mag', 'obs', 'obsd']) + parser.add_argument('--xyz-outformat', + choices=['geo', 'mag', 'obs', 'obsd']) return parser.parse_args() diff --git a/geomagio/XYZAlgorithm.py b/geomagio/XYZAlgorithm.py index bf06b300d5abb9f122eb34fa31896a82632b5b2c..60e175a70aab2ce1ab3d940cfe538c02ec8e04b6 100644 --- a/geomagio/XYZAlgorithm.py +++ b/geomagio/XYZAlgorithm.py @@ -19,19 +19,6 @@ CHANNELS = { } -def XYZAlgorithm_add_parse_arguments(parser): - """add XYZ specific arguments to parser - - Parameters - ---------- - parser: argparse.ArgumentParser - """ - parser.add_argument('--xyz-informat', - choices=['geo', 'mag', 'obs', 'obsd']) - parser.add_argument('--xyz-outformat', - choices=['geo', 'mag', 'obs', 'obsd']) - - class XYZAlgorithm(Algorithm): """Algorithm for converting data, probably inapproprately named XYZ. diff --git a/geomagio/iaga2002/IAGA2002Factory.py b/geomagio/iaga2002/IAGA2002Factory.py index 493bdd08a5e55a8770f611ac28be086a6d1efaf5..c5be4f1bd00e3e36552209b24d038561f441ef6c 100644 --- a/geomagio/iaga2002/IAGA2002Factory.py +++ b/geomagio/iaga2002/IAGA2002Factory.py @@ -43,42 +43,6 @@ def read_url(url): return content -def iaga_add_parse_arguments(parser): - """add iaga2002 specific arguments to parser - - Parameters - ---------- - parser: argparse.ArgumentParser - """ - parser.add_argument('--input-iaga-file', - help='Iaga2002 filename') - parser.add_argument('--input-iaga-magweb', - action="store_true", default=False, - help='Indicates iaga2002 files will be read from \ - http://magweb.cr.usgs.gov/data/magnetometer/') - parser.add_argument('--input-iaga-stdin', - action="store_true", default=False, - help='Indicates file will be redirected from stdin') - parser.add_argument('--input-iaga-url', - help='Url or Directory where Iaga2002 files can be read from') - parser.add_argument('--input-iaga-urltemplate', - help='Template for directory matching') - parser.add_argument('--input-iaga-filetemplate', - help='Template for iaga filenames') - - parser.add_argument('--output-iaga-url', - help='Url or Directory where IAGA2002 files should be written to') - parser.add_argument('--output-iaga-stdout', - action="store_true", default=False, - help='Indicates file will be directed to stdout') - parser.add_argument('--output-iaga-urltemplate', - help='Template for subdirectories') - parser.add_argument('--output-iaga-filetemplate', - help='Template for iaga filenames') - parser.add_argument('--output-iaga-file', - help='Output file name for single iaga file.') - - class IAGA2002Factory(TimeseriesFactory): """TimeseriesFactory for IAGA 2002 formatted files.