Serializable
, TimeStamped
public class GPSDate extends Object implements Serializable, TimeStamped
AbsoluteDate
,
Serialized FormConstructor | Description |
---|---|
GPSDate(int weekNumber,
double milliInWeek) |
Build an instance corresponding to a GPS date.
|
GPSDate(AbsoluteDate date) |
Build an instance from an absolute date.
|
Modifier and Type | Method | Description |
---|---|---|
AbsoluteDate |
getDate() |
Get the date.
|
double |
getMilliInWeek() |
Get the number of milliseconds since week start.
|
static DateComponents |
getRolloverReference() |
Get the reference date ensuring continuity across GPS week rollover.
|
int |
getWeekNumber() |
Get the week number since
GPS epoch . |
static void |
setRolloverReference(DateComponents reference) |
Set a reference date for ensuring continuity across GPS week rollover.
|
public GPSDate(int weekNumber, double milliInWeek)
GPS dates are provided as a week number starting at GPS epoch
and as a number of milliseconds since week start.
Many interfaces provide only the 10 lower bits of the GPS week number, just as it comes from
the GPS signal. In other words they use a week number modulo 1024. In order to cope with
this, when the week number is smaller than 1024, this constructor assumes a modulo operation
has been performed and it will fix the week number according to the reference date set up for
handling rollover (see setRolloverReference(reference)
).
If the week number is 1024 or larger, it will be used without any correction.
weekNumber
- week number, either absolute or modulo 1024milliInWeek
- number of milliseconds since week startpublic GPSDate(AbsoluteDate date)
date
- absolute date to considerpublic static void setRolloverReference(DateComponents reference)
Instance created using the GPSDate(weekNumber, milliInWeek)
constructor and with a week number between 0 and 1024 after this method has been called will
fix the week number to ensure they correspond to dates between reference - 512 weeks
and reference + 512 weeks
.
If this method is never called, a default reference date for rollover will be set using
the date of the last known EOP entry retrieved from UT1
time scale.
reference
- reference date for GPS week rollovergetRolloverReference()
,
GPSDate(int, double)
public static DateComponents getRolloverReference()
#setRolloverReference(AbsoluteDate)
,
GPSDate(int, double)
public int getWeekNumber()
GPS epoch
.
The week number returned here has been fixed for GPS week rollover, i.e. it may be larger than 1024.
GPS epoch
public double getMilliInWeek()
public AbsoluteDate getDate()
getDate
in interface TimeStamped
Copyright © 2002-2019 CS Systèmes d'information. All rights reserved.