From 617027f1485c88cde6ddf1a030b18fbe3edf2f0a Mon Sep 17 00:00:00 2001 From: Hal Simpson <hasimpson@usgs.gov> Date: Tue, 7 Jul 2015 16:17:16 -0600 Subject: [PATCH] Change computed_f test to use 2 instead of 1. --- geomagio/ChannelConverter_test.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/geomagio/ChannelConverter_test.py b/geomagio/ChannelConverter_test.py index 00fe4bb6..0c33b4b0 100644 --- a/geomagio/ChannelConverter_test.py +++ b/geomagio/ChannelConverter_test.py @@ -45,6 +45,21 @@ class ChannelConverterTest: length to be cos(angle) and the opposite length to be sin(angle) """ + def test_get_computed_f_using_sqaures(self): + """geomag.ChannelConverterTest.test_get_computed_f_using_sqaures + + Computed f is the combination of the 3 vector components from + either the geographic coordinate system (X,Y,Z), or the observatory + coordinate system (h,e,z). + """ + h = 2 + e = 2 + z = 2 + fv = channel.get_computed_f_using_squares(h, e, z) + fs = math.sqrt(12) + assert_almost_equal(fv, fs, 8, 'Expect fv to almost equal sqrt(12)', + True) + def test_get_geo_from_obs(self): """geomag.ChannelConverterTest.test_get_geo_from_obs() -- GitLab