diff --git a/etc/adjusted/BOU202005adj.min b/etc/adjusted/BOU202005adj.min new file mode 100644 index 0000000000000000000000000000000000000000..55f8fcc64580668ad815ae8706c1628cbbea0285 --- /dev/null +++ b/etc/adjusted/BOU202005adj.min @@ -0,0 +1,81 @@ + Format IAGA-2002 | + Source of Data United States Geological Survey (USGS) | + Station Name Boulder | + IAGA CODE BOU | + Geodetic Latitude 40.137 | + Geodetic Longitude 254.763 | + Elevation 1682 | + Reported HENULNUL | + Sensor Orientation HDZF | + Digital Sampling 0.01 second | + Data Interval Type filtered 1-minute (00:15-01:45) | + Data Type adjusted | + # Vector 1-minute values are computed from 1-second values using | + # the INTERMAGNET gaussian filter centered on the minute. Scalar | + # 1-minute values are computed from 1-second values using the | + # INTERMAGNET gaussian filter centered on the minute. | + # CONDITIONS OF USE: The Conditions of Use for data provided | + # through INTERMAGNET and acknowledgement templates can be found at | + # www.intermagnet.org | +DATE TIME DOY BOUH BOUE BOUNUL BOUNUL | +2020-05-20 16:15:00.000 141 -20799.04 80.92 99999.00 99999.00 +2020-05-20 16:16:00.000 141 -20798.26 79.97 99999.00 99999.00 +2020-05-20 16:17:00.000 141 -20799.43 81.22 99999.00 99999.00 +2020-05-20 16:18:00.000 141 -20799.30 81.21 99999.00 99999.00 +2020-05-20 16:19:00.000 141 -20798.46 81.12 99999.00 99999.00 +2020-05-20 16:20:00.000 141 -20798.42 80.66 99999.00 99999.00 +2020-05-20 16:21:00.000 141 -20798.46 80.82 99999.00 99999.00 +2020-05-20 16:22:00.000 141 -20799.44 82.26 99999.00 99999.00 +2020-05-20 16:23:00.000 141 -20799.77 83.04 99999.00 99999.00 +2020-05-20 16:24:00.000 141 -20799.92 83.61 99999.00 99999.00 +2020-05-20 16:25:00.000 141 -20799.86 84.01 99999.00 99999.00 +2020-05-20 16:26:00.000 141 -20800.45 84.89 99999.00 99999.00 +2020-05-20 16:27:00.000 141 -20800.19 85.06 99999.00 99999.00 +2020-05-20 16:28:00.000 141 -20799.51 84.19 99999.00 99999.00 +2020-05-20 16:29:00.000 141 -20800.04 84.43 99999.00 99999.00 +2020-05-20 16:30:00.000 141 -20800.35 85.42 99999.00 99999.00 +2020-05-20 16:31:00.000 141 -20801.59 86.82 99999.00 99999.00 +2020-05-20 16:32:00.000 141 -20800.09 85.61 99999.00 99999.00 +2020-05-20 16:33:00.000 141 -20799.88 85.30 99999.00 99999.00 +2020-05-20 16:34:00.000 141 -20799.63 85.22 99999.00 99999.00 +2020-05-20 16:35:00.000 141 -20800.31 86.19 99999.00 99999.00 +2020-05-20 16:36:00.000 141 -20800.10 86.61 99999.00 99999.00 +2020-05-20 16:37:00.000 141 -20800.24 87.08 99999.00 99999.00 +2020-05-20 16:38:00.000 141 -20800.48 87.37 99999.00 99999.00 +2020-05-20 16:39:00.000 141 -20800.11 87.48 99999.00 99999.00 +2020-05-20 16:40:00.000 141 -20800.37 87.77 99999.00 99999.00 +2020-05-20 16:41:00.000 141 -20800.28 88.43 99999.00 99999.00 +2020-05-20 16:42:00.000 141 -20799.94 88.16 99999.00 99999.00 +2020-05-20 16:43:00.000 141 -20799.84 88.41 99999.00 99999.00 +2020-05-20 16:44:00.000 141 -20799.97 88.84 99999.00 99999.00 +2020-05-20 16:45:00.000 141 -20799.91 89.16 99999.00 99999.00 +2020-05-20 16:46:00.000 141 -20799.76 90.02 99999.00 99999.00 +2020-05-20 16:47:00.000 141 -20798.99 89.88 99999.00 99999.00 +2020-05-20 16:48:00.000 141 -20799.15 90.00 99999.00 99999.00 +2020-05-20 16:49:00.000 141 -20799.12 90.57 99999.00 99999.00 +2020-05-20 16:50:00.000 141 -20799.31 90.57 99999.00 99999.00 +2020-05-20 16:51:00.000 141 -20799.88 91.49 99999.00 99999.00 +2020-05-20 16:52:00.000 141 -20799.70 91.47 99999.00 99999.00 +2020-05-20 16:53:00.000 141 -20799.84 92.18 99999.00 99999.00 +2020-05-20 16:54:00.000 141 -20799.93 92.25 99999.00 99999.00 +2020-05-20 16:55:00.000 141 -20799.19 92.03 99999.00 99999.00 +2020-05-20 16:56:00.000 141 -20799.36 92.33 99999.00 99999.00 +2020-05-20 16:57:00.000 141 -20800.01 93.36 99999.00 99999.00 +2020-05-20 16:58:00.000 141 -20799.97 93.46 99999.00 99999.00 +2020-05-20 16:59:00.000 141 -20800.05 93.75 99999.00 99999.00 +2020-05-20 17:00:00.000 141 -20799.75 93.79 99999.00 99999.00 +2020-05-20 17:01:00.000 141 -20800.12 94.57 99999.00 99999.00 +2020-05-20 17:02:00.000 141 -20799.69 95.16 99999.00 99999.00 +2020-05-20 17:03:00.000 141 -20799.40 94.88 99999.00 99999.00 +2020-05-20 17:04:00.000 141 -20799.78 95.32 99999.00 99999.00 +2020-05-20 17:05:00.000 141 -20800.16 96.23 99999.00 99999.00 +2020-05-20 17:06:00.000 141 -20799.45 96.29 99999.00 99999.00 +2020-05-20 17:07:00.000 141 -20799.44 96.15 99999.00 99999.00 +2020-05-20 17:08:00.000 141 -20799.77 97.14 99999.00 99999.00 +2020-05-20 17:09:00.000 141 -20799.62 97.22 99999.00 99999.00 +2020-05-20 17:10:00.000 141 -20799.90 97.87 99999.00 99999.00 +2020-05-20 17:11:00.000 141 -20799.94 98.16 99999.00 99999.00 +2020-05-20 17:12:00.000 141 -20799.30 98.11 99999.00 99999.00 +2020-05-20 17:13:00.000 141 -20799.43 98.60 99999.00 99999.00 +2020-05-20 17:14:00.000 141 -20799.54 99.03 99999.00 99999.00 +2020-05-20 17:15:00.000 141 99999.00 99999.00 99999.00 99999.00 diff --git a/test/algorithm_test/AdjustedAlgorithm_test.py b/test/algorithm_test/AdjustedAlgorithm_test.py index a57947d7a0221314bdb1b795a9c2dcc54bde6514..faffec3a9ba0522fb33cee08590e20ffda1b40ce 100644 --- a/test/algorithm_test/AdjustedAlgorithm_test.py +++ b/test/algorithm_test/AdjustedAlgorithm_test.py @@ -16,7 +16,7 @@ def test_construct(): assert_equal(a.pier_correction, -22) -def test_process(): +def test_process_XYZF(): """algorithm_test.AdjustedAlgorithm_test.test_process() Check adjusted data processing versus files generated from @@ -54,3 +54,43 @@ def test_process(): assert_almost_equal(y.data, y_adj.data, 2) assert_almost_equal(z.data, z_adj.data, 2) assert_almost_equal(f.data, f_adj.data, 2) + + +def test_process_reverse_polarity(): + """algorithm_test.AdjustedAlgorithm_test.test_process() + + Check adjusted data processing versus files generated from + original script. Tests reverse polarity martix. + """ + matrix = None + pier_correction = None + # load adjusted data transform matrix and pier correction + a = adj( + matrix, + pier_correction, + "etc/adjusted/adjbou_state_HE_.json", + inchannels=["H", "E"], + outchannels=["H", "E"], + ) + + # load boulder May 20 files from /etc/ directory + he_iaga2002_file = open("etc/adjusted/BOU202005vmin.min") + he_iaga2002_string = he_iaga2002_file.read() + he_inv_iaga2002_file = open("etc/adjusted/BOU202005adj.min") + he_inv_iaga2002_string = he_inv_iaga2002_file.read() + factory = i2.IAGA2002Factory() + he = factory.parse_string(he_iaga2002_string) + he_inv = factory.parse_string(he_inv_iaga2002_string) + + # process hezf (raw) channels with loaded transform + adj_bou = a.process(he) + + # unpack channels from loaded adjusted data file + h = he_inv.select(channel="H")[0] + e = he_inv.select(channel="E")[0] + # unpack channels from adjusted processing of raw data + h_adj = adj_bou.select(channel="H")[0] + e_adj = adj_bou.select(channel="E")[0] + + assert_almost_equal(h.data, h_adj.data, 2) + assert_almost_equal(e.data, e_adj.data, 2)