From 3b5aac765736377d621d572f9c3700b0f223cb70 Mon Sep 17 00:00:00 2001 From: Dmitry Tatarinov Date: Fri, 27 May 2016 13:33:29 +0300 Subject: [PATCH] Remove Iono decoder This is a rollback commit --- include/libswiftnav/ephemeris.h | 2 +- include/libswiftnav/ionosphere.h | 4 +- include/libswiftnav/nav_msg.h | 6 +-- python/swiftnav/nav_msg.pxd | 16 +------- python/swiftnav/nav_msg.pyx | 2 +- src/ionosphere.c | 35 +---------------- src/nav_msg.c | 11 +----- tests/check_ionosphere.c | 66 -------------------------------- 8 files changed, 8 insertions(+), 134 deletions(-) diff --git a/include/libswiftnav/ephemeris.h b/include/libswiftnav/ephemeris.h index 78ec63f6..bf99a0bb 100644 --- a/include/libswiftnav/ephemeris.h +++ b/include/libswiftnav/ephemeris.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, 2016 Swift Navigation Inc. + * Copyright (C) 2010 Swift Navigation Inc. * Contact: Henry Hallam * Fergus Noble * diff --git a/include/libswiftnav/ionosphere.h b/include/libswiftnav/ionosphere.h index de76fade..dbf06c8e 100644 --- a/include/libswiftnav/ionosphere.h +++ b/include/libswiftnav/ionosphere.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015, 2016 Swift Navigation Inc. + * Copyright (C) 2015 Swift Navigation Inc. * Contact: Leith Bade * * This source is subject to the license found in the file 'LICENSE' which must @@ -27,6 +27,4 @@ double calc_ionosphere(const gps_time_t *t_gps, double a, double e, const ionosphere_t *i); -void decode_iono_parameters(const u32 *subframe4_words, ionosphere_t *iono); - #endif /* LIBSWIFTNAV_IONOSHPERE_H */ diff --git a/include/libswiftnav/nav_msg.h b/include/libswiftnav/nav_msg.h index 137c2905..b3f1f601 100644 --- a/include/libswiftnav/nav_msg.h +++ b/include/libswiftnav/nav_msg.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, 2016 Swift Navigation Inc. + * Copyright (C) 2010 Swift Navigation Inc. * Contact: Henry Hallam * * This source is subject to the license found in the file 'LICENSE' which must @@ -15,7 +15,6 @@ #include #include -#include #define NAV_MSG_SUBFRAME_BITS_LEN 14 /* Buffer 448 nav bits. */ @@ -47,9 +46,6 @@ typedef struct { ephemeris_t ephemeris; bool ephemeris_upd_flag; - ionosphere_t iono; - bool iono_corr_upd_flag; - u32 gps_l2c_sv_capability; bool gps_l2c_sv_capability_upd_flag; } gps_l1ca_decoded_data_t; diff --git a/python/swiftnav/nav_msg.pxd b/python/swiftnav/nav_msg.pxd index ae7daa39..0cc7bd92 100644 --- a/python/swiftnav/nav_msg.pxd +++ b/python/swiftnav/nav_msg.pxd @@ -1,4 +1,4 @@ -# Copyright (C) 2012, 2016 Swift Navigation Inc. +# Copyright (C) 2012 Swift Navigation Inc. # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. @@ -30,21 +30,9 @@ cdef extern from "libswiftnav/nav_msg.h": u8 next_subframe_id s8 bit_polarity - ctypedef struct ionosphere_t: - double a0 - double a1 - double a2 - double a3 - double b0 - double b1 - double b2 - double b3 - ctypedef struct gps_l1ca_decoded_data_t: ephemeris_t ephemeris bool ephemeris_upd_flag - ionosphere_t iono - bool iono_corr_upd_flag u32 gps_l2c_sv_capability bool gps_l2c_sv_capability_upd_flag @@ -58,4 +46,4 @@ cdef class NavMsg: cdef nav_msg_t _thisptr cdef class GpsL1CADecodedData: - cdef gps_l1ca_decoded_data_t _thisptr + cdef gps_l1ca_decoded_data_t _thisptr diff --git a/python/swiftnav/nav_msg.pyx b/python/swiftnav/nav_msg.pyx index fca7c1f1..82b62f4b 100644 --- a/python/swiftnav/nav_msg.pyx +++ b/python/swiftnav/nav_msg.pyx @@ -1,4 +1,4 @@ -# Copyright (C) 2012, 2016 Swift Navigation Inc. +# Copyright (C) 2012 Swift Navigation Inc. # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. diff --git a/src/ionosphere.c b/src/ionosphere.c index d17e3361..8e835cbb 100644 --- a/src/ionosphere.c +++ b/src/ionosphere.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015, 2016 Swift Navigation Inc. + * Copyright (C) 2015 Swift Navigation Inc. * Contact: Leith Bade * * This source is subject to the license found in the file 'LICENSE' which must @@ -12,11 +12,9 @@ #include #include #include -#include #include #include -#include /** \defgroup ionosphere Ionospheric models * Implemenations of ionospheric delay correction models. @@ -109,35 +107,4 @@ double calc_ionosphere(const gps_time_t *t_gps, return d_l1; } -/** The function decodes ionospheric parameters - * \param subframe4_words pointer to received frame word, - * Note: Ionospheric parmeters are passed in subframe 4, - * pass function parameters accordingly. - * \param iono pointer to ionosphere_t where decoded data should be stored - */ -void decode_iono_parameters(const u32 *subframe4_words, ionosphere_t *iono) -{ - union { - s8 s8; - u8 u8; - } onebyte; - - onebyte.u8 = subframe4_words[3-3] >> (30-16) & 0xff; /* alfa 0 */ - iono->a0 = onebyte.s8 * pow(2, -30); - onebyte.u8 = subframe4_words[3-3] >> (30-24) & 0xff; /* alfa 1 */ - iono->a1 = onebyte.s8 * pow(2, -27); - onebyte.u8 = subframe4_words[4-3] >> (30-8) & 0xff; /* alfa 2 */ - iono->a2 = onebyte.s8 * pow(2, -24); - onebyte.u8 = subframe4_words[4-3] >> (30-16) & 0xff; /* alfa 3 */ - iono->a3 = onebyte.s8 * pow(2, -24); - onebyte.u8 = subframe4_words[4-3] >> (30-24) & 0xff; /* beta 0 */ - iono->b0 = onebyte.s8 * pow(2, 11); - onebyte.u8 = subframe4_words[5-3] >> (30-8) & 0xff; /* beta 1 */ - iono->b1 = onebyte.s8 * pow(2, 14); - onebyte.u8 = subframe4_words[5-3] >> (30-16) & 0xff; /* beta 2 */ - iono->b2 = onebyte.s8 * pow(2, 16); - onebyte.u8 = subframe4_words[5-3] >> (30-24) & 0xff; /* beta 3 */ - iono->b3 = onebyte.s8 * pow(2, 16); -} - /** \} */ diff --git a/src/nav_msg.c b/src/nav_msg.c index d3ebc03f..40041bc4 100644 --- a/src/nav_msg.c +++ b/src/nav_msg.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, 2016 Swift Navigation Inc. + * Copyright (C) 2010 Swift Navigation Inc. * Contact: Henry Hallam * * This source is subject to the license found in the file 'LICENSE' which must @@ -302,15 +302,6 @@ s8 process_subframe(nav_msg_t *n, gnss_signal_t sid, data->gps_l2c_sv_capability_upd_flag = true; } - /* check Word 3 bits 2..7 (63..69) for Page ID 18, - * which contains iono data - * Page 18 has ID 56, see IS-200H, pg. 109-110 */ - if ((n->frame_words[3][3-3] >> (30-8) & 0x3f) == 56) { - /* decode ionospheric correction data */ - decode_iono_parameters(n->frame_words[3], &data->iono); - data->iono_corr_upd_flag = true; - } - /* Got all of subframes 1 to 4 */ n->next_subframe_id = 1; /* Make sure we start again next time */ diff --git a/tests/check_ionosphere.c b/tests/check_ionosphere.c index 177bf364..9561b68e 100644 --- a/tests/check_ionosphere.c +++ b/tests/check_ionosphere.c @@ -1,17 +1,4 @@ -/* - * Copyright (C) 2016 Swift Navigation Inc. - * Contact: Dmitry Tatarinov - * - * This source is subject to the license found in the file 'LICENSE' which must - * be be distributed together with this source. All other rights reserved. - * - * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, - * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - */ - #include -#include #include #include @@ -61,65 +48,12 @@ START_TEST(test_calc_ionosphere) } END_TEST -START_TEST(test_decode_iono_parameters) -{ - #define tol 1e-12 - struct { - u32 frame_words[8]; - ionosphere_t result; - } t_case = { - .frame_words = { - /* 4th SF real data at 11-May-2016 */ - 0x1e0300c9,0x7fff8c24,0x23fbdc2,0,0,0,0,0 - }, - .result = { /* reference data provided by u-blox receiver */ - .a0 = 0.0000000111758, - .a1 = 0.0000000223517, - .a2 = -0.0000000596046, - .a3 = -0.0000001192092, - .b0 = 98304.0, - .b1 = 131072.0, - .b2 = -131072.0, - .b3 = -589824.0, - } - }; - ionosphere_t i; - decode_iono_parameters(t_case.frame_words, &i); - fail_unless(fabs(i.a0 - t_case.result.a0) < tol, - "alfa 0 == %30.20f, expected %30.20f, tolerance = %30.20f", - i.a0, t_case.result.a0, tol); - fail_unless(fabs(i.a1 - t_case.result.a1) < tol, - "alfa 1 == %30.20f, expected %30.20f, tolerance = %30.20f", - i.a1, t_case.result.a1, tol); - fail_unless(fabs(i.a2 - t_case.result.a2) < tol, - "alfa 2 == %30.20f, expected %30.20f, tolerance = %30.20f", - i.a2, t_case.result.a2, tol); - fail_unless(fabs(i.a3 - t_case.result.a3) < tol, - "alfa 3 == %30.20f, expected %30.20f, tolerance = %30.20f", - i.a3, t_case.result.a3, tol); - fail_unless(fabs(i.b0 - t_case.result.b0) < tol, - "beta 0 == %30.20f, expected %30.20f, tolerance = %30.20f", - i.b0, t_case.result.b0, tol); - fail_unless(fabs(i.b1 - t_case.result.b1) < tol, - "beta 1 == %30.20f, expected %30.20f, tolerance = %30.20f", - i.b1, t_case.result.b1, tol); - fail_unless(fabs(i.b2 - t_case.result.b2) < tol, - "beta 2 == %30.20f, expected %30.20f, tolerance = %30.20f", - i.b2, t_case.result.b2, tol); - fail_unless(fabs(i.b3 - t_case.result.b3) < tol, - "beta 3 == %30.20f, expected %30.20f, tolerance = %30.20f", - i.b3, t_case.result.b3, tol); - -} -END_TEST - Suite* ionosphere_suite(void) { Suite *s = suite_create("Ionosphere"); TCase *tc_core = tcase_create("Core"); tcase_add_test(tc_core, test_calc_ionosphere); - tcase_add_test(tc_core, test_decode_iono_parameters); suite_add_tcase(s, tc_core); return s;