Interface: GPSPredictionContext
Defined in: src/sdk/instruments/GPSSat.ts:150
A context that can be used to simulate satellite geometry and reception at arbitrary spatiotemporal positions.
Properties
enabledSbasGroups
readonlyenabledSbasGroups:SubscribableSet<string> &Subscribable<ReadonlySet<string>>
Defined in: src/sdk/instruments/GPSSat.ts:174
This context's currently enabled SBAS groups. SBAS satellites that belong to groups that are not enabled are inhibited from being tracked by this context's receiver and cannot be used for position determination or differential correction download.
inhibitedSatellitePrnCodes
readonlyinhibitedSatellitePrnCodes:SubscribableSet<number> &Subscribable<ReadonlySet<number>>
Defined in: src/sdk/instruments/GPSSat.ts:184
The PRN (pseudo-random noise) codes of all satellites that are currently manually inhibited in this context. This set does not include SBAS satellites that are inhibited solely because their associated SBAS group is not enabled (unless the satellite has also been manually inhibited).
Inhibited satellites cannot be tracked, and therefore cannot be used for position determination or (in the case of SBAS satellites) differential correction download.
satInUseMaxCount
readonlysatInUseMaxCount:Subscribable<number>
Defined in: src/sdk/instruments/GPSSat.ts:152
The maximum number of satellites this context can use for position solution calculations.
satInUseOptimumCount
readonlysatInUseOptimumCount:Subscribable<number>
Defined in: src/sdk/instruments/GPSSat.ts:167
The optimum number of satellites to use for position solution calculations when this context targets a maximum
PDOP value. Additional satellites will be selected while PDOP is greater than the target (satInUsePdopTarget) or
the number of selected satellites is less than the optimum count.
satInUsePdopTarget
readonlysatInUsePdopTarget:Subscribable<number>
Defined in: src/sdk/instruments/GPSSat.ts:160
The maximum PDOP this context targets when selecting satellites to use for position solution calculations.
Additional satellites will be selected while PDOP is greater than the target or the number of selected satellites
is less than the optimum count (satInUseOptimumCount). Values less than or equal to zero will cause all possible
satellites to be selected up to the maximum count (satInUseMaxCount).
Methods
awaitInit()
awaitInit():
Promise<void>
Defined in: src/sdk/instruments/GPSSat.ts:191
Waits for this context to complete initialization.
Returns
Promise<void>
A Promise which is fulfilled when this context has completed initialization, or rejected if this context is destroyed before it has completed initialization.
destroy()
destroy():
void
Defined in: src/sdk/instruments/GPSSat.ts:356
Destroys this context. This frees resources associated with the context and allows the context to be garbage collected.
Returns
void
getAltitude()
getAltitude():
number
Defined in: src/sdk/instruments/GPSSat.ts:209
Gets the altitude of this context's receiver, in meters above MSL.
Returns
number
The altitude of this context's receiver, in meters above MSL.
getAvailableDiffCorrections()
getAvailableDiffCorrections():
ReadonlySet<string>
Defined in: src/sdk/instruments/GPSSat.ts:235
Gets the SBAS groups from which differential corrections were predicted to be available in the most recent prediction simulated by this context. For differential corrections to be available from an SBAS group, the group must be enabled, the receiver must be within the SBAS coverage area, and the receiver must have line of sight to at least one of the group's satellites that is not inhibited.
Returns
ReadonlySet<string>
The SBAS groups from which differential corrections were predicted to be available in the most recent prediction simulated by this context.
getCovarMatrix()
getCovarMatrix():
ReadonlyFloat64Array
Defined in: src/sdk/instruments/GPSSat.ts:250
Gets the covariance matrix calculated from the satellite constellation used to produce a position solution in the most recent prediction simulated by this context, represented as a 16-element vector.
Returns
The covariance matrix calculated from the satellite constellation used to produce a position solution in the
most recent prediction simulated by this context, represented as a 16-element vector. The matrix is organized such
that row/column 1 represents spatial axis x (parallel to Earth's surface, positive points toward true north),
row/column 2 represents spatial axis y (parallel to Earth's surface, positive points toward the east),
row/column 3 represents spatial axis z (perpendicular to Earth's surface, positive points upward), and
row/column 4 represents the temporal axis. The element at row i, column j of the covariance matrix is
represented by the element at index i * 4 + j in the vector (i.e. the vector is filled from the matrix in
row-major order). If the most recent simulated constellation was not sufficient to produce a position solution or
if no predictions have been simulated, then all elements of the vector will be NaN.
getDops()
getDops():
ReadonlyFloat64Array
Defined in: src/sdk/instruments/GPSSat.ts:260
Gets the dilution of precision values calculated from the satellite constellation used to produce a position
solution in the most recent prediction simulated by this context, as [PDOP, HDOP, VDOP].
Returns
The dilution of precision values calculated from the satellite constellation used to produce a position
solution in the most recent prediction simulated by this context, as [PDOP, HDOP, VDOP]. If the most recent
simulated constellation was not sufficient to produce a position solution or if no predictions have been
simulated, then all elements of the vector will be -1.
getLatLon()
getLatLon():
GeoPointReadOnly
Defined in: src/sdk/instruments/GPSSat.ts:203
Gets the latitude/longitude coordinates of this context's receiver.
Returns
The latitude/longitude coordinates of this context's receiver.
getSatellites()
getSatellites(): readonly
GPSPredictionSatellite[]
Defined in: src/sdk/instruments/GPSSat.ts:197
Gets the satellites simulated by this context.
Returns
readonly GPSPredictionSatellite[]
The satellites simulated by this context.
getTime()
getTime():
number
Defined in: src/sdk/instruments/GPSSat.ts:215
Gets the time point of this context's receiver, as a Javascript timestamp.
Returns
number
The time point of this context's receiver, as a Javascript timestamp.
isParentAlamanacValid()
isParentAlamanacValid(
time?):boolean
Defined in: src/sdk/instruments/GPSSat.ts:225
Checks whether this context's parent GPSSatComputer instance has access to valid downloaded almanac data that are up to date for a given time.
Parameters
| Parameter | Type | Description |
|---|---|---|
time? | number | The time for which to check for almanac validity, as a Javascript timestamp. Defaults to the current time point of this context's receiver. |
Returns
boolean
Whether this context's parent GPSSatComputer instance has access to valid downloaded almanac data that are up to date for the specified time.
predict()
predict():
this
Defined in: src/sdk/instruments/GPSSat.ts:350
Simulates a predicted satellite constellation and receiver state. The prediction uses this context's current
parameters. After the prediction has been simulated, the predicted satellite state can be accessed by using
getSatellites(), and the predicted receiver state can be accessed by using getAvailableDiffCorrections(),
getCovarMatrix(), and getDops(). This method does nothing if this context has not been initialized.
Returns
this
This context, after the prediction has been simulated.
Throws
Error if this context has been destroyed.
setEnabledSbasGroups()
setEnabledSbasGroups(
groups):this
Defined in: src/sdk/instruments/GPSSat.ts:300
Sets the SBAS groups that are enabled in this context. SBAS satellites that belong to groups that are not enabled are inhibited from being tracked by this context's receiver and cannot be used for position determination or differential correction download. This will also disable syncing of these groups from this context's parent GPSSatComputer instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
groups | Iterable<string> | The enabled SBAS groups to set. |
Returns
this
This context, after the enabled SBAS groups have been set.
Throws
Error if this context has been destroyed.
setPosition()
setPosition(
lat,lon,altitude,time):this
Defined in: src/sdk/instruments/GPSSat.ts:340
Sets the spatial and temporal location of this context's receiver.
Parameters
| Parameter | Type | Description |
|---|---|---|
lat | number | The latitude of the position to set, in degrees. |
lon | number | The longitude of the position to set, in degrees. |
altitude | number | The altitude of the position to set, in meters. |
time | number | The time of the position to set, as a Javascript timestamp. |
Returns
this
This context, after the position has been set.
Throws
Error if this context has been destroyed.
setSatelliteInhibit()
setSatelliteInhibit(
prn,inhibit):this
Defined in: src/sdk/instruments/GPSSat.ts:320
Sets whether a satellite is manually inhibited. Inhibited satellites cannot be tracked, and therefore cannot be used for position determination or (in the case of SBAS satellites) differential correction download. This will also disable syncing of inhibited satellites from this context's parent GPSSatComputer instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
prn | number | The PRN (pseudo-random noise) code of the satellite to change. |
inhibit | boolean | Whether the satellite should be inhibited. |
Returns
this
This context, after the satellite inhibit state has been changed.
Throws
Error if this context has been destroyed.
setSatelliteSelectionParams()
setSatelliteSelectionParams(
satInUseMaxCount,satInUsePdopTarget,satInUseOptimumCount):this
Defined in: src/sdk/instruments/GPSSat.ts:276
Sets the parameters for this context to use when selecting satellites to use for position solution calculations. This will also disable syncing of these parameters from this context's parent GPSSatComputer instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
satInUseMaxCount | number | The maximum number of satellites to use for position solution calculations. |
satInUsePdopTarget | number | The maximum PDOP to target when selecting satellites to use for position solution calculations. Additional satellites will be selected while PDOP is greater than the target or the number of selected satellites is less than the optimum count (satInUseOptimumCount). Values less than or equal to zero will cause all possible satellites to be selected up to the maximum count (satInUseMaxCount). |
satInUseOptimumCount | number | The optimum number of satellites to use for position solution calculations when targeting a maximum PDOP value. Additional satellites will be selected while PDOP is greater than the target (satInUsePdopTarget) or the number of selected satellites is less than the optimum count. |
Returns
this
This context, after the parameters have been set.
Throws
Error if this context has been destroyed.
syncEnabledSbasGroupsWithParent()
syncEnabledSbasGroupsWithParent():
this
Defined in: src/sdk/instruments/GPSSat.ts:309
Syncs the SBAS groups that are enabled in this context with those used by this context's parent GPSSatComputer instance. While sync is enabled, any changes to the enabled groups on the parent will also be reflected in this context's enabled groups.
Returns
this
This context, after the sync has been enabled.
Throws
Error if this context has been destroyed.
syncSatelliteInhibitWithParent()
syncSatelliteInhibitWithParent():
this
Defined in: src/sdk/instruments/GPSSat.ts:329
Syncs manually inhibited satellites in this context with those in this context's parent GPSSatComputer instance. While sync is enabled, any changes to inhibited satellites on the parent will also be reflected in this context's inhibited satellites.
Returns
this
This context, after the sync has been enabled.
Throws
Error if this context has been destroyed.
syncSatelliteSelectionParamsWithParent()
syncSatelliteSelectionParamsWithParent():
this
Defined in: src/sdk/instruments/GPSSat.ts:289
Syncs the parameters for this context to use when selecting satellites to use for position solution calculations with the values used by this context's parent GPSSatComputer instance. While sync is enabled, any changes to these parameters on the parent will also be reflected in this context's parameters.
Returns
this
This context, after the sync has been enabled.
Throws
Error if this context has been destroyed.