From b3198d2f9442c1dcb8737bbd69423056bcf223c1 Mon Sep 17 00:00:00 2001
From: Jeremy Fee <jmfee@usgs.gov>
Date: Mon, 16 Dec 2019 16:46:43 -0700
Subject: [PATCH] Add miniseed to controller output options

---
 geomagio/Controller.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/geomagio/Controller.py b/geomagio/Controller.py
index fc3cf19c..024014ef 100644
--- a/geomagio/Controller.py
+++ b/geomagio/Controller.py
@@ -411,6 +411,15 @@ def get_output_factory(args):
                 tag=args.output_edge_tag,
                 forceout=args.output_edge_forceout,
                 **output_factory_args)
+    elif output_type == 'miniseed':
+        # TODO: deal with other miniseed arguments
+        locationcode = args.outlocationcode or args.locationcode or None
+        output_factory = edge.EdgeFactory(
+                host=args.output_host,
+                port=args.output_read_port,
+                write_port=args.output_port,
+                locationCode=locationcode,
+                **output_factory_args)
     elif output_type == 'plot':
         output_factory = PlotTimeseriesFactory()
     else:
@@ -845,6 +854,7 @@ def parse_args(args):
                 'edge',
                 'iaga2002',
                 'imfjson',
+                'miniseed',
                 'pcdcp',
                 'plot',
                 'temperature',
@@ -862,6 +872,10 @@ def parse_args(args):
             default=7981,
             help='Write to specified port',
             type=int)
+    parser.add_argument('--output-read-port',
+            default=2061,
+            help='Read from specified port',
+            type=int)
     parser.add_argument('--output-stdout',
             action='store_true',
             default=False,
-- 
GitLab