laika package
Subpackages
- laika.lib package
- Submodules
- laika.lib.coordinates module
- laika.lib.orientation module
ecef2car()
ecef_euler_from_ned()
euler2quat()
euler2rot()
euler_from_quat()
euler_from_rot()
ned_euler_from_ecef()
quat2euler()
quat2rot()
quat_from_euler()
quat_from_rot()
quat_product()
quats_from_rotations()
rot()
rot2euler()
rot2quat()
rot_from_euler()
rot_from_quat()
rot_matrix()
rotations_from_quats()
- Module contents
Submodules
laika.astro_dog module
- class laika.astro_dog.AstroDog(auto_update=True, cache_dir='/tmp/gnss/', dgps=False, valid_const=('GPS', 'GLONASS'), valid_ephem_types=(<EphemerisType.FINAL_ORBIT: 1>, <EphemerisType.RAPID_ORBIT: 2>, <EphemerisType.ULTRA_RAPID_ORBIT: 3>), clear_old_ephemeris=False)[source]
Bases:
object
auto_update: flag indicating whether laika should fetch files from web automatically cache_dir: directory where data files are downloaded to and cached dgps: flag indicating whether laika should use dgps (CORS)
data to calculate pseudorange corrections
valid_const: list of constellation identifiers laika will try process valid_ephem_types: set of ephemeris types that are allowed to use and download.
Default is set to use all orbit ephemeris types
clear_old_ephemeris: flag indicating if ephemeris for an individual satellite should be overwritten when new ephemeris is added.
- download_parse_orbit(gps_time: GPSTime, skip_before_epoch=None) Dict[str, List[PolyEphemeris]] [source]
laika.constants module
laika.dcb module
laika.dgps module
- class laika.dgps.DGPSDelay(station_id, station_pos, station_delays, station_delays_t, max_distance)[source]
Bases:
object
- laika.dgps.get_closest_station_names(pos, k=5, max_distance=100000, cache_dir='/tmp/gnss/')[source]
laika.downloader module
- laika.downloader.download_and_cache_file(url_base, folder_path: str, cache_dir: str, filename: str, compression='', overwrite=False)[source]
- laika.downloader.download_and_cache_file_return_first_success(url_bases, folder_and_file_names, cache_dir, compression='', overwrite=False, raise_error=False)[source]
- laika.downloader.ftp_download_files(url_base, folder_path, cacheDir, filenames)[source]
Like download file, but more of them. Keeps a persistent FTP connection open to be more efficient.
laika.ephemeris module
- class laika.ephemeris.Ephemeris(prn: str, data, epoch: GPSTime, eph_type: EphemerisType, healthy: bool, max_time_diff: float, file_epoch: Optional[GPSTime] = None, file_name=None)[source]
Bases:
ABC
- class laika.ephemeris.EphemerisSerializer(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]
Bases:
JSONEncoder
- default(o)[source]
Implement this method in a subclass such that it returns a serializable object for
o
, or calls the base implementation (to raise aTypeError
).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
- class laika.ephemeris.EphemerisType(value)[source]
Bases:
IntEnum
An enumeration.
- FINAL_ORBIT = 1
- NAV = 0
- QCOM_POLY = 4
- RAPID_ORBIT = 2
- ULTRA_RAPID_ORBIT = 3
- class laika.ephemeris.PolyEphemeris(prn: str, data, epoch: GPSTime, ephem_type: EphemerisType, file_epoch: Optional[GPSTime] = None, file_name: Optional[str] = None, healthy=True, tgd=0, max_time_diff: int = 3600)[source]
Bases:
Ephemeris
- laika.ephemeris.convert_ublox_glonass_ephem(ublox_ephem, current_time: Optional[datetime] = None)[source]
- laika.ephemeris.convert_ublox_gps_ephem(ublox_ephem, current_time: Optional[datetime] = None)[source]
- laika.ephemeris.parse_sp3_orbits(file_names, supported_constellations, skip_until_epoch: Optional[GPSTime] = None) Dict[str, List[PolyEphemeris]] [source]
laika.gps_time module
- class laika.gps_time.GPSTime(week, tow)[source]
Bases:
object
GPS time class to add and subtract [week, tow]
- property day
- class laika.gps_time.TimeSyncer(mono_time, gps_time)[source]
Bases:
object
Converts logmonotime to gps_time and vice versa
- laika.gps_time.datetime_to_tow(t)[source]
Convert a Python datetime object to GPS Week and Time Of Week. Does not convert from UTC to GPST. Fractional seconds are supported.
Parameters
- tdatetime
A time to be converted, on the GPST timescale.
- mod1024bool, optional
If True (default), the week number will be output in 10-bit form.
Returns
- week, towtuple (int, float)
The GPS week number and time-of-week.
laika.helpers module
- class laika.helpers.ConstellationId(value)[source]
Bases:
IntEnum
An enumeration.
- BEIDOU = 3
- GALILEO = 2
- GLONASS = 6
- GPS = 0
- IMES = 4
- IRNSS = 7
- QZNSS = 5
- SBAS = 1
- class laika.helpers.TimeRangeHolder[source]
Bases:
object
Class to support test if date is in any of the multiple, sparse ranges
- laika.helpers.get_nmea_id_from_constellation_and_svid(constellation: ConstellationId, sv_id: int)[source]
laika.iono module
- class laika.iono.IonexMap(exp, data1, data2)[source]
Bases:
object
- laika.iono.closest_in_list(lst, val, num=2)[source]
Returns two (num in general) closest values of val in list lst
- laika.iono.get_header_body(file_path)[source]
Opens file_path, reads file and returns header and body separated with “END OF HEADER” :param file_path: path to RINEX-like file :return: header, body (arrays of lines)
- laika.iono.get_header_line(headr, proprty)[source]
- Parameters
headr – the header of the RINEX-file
proprty – string-like property to search for (e.g. ‘delta-utc’)
- Returns
the string of the
headr
containingproperty
- laika.iono.get_int_from_header(hdr, seq)[source]
Returns the first int from the line that contains seq of lines hdr. In fact, _header_ here may not be header of RINEX/IONEX, just some set of lines.
- laika.iono.klobuchar(pos, az, el, time, iono_coeffs)[source]
Details are taken from [5]: IS-GPS-200H, Fig. 20-4 Note: result is referred to the GPS L₁ frequency; if the user is operating on the GPS L₂ frequency, the correction term must be multiplied by γ = f₂²/f₁¹ = 0.6071850227694382 :param pos: [lat, lon, alt] in radians and meters
laika.opt module
- laika.opt.calc_pos_fix(measurements, posfix_functions=None, x0=None, no_weight=False, signal='C1C', min_measurements=6)[source]
Calculates gps fix using gauss newton method To solve the problem a minimal of 4 measurements are required.
If Glonass is included 5 are required to solve for the additional free variable.
returns: 0 -> list with positions 1 -> pseudorange errs
- laika.opt.calc_vel_fix(measurements, est_pos, velfix_function=None, v0=None, no_weight=False, signal='D1C', min_measurements=6)[source]
Calculates gps velocity fix using gauss newton method returns: 0 -> list with velocities 1 -> pseudorange_rate errs
- laika.opt.pr_residual(measurements: List[GNSSMeasurement], posfix_functions=None, signal='C1C', no_weight=False, no_nans=False)[source]
- laika.opt.prr_residual(measurements: List[GNSSMeasurement], est_pos, velfix_function=None, signal='D1C', no_weight=False, no_nans=False)[source]
laika.raw_gnss module
- class laika.raw_gnss.GNSSMeasurement(constellation_id: ConstellationId, sv_id: int, recv_time_week: int, recv_time_sec: float, observables: Dict[str, float], observables_std: Dict[str, float], glonass_freq: Optional[Union[int, float]] = None)[source]
Bases:
object
- GLONASS_FREQ = 3
- PR = 4
- PRN = 0
- PRR = 6
- PRR_STD = 7
- PR_STD = 5
- RECV_TIME_SEC = 2
- RECV_TIME_WEEK = 1
- SAT_POS = slice(8, 11, None)
- SAT_VEL = slice(11, 14, None)
- laika.raw_gnss.correct_measurements(measurements: List[GNSSMeasurement], est_pos, dog) List[GNSSMeasurement] [source]
- laika.raw_gnss.process_measurements(measurements: List[GNSSMeasurement], dog) List[GNSSMeasurement] [source]
- laika.raw_gnss.read_raw_ublox(report) List[GNSSMeasurement] [source]
- laika.raw_gnss.read_rinex_obs(obsdata) List[List[GNSSMeasurement]] [source]
laika.rinex_file module
laika.trop module
- laika.trop.saast(pos, el, humi=0.75, temp0=15.0)[source]
- Function from RTKlib: https://github.com/tomojitakasu/RTKLIB/blob/master/src/rtkcmn.c#L3362-3362
with no changes
- Parameters
time – time
pos – receiver position {ecef} m)
el – azimuth/elevation angle {az,el} (rad) – we do not use az
humi – relative humidity
temp0 – temperature (Celsius)
- Returns
tropospheric delay (m)