gnssconstellation

Satellite locations at specified time

Description

example

[satPos,satVel] = gnssconstellation(t) returns the satellite positions and velocities at the datetime t. The function returns positions and velocities in the Earth-centered Earth-fixed (ECEF) coordinate system in meters and meters per second, respectively.

Examples

collapse all

Get the current satellite positions and velocities from the GNSS satellites. Access the orbital parameters from IS-GPS-200K Interface Specification and calculate the position and velocities in ECEF coordinates for the given time. Display the satellite positions.

t = datetime('now','TimeZone','Local');
[satPos,satVel] = gnssconstellation(t);
disp(satPos)
1.0e+07 *

-1.7794    1.9533    0.2690
1.4448    0.5960   -2.1474
-0.5397   -1.6181    2.0358
0.5173   -2.2123    1.3756
2.4992    0.7317   -0.5224
2.5982   -0.0133    0.5509
-0.3244    1.4911   -2.1739
-1.5613   -1.3871    1.6408
-1.6276    1.0500   -1.8173
0.1195    2.4073   -1.1158
1.6721    0.3470    2.0342
1.1933   -1.0393    2.1330
-1.3997   -2.1376   -0.7250
-1.9321    0.4552   -1.7647
1.9695   -1.5908    0.8028
1.5782   -2.1331   -0.1156
-0.2861    2.1293    1.5615
-1.2991   -0.8077   -2.1712
1.3495   -1.1877   -1.9551
1.8215    1.2854    1.4437
-2.5959    0.0212    0.5615
0.5747    1.5527    2.0768
1.4450    2.0722   -0.8198
-1.5571    0.1527    2.1462
-1.0651    1.2615    2.0805
-0.3184   -2.4816   -0.8913
0.5752   -1.8973   -1.7673

Use the lookangles function to get the azimuth and elevation angles of satellites for given satellite and receiver positions. Specify a mask angle of 5 degrees. Get the satellite positions using the gnssconstellation function.

Specify a receiver position in geodetic coordinates (latitude, longitude, altitude).

recPos = [42 -71 50];

Get the satellite positions for the current time.

t = datetime('now');
gpsSatPos = gnssconstellation(t);

Specify a mask angle of 5 degrees.

Get the azimuth and elevation look angles for the satellite positions. The vis output indicates which satellites are visible. Get the total using nnz.

fprintf('%d satellites visible at %s.\n',nnz(vis),t);
8 satellites visible at 23-Oct-2021 11:12:39.

Input Arguments

collapse all

Current time for the satellite simulation, specified as a scalar datetime array.

The default time zone for a datetime array is UTC. For information on specifying a different time zone, see datetime.

GPS start time is Jan 6, 1980 midnight, UTC. Specifying any datetime prior to this time will use the GPS start time.

Example: datetime('now','TimeZone','Local');

Data Types: datetime

Output Arguments

collapse all

Satellite positions in the Earth-centered Earth-fixed (ECEF) coordinate system in meters, returned as an N-by-3 matrix of scalars. N is the number of satellites in the constellation.

Data Types: single | double

Satellite velocities in the Earth-centered Earth-fixed (ECEF) coordinate system in meters per second, returned as an N-by-3 matrix of scalars. N is the number of satellites in the constellation.

Data Types: single | double

collapse all

Orbital Parameters

The initial satellite positions and velocities are defined by orbital parameters in Table A.2-2 in GPS SPS Performance Standard, and are given in Earth-centered Earth-fixed (ECEF) coordinates.

Position calculations use equations from Table 30-II in the same IS-GPS-200K Interface Specification.

Velocity calculations use equations 8.21–8.27 in .

 Groves, Paul D. Principles of GNSS, Inertial, and Multisensor Integrated Navigation Systems. Boston: Artech House, 2013.