From a8bc9c91c902e90d44028825c99f87851f8bb567 Mon Sep 17 00:00:00 2001
From: Alex Wernle <awernle@usgs.gov>
Date: Thu, 30 Nov 2023 11:57:02 -0700
Subject: [PATCH] Moving Instrument.py to category folder under metadata

---
 .../ws => metadata/Instrument}/Instrument.py  | 52 +++++++++----------
 1 file changed, 26 insertions(+), 26 deletions(-)
 rename geomagio/{api/ws => metadata/Instrument}/Instrument.py (69%)

diff --git a/geomagio/api/ws/Instrument.py b/geomagio/metadata/Instrument/Instrument.py
similarity index 69%
rename from geomagio/api/ws/Instrument.py
rename to geomagio/metadata/Instrument/Instrument.py
index 84807ed3..9c98e58c 100644
--- a/geomagio/api/ws/Instrument.py
+++ b/geomagio/metadata/Instrument/Instrument.py
@@ -21,25 +21,25 @@ class Instrument(BaseModel):
 # TODO: add Offsets to Observatory.py or keep here?
 class Offsets(Instrument):
     observatory: str
-    x_offset: int = Field(..., description="X offset in nT")
-    y_offset: int = Field(..., description="Y offset in nT")
-    z_offset: int = Field(..., description="Z offset in nT")
+    u_offset_offset: int = Field(..., description="U offset in nT")
+    v_offset: int = Field(..., description="V offset in nT")
+    w_offset: int = Field(..., description="W offset in nT")
 
 
 class Electronics(Instrument):
     type: str
     resistance: float = None  # kOhm
     temperature_scale: float = None  # V/K
-    x_bin: int = None  # nT/bin
-    y_bin: int = None  # nT/bin
-    z_bin: int = None  # nT/bin
+    u_bin: int = None  # nT/bin
+    v_bin: int = None  # nT/bin
+    w_bin: int = None  # nT/bin
 
 
 class Sensor(Instrument):
     type: str
-    x_constant: int = Field(..., description="X constant in nT/mA")
-    y_constant: int = Field(..., description="Y constant in nT/mA")
-    z_constant: int = Field(..., description="Z constant in nT/mA")
+    u_constant: int = Field(..., description="U constant in nT/mA")
+    v_constant: int = Field(..., description="V constant in nT/mA")
+    w_constant: int = Field(..., description="W constant in nT/mA")
 
 
 class DataLogger(Instrument):
@@ -48,12 +48,12 @@ class DataLogger(Instrument):
 
 class Digitizer(Instrument):
     type: str
-    x_scale: int = Field(..., description="X scale in counts/V")
-    y_scale: int = Field(..., description="Y scale in counts/V")
-    z_scale: int = Field(..., description="Z scale in counts/V")
+    u_scale: int = Field(..., description="U scale in counts/V")
+    v_scale: int = Field(..., description="V scale in counts/V")
+    w_scale: int = Field(..., description="W scale in counts/V")
 
 
-class Instruments(BaseModel):
+class Active_Instruments(BaseModel):
     offsets: Offsets
     electronics: Electronics
     sensor: Sensor
@@ -71,9 +71,9 @@ if __name__ == "__main__":
             "model": None,
             "broken": False,
             "description": "Observatory offsets",
-            "x_offset": 12620,  # nT
-            "y_offset": 0,  # nT
-            "z_offset": 54907,  # nT
+            "u_offset": 12620,  # nT
+            "v_offset": 0,  # nT
+            "w_offset": 54907,  # nT
         },
         "electronics": {
             "serial": "E0568",
@@ -85,9 +85,9 @@ if __name__ == "__main__":
             "type": "FGE Electronics",
             "resistance": 18.6,  # kOhm
             "temperature_scale": 0.01,  # V/K
-            "x_bin": None,  # nT/bin
-            "y_bin": None,  # nT/bin
-            "z_bin": None,  # nT/bin
+            "u_bin": None,  # nT/bin
+            "v_bin": None,  # nT/bin
+            "w_bin": None,  # nT/bin
         },
         "sensor": {
             "serial": "S0443",
@@ -97,9 +97,9 @@ if __name__ == "__main__":
             "broken": False,
             "description": "sensor constants combine with electronics resistance to give scale values",
             "type": "FGE",
-            "x_constant": 37062,  # nT/mA
-            "y_constant": 37141,  # nT/mA
-            "z_constant": 37281,  # nT/mA
+            "u_constant": 37062,  # nT/mA
+            "v_constant": 37141,  # nT/mA
+            "w_constant": 37281,  # nT/mA
         },
         "data_logger": {
             "serial": "S0443",
@@ -118,11 +118,11 @@ if __name__ == "__main__":
             "broken": False,
             "description": None,
             "type": "ObsRIO Module",
-            "x_scale": 37062,  # counts/V
-            "y_scale": 37141,  # counts/V
-            "z_scale": 37281,  # counts/V
+            "u_scale": 37062,  # counts/V
+            "v_scale": 37141,  # counts/V
+            "w_scale": 37281,  # counts/V
         },
     }
 
-    instruments = Instruments(**instrument_data)
+    instruments = Active_Instruments(**instrument_data)
     print(instruments)
-- 
GitLab