From e081efc4ae8f8d3307bcc9d70e24f608ed892438 Mon Sep 17 00:00:00 2001
From: "E. Joshua Rigler" <erigler@usgs.gov>
Date: Wed, 5 Mar 2025 11:43:50 -0700
Subject: [PATCH] Do NOT "duplicate" raw 1-s data in EdgeCWB

I mistakenly thought that only the float32 1-second data from ObsRIO systems was pushed to our ringserver, but apparently any/all LFF, LK1-4 channels are. This resulted in duplicate miniseed data going to IRIS, with one copy in the original float32 format, and another as scaled integers. This commit fixes this until/unless we can better reconfigure EdgeCWB to our needs.
---
 geomagio/processing/filters.py | 55 ++++++++++++++--------------------
 1 file changed, 22 insertions(+), 33 deletions(-)

diff --git a/geomagio/processing/filters.py b/geomagio/processing/filters.py
index 2408ffa1..32020635 100644
--- a/geomagio/processing/filters.py
+++ b/geomagio/processing/filters.py
@@ -200,38 +200,6 @@ def realtime_command(
             realtime_interval=realtime_interval,
             update_limit=update_limit,
         )
-        _copy_channels(
-            # copy 1-sec ObsRIO channels
-            # NOTE: yes, this creates redundant data; however...
-            #       - it is compressed
-            #       - it is integer, so readable by EdgeFactory
-            #       - it provides more "permanent" data, since the
-            #         ObsRIO raw data *may* eventually get pruned
-            observatory=observatory,
-            channels=(
-                ("LFF", "LFF"),
-                ("LK1", "LK1"),
-                ("LK2", "LK2"),
-                ("LK3", "LK3"),
-                ("LK4", "LK4"),
-            ),
-            interval="second",
-            input_factory=MiniSeedFactory(
-                host=input_host,
-                port=None,  # use MiniSeedFactory default
-                type="variation",
-                sncl_mode="geomag",
-            ),
-            output_factory=EdgeFactory(
-                host=output_host,
-                port=output_read_port,
-                write_port=output_port,
-                type="variation",
-                sncl_mode="geomag",
-            ),
-            realtime_interval=realtime_interval,
-            update_limit=update_limit,
-        )
         # remove the following after data migration is complete
         _copy_channels(
             observatory=observatory,
@@ -258,7 +226,7 @@ def realtime_command(
 
         minute_filter(
             observatory=observatory,
-            channels=("U", "V", "W", "F", "T1", "T2", "T3", "T4"),
+            channels=("U", "V", "W"),
             input_factory=EdgeFactory(
                 host=input_host,
                 port=input_port,  # earthworm port required for realtime
@@ -275,6 +243,27 @@ def realtime_command(
             realtime_interval=realtime_interval,
             update_limit=update_limit,
         )
+        # segregate F and T* filtering from U, V, and W until/unless ObsRio
+        # transmits scaled integer data
+        minute_filter(
+            observatory=observatory,
+            channels=("F", "T1", "T2", "T3", "T4"),
+            input_factory=MiniSeedFactory(
+                host=input_host,
+                port=None,  # use MiniSeedFactory default
+                type="variation",
+                sncl_mode="geomag",
+            ),
+            output_factory=EdgeFactory(
+                host=output_host,
+                port=output_read_port,  # earthworm port required for realtime
+                write_port=output_port,  # rawinput port required for realtime
+                type="variation",
+                sncl_mode="geomag",
+            ),
+            realtime_interval=realtime_interval,
+            update_limit=update_limit,
+        )
         # remove the following after data migration is complete
         _copy_channels(
             observatory=observatory,
-- 
GitLab