|
| 1 | +# Copyright (C) 2016 Swift Navigation Inc. |
| 2 | +# |
| 3 | +# This source is subject to the license found in the file 'LICENSE' which must |
| 4 | +# be be distributed together with this source. All other rights reserved. |
| 5 | +# |
| 6 | +# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, |
| 7 | +# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED |
| 8 | +# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. |
| 9 | + |
| 10 | +from time cimport * |
| 11 | +from time import GpsTime |
| 12 | + |
| 13 | +def calc_iono_correction(GpsTime t, lat, lon, azimuth, elevation, alpha, beta): |
| 14 | + """ |
| 15 | + Wraps function :libswiftnav:`calc_ionosphere`. |
| 16 | +
|
| 17 | + Parameters |
| 18 | + ---------- |
| 19 | + t : GpsTime |
| 20 | + GPS time for iono computation (only time of day used) |
| 21 | + lat, lon : float |
| 22 | + User latitude and longitude (rad) |
| 23 | + elevation, azimuth : float |
| 24 | + Satellite az-el (rad) |
| 25 | + alpha, beta : (float, float, float, float) |
| 26 | + ionospheric parameters |
| 27 | +
|
| 28 | + Returns |
| 29 | + ------- |
| 30 | + out : float |
| 31 | + Ionospheric delay in meters |
| 32 | +
|
| 33 | + """ |
| 34 | + assert len(alpha) == 4 and len(beta) == 4, "Ionospheric parameter vectors alpha and beta must have 4 elements each." |
| 35 | + |
| 36 | + cdef ionosphere_t i |
| 37 | + |
| 38 | + i.a0, i.a1, i.a2, i.a3 = alpha[0], alpha[1], alpha[2], alpha[3] |
| 39 | + i.b0, i.b1, i.b2, i.b3 = beta[0], beta[1], beta[2], beta[3] |
| 40 | + return calc_ionosphere(&t._thisptr, |
| 41 | + lat, lon, |
| 42 | + azimuth, elevation, |
| 43 | + &i); |
0 commit comments