From a6f9299e189cdc5dac00ced6945d8639fe07225e Mon Sep 17 00:00:00 2001
From: pcain-usgs <pcain@usgs.gov>
Date: Fri, 26 Mar 2021 08:51:52 -0600
Subject: [PATCH] print result, save file as json, set metadata start/end times
 with result

---
 geomagio/processing/adjusted.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/geomagio/processing/adjusted.py b/geomagio/processing/adjusted.py
index 9ab5b7e49..2b7f748e6 100644
--- a/geomagio/processing/adjusted.py
+++ b/geomagio/processing/adjusted.py
@@ -75,8 +75,8 @@ def generate_matrix(
                 station=observatory,
                 created_by="generate_matrix",
                 metadata=result.dict(),
-                starttime=starttime,
-                endtime=endtime,
+                starttime=result.starttime,
+                endtime=result.endtime,
                 network="NT",
                 category=MetadataCategory.ADJUSTED_MATRIX,
             )
@@ -84,7 +84,7 @@ def generate_matrix(
 
     if output_file:
         with open(output_file, "w") as file:
-            json.dump(result.dict(), file)
+            file.write(result.json())
 
     if not output_file and not output_metadata:
-        raise ValueError("Output method not provided")
+        print(result.json(indent=2))
-- 
GitLab