gps_helper¶
-
class
gps_helper.gps_helper.GPSDataSource(gps_tle_file, rx_sv_list=('PRN 03', 'PRN 09', 'PRN 22', 'PRN 26'), ref_lla=(38.8454167, -104.7215556, 1903.0), ts=1.0)[source]¶ Obtain GPS SV position in ECEF via TLEs and SGP4 orbit propagation. Additionally integrate user trajectories in ENU about an input lla location. The resulting data sets
Mark Wickert January 2018
-
GPS_sv_dict= None¶ Initialize Four SGP4 satellite objects in tuple satellite
-
Rx_sv_list= None¶ Perform coordinate conversion
-
create_sv_data_set(yr2, mon, day, hr, minute)[source]¶ This method returns a numpy ndarrays containing target TDOA in seconds, FDOA in Hz, and the time span in minutes
yr2 : year as two digit integer, e.g., 2018 <=> 18) mon : month as two digit integer day : day as two digits, but can include fractional values hr : hour as two digits, but can include fractional values minute : minute as two digits, but can include fractional values sec : second as two digit integer, but can include fractional values; seconds default is 0
- SV_Pos : A 3D ndarray containing the SV (x,y,x) position values (columns) for each of 4
- satellites (rows) in meters corresponding to the times in t (slice)
- SV_Vel : A 3D ndarray containing the SV (x,y,x) velocity values (columns) for each of 4
- satellites (rows) in meters corresponding to the times in t (slice)
-
days2mdh(year, days)[source]¶ This function converts the day of the year, days, to the equivalent month day, hour, minute and second. From Vallado’s original code translated to Python.
year : The year as a four digit number, e.g., 2013 days : day of the year as a decimal number
mo : month as two digit integer day : day as two digits hour : hour as two digits minute : minute as two digits, sec : second as two digit integer, but can include fractional values
A support function in the class, currently not utilized by any methods.
-
earth_model()[source]¶ Define the constants from the WGS-84 ellipsoidal Earth model.
None
a : semi-major axis of the Earth ellipsoid model f : flattening
The World Geodetic System (WGS) is a standard for use in cartography, geodesy, and navigation. The latest revision is WGS-84.
-
get_gps_sv(tle)[source]¶ Place a text file of Celestrak GPS TLEs into a dictionary with keys of the form ‘PRN xx’ for the SV of interest
Parameters: tle – Two line element set as a file. Returns: dict
-
gstime(jdut1)[source]¶ This method converts the Julian date to Greenwich sidereal time (gst)
jut1 : Julian date
gst : Greenwich sidereal time
A support function from the original David Vallado SGP4 recoded to Python. This is a private method.
>>> # Inside propagate_ecf() make this call: >>> gst = self.gstime(jday(year,mon,day,hr,minute,sec));
-
llh2ecef(llh)[source]¶ Convert lat,lon,hgt geographic coords to X,Y,Z Earth Centered Earth Fixed (ecef) or just (ecf) coords.
llh : A three element ndarray containing latitude(lat), longitude (lon), and altitude (a) or height (hgt), all in meters
x : The ecef x coordinate y : The ecef y coordinate z : The ecef z coordinate
This is a private function that computes: N = a/sqrt( 1 - f*(2-f)*sin(lat)*sin(lat) ) X = (N + h)*cos(lat)*cos(lon) Y = (N + h)*cos(lat)*sin(lon) Z = ((1-f)^2 * N + h)*sin(lat) by also calling EarthModel()
-
propagate_ecef(satellite, year, mon, day, hr, minute, sec)[source]¶ This method is responsible for propagating the satellite object, denoted satellite, to a specified GMT time. Coded to Python from the work of Charles Rino, (c) 2010, in MATLAB. See the function body details.
satellite : Input satellite object created by the sgp4 method twolinerv() year : year as four digit integer, e.g., 2013 mon : month as two digit integer day : day as two digits, but can include fractional values hr : hour as two digits, but can include fractional values minute : minute as two digits, but can include fractional values sec : second as two digit integer, but can include fractional values
xsat_ecef : Satellite position in ECF coordinates vsat_ecef : Satellite velocity in ECF coordinates gst : Greenwich sidereal time
This is a private function used only by the class. When the class constructor is called, primary and secondary satellite objects are created using the input TLEs, e.g., self.sat_primary = twoline2rv(self.tle_primary[0],
self.tle_primary[1],wgs84)self.sat_secondary = twoline2rv(self.tle_secondary[0],self.tle_secondary[1],wgs84) The function propagate_ecf is used in all calculations where TDOA and FDOA are calculated.
>>> # As called from r_r_dot_ecf >>> position, velocity, gst = self.propagate_ecef(sv,2000+yr2, mon,day,hr, minute,sec)
-
ref_ecef= None¶ Read GPS TLEs into dictionary
-
-
gps_helper.gps_helper.ecef2enu(r_ecef, r_ref, phi_ref, lam_ref)[source]¶ Convert ECEF coordinates to ENU using an ECEF reference location r_ref having lat = phi_ref and lon = lam_ref
-
gps_helper.gps_helper.enu2ecef(r_enu, r_ref, phi_ref, lam_ref)[source]¶ Convert ENU coordinates to ECEF using an ECEF reference location r_ref having lat = phi_ref and lon = lam_ref
-
gps_helper.gps_helper.sv_user_traj_3d(gps_ds, sv_pos, user_pos, ele=20, azim=20)[source]¶ [summary]
- GPS_ds : {[type]}
- [description]
- SV_Pos : {[type]}
- [description]
- USER_Pos : {[type]}
- [description]
- ele : {[type]}, optional
- [description] (the default is 20, which [default_description])
- azim : {[type]}, optional
- [description] (the default is 20, which [default_description])