2013-07-15 17:07:10 +00:00
|
|
|
|
/*!
|
2013-10-18 18:26:06 +00:00
|
|
|
|
* \file galileo_ephemeris.cc
|
2013-11-23 13:05:38 +00:00
|
|
|
|
* \brief Interface of a Galileo EPHEMERIS storage and orbital model functions
|
2013-07-15 17:07:10 +00:00
|
|
|
|
* \author Javier Arribas, 2013. jarribas(at)cttc.es
|
2013-08-16 12:45:30 +00:00
|
|
|
|
* \author Mara Branzanti 2013. mara.branzanti(at)gmail.com
|
2020-07-28 19:27:46 +00:00
|
|
|
|
*
|
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
|
* -----------------------------------------------------------------------------
|
2013-07-15 17:07:10 +00:00
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2013-07-15 17:07:10 +00:00
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2013-07-15 17:07:10 +00:00
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
|
* -----------------------------------------------------------------------------
|
2013-07-15 17:07:10 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "galileo_ephemeris.h"
|
|
|
|
|
|
2013-08-16 12:45:30 +00:00
|
|
|
|
|
2021-02-20 23:01:56 +00:00
|
|
|
|
double Galileo_Ephemeris::Galileo_System_Time(double week_number, double TOW)
|
2013-11-23 13:05:38 +00:00
|
|
|
|
{
|
2020-07-19 23:20:15 +00:00
|
|
|
|
/* GALILEO SYSTEM TIME, ICD 5.1.2
|
2021-02-20 23:01:56 +00:00
|
|
|
|
*
|
2013-10-18 18:26:06 +00:00
|
|
|
|
* input parameter:
|
2021-02-20 23:01:56 +00:00
|
|
|
|
*
|
|
|
|
|
* week_number: The Week Number is an integer counter that gives the
|
|
|
|
|
* sequential week number from the origin of the Galileo time. It covers
|
|
|
|
|
* 4096 weeks (about 78 years). Then the counter is reset to zero to cover
|
|
|
|
|
* additional period modulo 4096
|
|
|
|
|
*
|
|
|
|
|
* TOW: The Time of Week is defined as the number of seconds that have
|
|
|
|
|
* occurred since the transition from the previous week. The TOW covers an
|
|
|
|
|
* entire week from 0 to 604799 seconds and is reset to zero at the end of
|
|
|
|
|
* each week
|
|
|
|
|
*
|
|
|
|
|
* week_number and TOW are received in page 5
|
|
|
|
|
*
|
|
|
|
|
* output:
|
|
|
|
|
*
|
|
|
|
|
* t: it is the transmitted time in Galileo System Time (expressed
|
|
|
|
|
* in seconds)
|
|
|
|
|
*
|
|
|
|
|
* The GST start epoch shall be 00:00 UT on Sunday 22nd August 1999
|
|
|
|
|
* (midnight between 21st and 22nd August). At the start epoch, GST shall be
|
|
|
|
|
* ahead of UTC by thirteen (13) leap seconds. Since the next leap second
|
|
|
|
|
* was inserted at 01.01.2006, this implies that as of 01.01.2006 GST is
|
|
|
|
|
* ahead of UTC by fourteen (14) leap seconds.
|
|
|
|
|
*
|
|
|
|
|
* The epoch denoted in the navigation messages by TOW and week_number will
|
|
|
|
|
* be measured relative to the leading edge of the first chip of the first
|
|
|
|
|
* code sequence of the first page symbol. The transmission timing of the
|
|
|
|
|
* navigation message provided through the TOW is synchronised to each
|
|
|
|
|
* satellite’s version of Galileo System Time (GST).
|
2013-10-18 18:26:06 +00:00
|
|
|
|
*
|
|
|
|
|
*/
|
2020-07-19 12:26:15 +00:00
|
|
|
|
const double sec_in_day = 86400;
|
|
|
|
|
const double day_in_week = 7;
|
2021-02-20 23:01:56 +00:00
|
|
|
|
double t = week_number * sec_in_day * day_in_week + TOW; // second from the origin of the Galileo time
|
2013-10-18 18:26:06 +00:00
|
|
|
|
return t;
|
2013-08-16 12:45:30 +00:00
|
|
|
|
}
|