pygnss 0.1.0__cp312-cp312-musllinux_1_2_x86_64.whl → 0.2.0__cp312-cp312-musllinux_1_2_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pygnss might be problematic. Click here for more details.
- pygnss/__init__.py +1 -1
- pygnss/_c_ext/src/hatanaka.c +4 -2
- pygnss/_c_ext.cpython-312-x86_64-linux-musl.so +0 -0
- pygnss/filter/__init__.py +2 -2
- pygnss/filter/ekf.py +6 -3
- pygnss/filter/ukf.py +6 -3
- pygnss/hatanaka.py +19 -3
- {pygnss-0.1.0.dist-info → pygnss-0.2.0.dist-info}/METADATA +3 -16
- {pygnss-0.1.0.dist-info → pygnss-0.2.0.dist-info}/RECORD +27 -27
- {pygnss-0.1.0.dist-info → pygnss-0.2.0.dist-info}/LICENSE +0 -0
- {pygnss-0.1.0.dist-info → pygnss-0.2.0.dist-info}/WHEEL +0 -0
- {pygnss-0.1.0.dist-info → pygnss-0.2.0.dist-info}/entry_points.txt +0 -0
- {pygnss-0.1.0.dist-info → pygnss-0.2.0.dist-info}/top_level.txt +0 -0
pygnss/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.
|
|
1
|
+
__version__ = "0.2.0"
|
pygnss/_c_ext/src/hatanaka.c
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
#include "hatanaka/include/crx2rnx.h"
|
|
5
5
|
|
|
6
|
-
static const int N_FIELDS = 4; // Number of fields for struct gnss_meas
|
|
7
6
|
|
|
8
7
|
static char* get_crx_line(void* _args, size_t n_max, char* dst) {
|
|
9
8
|
|
|
@@ -21,6 +20,8 @@ static bool is_eof(void* _args) {
|
|
|
21
20
|
|
|
22
21
|
static int on_measurement(const struct gnss_meas* gnss_meas, void* _args) {
|
|
23
22
|
|
|
23
|
+
static const int N_FIELDS = 5; // Number of fields for struct gnss_meas
|
|
24
|
+
|
|
24
25
|
int ret = -1;
|
|
25
26
|
PyObject* list = (PyObject*)_args;
|
|
26
27
|
|
|
@@ -41,10 +42,11 @@ static int on_measurement(const struct gnss_meas* gnss_meas, void* _args) {
|
|
|
41
42
|
PyList_SetItem(row, 1, PyUnicode_FromStringAndSize(gnss_meas->satid, 3));
|
|
42
43
|
PyList_SetItem(row, 2, PyUnicode_FromStringAndSize(gnss_meas->rinex3_code, 3));
|
|
43
44
|
PyList_SetItem(row, 3, PyFloat_FromDouble(gnss_meas->value));
|
|
45
|
+
PyList_SetItem(row, 4, PyLong_FromUnsignedLong(gnss_meas->lli));
|
|
44
46
|
|
|
45
47
|
// Add inner lists to the outer list
|
|
46
48
|
PyList_Append(list, row);
|
|
47
|
-
Py_DECREF(row);
|
|
49
|
+
Py_DECREF(row); // Decrement the reference count of 'row'
|
|
48
50
|
|
|
49
51
|
ret = 0;
|
|
50
52
|
exit:
|
|
Binary file
|
pygnss/filter/__init__.py
CHANGED
|
@@ -33,7 +33,7 @@ class Model(ABC):
|
|
|
33
33
|
"""
|
|
34
34
|
|
|
35
35
|
@abstractmethod
|
|
36
|
-
def to_observations(self, state: np.array, compute_jacobian: bool = False) -> ModelObs:
|
|
36
|
+
def to_observations(self, state: np.array, compute_jacobian: bool = False, **kwargs) -> ModelObs:
|
|
37
37
|
"""
|
|
38
38
|
Propagate a state to its corresponding modelled observations (i.e.
|
|
39
39
|
compute expected observations/measurements for the input state)
|
|
@@ -56,7 +56,7 @@ class StateHandler(ABC):
|
|
|
56
56
|
"""
|
|
57
57
|
|
|
58
58
|
@abstractmethod
|
|
59
|
-
def process_state(self, state: np.array, covariance_matrix: np.array):
|
|
59
|
+
def process_state(self, state: np.array, covariance_matrix: np.array, **kwargs):
|
|
60
60
|
"""
|
|
61
61
|
Process the state and associated covariance_matrix
|
|
62
62
|
"""
|
pygnss/filter/ekf.py
CHANGED
|
@@ -36,7 +36,7 @@ class Ekf(object):
|
|
|
36
36
|
|
|
37
37
|
self.L = len(self.x)
|
|
38
38
|
|
|
39
|
-
def process(self, y_k: np.array, R: np.array):
|
|
39
|
+
def process(self, y_k: np.array, R: np.array, **kwargs):
|
|
40
40
|
"""
|
|
41
41
|
Process an observation batch
|
|
42
42
|
"""
|
|
@@ -45,7 +45,7 @@ class Ekf(object):
|
|
|
45
45
|
x_m, P_m = self._time_update()
|
|
46
46
|
|
|
47
47
|
# Measurement update ---------------------------------------------------
|
|
48
|
-
y_m, H = self.model.to_observations(x_m, compute_jacobian=True)
|
|
48
|
+
y_m, H = self.model.to_observations(x_m, compute_jacobian=True, **kwargs)
|
|
49
49
|
|
|
50
50
|
P_yy = H @ P_m @ H.T + R
|
|
51
51
|
P_xy = P_m @ H.T
|
|
@@ -62,7 +62,10 @@ class Ekf(object):
|
|
|
62
62
|
except np.linalg.LinAlgError as e:
|
|
63
63
|
self.logger.warning(f'Unable to compute state, keeping previous one. Error: {e}')
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
# Compute postfit residuals
|
|
66
|
+
r = y_k - self.model.to_observations(self.x, **kwargs).y_m
|
|
67
|
+
|
|
68
|
+
self.state_handler.process_state(self.x, self.P, postfits=r, **kwargs)
|
|
66
69
|
|
|
67
70
|
def _time_update(self) -> Tuple[np.array, np.array]:
|
|
68
71
|
"""
|
pygnss/filter/ukf.py
CHANGED
|
@@ -60,7 +60,7 @@ class Ukf(object):
|
|
|
60
60
|
self.w_m[0] = k
|
|
61
61
|
self.w_c[0] = k + 1 - alpha2 + beta
|
|
62
62
|
|
|
63
|
-
def process(self, y_k: np.array, R: np.array):
|
|
63
|
+
def process(self, y_k: np.array, R: np.array, **kwargs):
|
|
64
64
|
"""
|
|
65
65
|
Process an observation batch
|
|
66
66
|
|
|
@@ -85,7 +85,7 @@ class Ukf(object):
|
|
|
85
85
|
P_m = self.Q + _weighted_average_of_outer_product(spread_chi_m, spread_chi_m, self.w_c)
|
|
86
86
|
|
|
87
87
|
# Propagate the sigma points to the observation space (psi_m, $\mathcal{Y}_{k|k-1}$)
|
|
88
|
-
psi_m = np.array([self.model.to_observations(sigma_point).y_m for sigma_point in chi_m])
|
|
88
|
+
psi_m = np.array([self.model.to_observations(sigma_point, **kwargs).y_m for sigma_point in chi_m])
|
|
89
89
|
n_dim = len(psi_m.shape)
|
|
90
90
|
if n_dim == 1:
|
|
91
91
|
raise ValueError(f'Unexpected size for sigma point propagation, got [ {n_dim} ], '
|
|
@@ -115,7 +115,10 @@ class Ukf(object):
|
|
|
115
115
|
except np.linalg.LinAlgError as e:
|
|
116
116
|
self.logger.warning(f'Unable to compute state, keeping previous one. Error: {e}')
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
# Compute postfit residuals
|
|
119
|
+
r = y_k - self.model.to_observations(self.x, **kwargs).y_m
|
|
120
|
+
|
|
121
|
+
self.state_handler.process_state(self.x, self.P, postfits=r, **kwargs)
|
|
119
122
|
|
|
120
123
|
def _generate_sigma_points(self) -> np.array:
|
|
121
124
|
"""
|
pygnss/hatanaka.py
CHANGED
|
@@ -4,10 +4,15 @@ import tempfile
|
|
|
4
4
|
|
|
5
5
|
from pygnss._c_ext import _read_crx
|
|
6
6
|
|
|
7
|
-
def to_dataframe(filename:str, station:str = "none") -> pd.DataFrame:
|
|
7
|
+
def to_dataframe(filename:str, station:str = "none", strict_lli: bool = True) -> pd.DataFrame:
|
|
8
8
|
"""
|
|
9
9
|
Convert a Compressed (crx.gz) or uncompressed (crx) Hatanaka file into a
|
|
10
10
|
DataFrame
|
|
11
|
+
|
|
12
|
+
:param filename: Hatanaka [gzip compressed] filename
|
|
13
|
+
:param station: force station name
|
|
14
|
+
:param strict_lli: Mark cycle slips only when Phase LLI is 1 (as per RINEX convention).
|
|
15
|
+
If False, any value of Phase LLI will trigger a cycle slip flag
|
|
11
16
|
"""
|
|
12
17
|
|
|
13
18
|
if filename.endswith('crx.gz') or filename.endswith('crx.Z') or filename.endswith('crz'):
|
|
@@ -23,13 +28,24 @@ def to_dataframe(filename:str, station:str = "none") -> pd.DataFrame:
|
|
|
23
28
|
else:
|
|
24
29
|
array = _read_crx(filename)
|
|
25
30
|
|
|
26
|
-
df = pd.DataFrame(array, columns=['epoch', 'sat', 'rinex3_code', 'value'])
|
|
31
|
+
df = pd.DataFrame(array, columns=['epoch', 'sat', 'rinex3_code', 'value', 'lli'])
|
|
27
32
|
df['channel'] = df['rinex3_code'].str[-2:]
|
|
28
33
|
df['signal'] = df['sat'] + df['channel']
|
|
29
34
|
MAPPING = {'C': 'range', 'L': 'phase', 'D': 'doppler', 'S': 'snr'}
|
|
30
35
|
df['obstype'] = df['rinex3_code'].str[0].map(lambda x: MAPPING.get(x, 'Unknown'))
|
|
31
|
-
df = df.pivot_table(index=['epoch', 'signal', 'sat', 'channel'], columns=['obstype'], values='value')
|
|
36
|
+
df = df.pivot_table(index=['epoch', 'signal', 'sat', 'channel'], columns=['obstype'], values=['value', 'lli'])
|
|
37
|
+
|
|
38
|
+
# Remove all LLI columns except for the phase (for the cycle slips)
|
|
39
|
+
if strict_lli:
|
|
40
|
+
df['cslip'] = (df.loc[:, pd.IndexSlice['lli', 'phase']] % 2) == 1
|
|
41
|
+
else:
|
|
42
|
+
df['cslip'] = df.loc[:, pd.IndexSlice['lli', 'phase']] > 0
|
|
43
|
+
|
|
44
|
+
df.drop('lli', axis=1, inplace=True)
|
|
45
|
+
df.columns = [v[1] if v[0] == 'value' else v[0] for v in df.columns.values]
|
|
46
|
+
|
|
32
47
|
df.reset_index(inplace=True)
|
|
48
|
+
|
|
33
49
|
df['station'] = station
|
|
34
50
|
|
|
35
51
|
return df
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: pygnss
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Package with utilities and tools for GNSS data processing
|
|
5
5
|
Author-email: Miquel Garcia-Fernandez <miquel@mgfernan.com>
|
|
6
6
|
License: MIT
|
|
@@ -18,19 +18,13 @@ Requires-Dist: flake8>=7.0.0; extra == "test"
|
|
|
18
18
|
Provides-Extra: release
|
|
19
19
|
Requires-Dist: python-semantic-release>=9.4.0; extra == "release"
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
Python tools used in internal Rokubun projects. This repository contains the following modules:
|
|
24
|
-
|
|
25
|
-
- `logger`, a module that extends basic Python logging
|
|
26
|
-
- `geodetic`, to perform basic geodetic transformation (Cartesian to Geodetic,
|
|
27
|
-
Cartesian to Local Tangential Plane, ...)
|
|
21
|
+
# GNSS and Navigation modules
|
|
28
22
|
|
|
29
23
|
## Installation
|
|
30
24
|
|
|
31
25
|
To make sure that the extensions are installed along with the package, run
|
|
32
26
|
|
|
33
|
-
`pip install pygnss
|
|
27
|
+
`pip install pygnss`
|
|
34
28
|
|
|
35
29
|
## Modules
|
|
36
30
|
|
|
@@ -58,10 +52,3 @@ Traceback (most recent call last):
|
|
|
58
52
|
...
|
|
59
53
|
ValueError: Exception message
|
|
60
54
|
```
|
|
61
|
-
|
|
62
|
-
## Deployment to PyPi
|
|
63
|
-
|
|
64
|
-
The project is published automatically using internal Gitlab CI on each commit to `trunk` to PyPi repository [pygnss](https://pypi.org/project/pygnss/)
|
|
65
|
-
|
|
66
|
-
It uses semantic versioning and conventional commits to set the version and [semantic-release](https://python-semantic-release.readthedocs.io/en/latest/index.html) as
|
|
67
|
-
versioning tool.
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
pygnss/
|
|
2
|
-
pygnss/
|
|
3
|
-
pygnss/
|
|
1
|
+
pygnss-0.2.0.dist-info/LICENSE,sha256=Wwany6RAAZ9vVHjFLA9KBJ0HE77d52s2NOUA1CPAEug,1067
|
|
2
|
+
pygnss-0.2.0.dist-info/WHEEL,sha256=c9GU1jhDUn7S-APtjPhve05mT2FAOW_4NMGdpCIyIBM,112
|
|
3
|
+
pygnss-0.2.0.dist-info/METADATA,sha256=Hak3b6_DXaFefbHOylzU0BfjjErmA7MxzZhbTqzSdks,1614
|
|
4
|
+
pygnss-0.2.0.dist-info/top_level.txt,sha256=oZRSR-qOv98VW2PRRMGCVNCJmewcJjyJYmxzxfeimtg,7
|
|
5
|
+
pygnss-0.2.0.dist-info/RECORD,,
|
|
6
|
+
pygnss-0.2.0.dist-info/entry_points.txt,sha256=mCuKrljB_wh9ZQVROiId9m68EDbTiY1oef_L1N3IDDA,262
|
|
4
7
|
pygnss/sinex.py,sha256=nErOmGCFFmGSnmWGNTJhaj3yZ6IIB8GgtW5WPypJc6U,3057
|
|
8
|
+
pygnss/file.py,sha256=kkMBWjoTPkxJD1UgH0mXJT2fxnhU8u7_l2Ph5Xz2-hY,933
|
|
9
|
+
pygnss/__init__.py,sha256=Zn1KFblwuFHiDRdRAiRnDBRkbPttWh44jKa5zG2ov0E,22
|
|
5
10
|
pygnss/geodetic.py,sha256=gfVsOeEKLn2RaJYpaCk0OrQpYz6QiDPMX6PoJHEaP9Q,34029
|
|
6
11
|
pygnss/cl.py,sha256=ISmd2RjikUMmj3nLPN0VSjvQLG5rLizp2X2ajeBkoDE,4509
|
|
12
|
+
pygnss/constants.py,sha256=1hF6K92X6E6Ofo0rAuCBCgrwln9jxio26RV2a6vyURk,133
|
|
13
|
+
pygnss/decorator.py,sha256=ldlZuvwuIlJf2pkoWteyXyp5tLds8KRkphrPsrURw9U,491
|
|
7
14
|
pygnss/tensorial.py,sha256=aA0-0WK2MXhDUg0_8HMbECOt9cXmp3EnKFQXjdYMBXA,1598
|
|
8
15
|
pygnss/time.py,sha256=YdMNs2xA43LrSgEOgB7jpEq0dCWv89fUBF5syDLjbu0,11178
|
|
9
|
-
pygnss/
|
|
10
|
-
pygnss/
|
|
16
|
+
pygnss/hatanaka.py,sha256=P9XG6bZwUzfAPYn--6-DXfFQIEefeimE7fMJm_DF5zE,1951
|
|
17
|
+
pygnss/_c_ext.cpython-312-x86_64-linux-musl.so,sha256=HIZmPjMg3D5ZISMjeWWIsqK-MCepnPHQLwPJnAYO82Q,83184
|
|
11
18
|
pygnss/stats.py,sha256=mDiY0K-VTndlFEkbxTzq9PYxCOjYDYsY3ZQV0PuMREM,1924
|
|
12
|
-
pygnss/
|
|
13
|
-
pygnss/
|
|
14
|
-
pygnss/
|
|
19
|
+
pygnss/rinex.py,sha256=LsOOh3Fc263kkM8KOUBNeMeIAmbOn2ASSBO4rAUJWj8,68783
|
|
20
|
+
pygnss/logger.py,sha256=4kvcTWXPoiG-MlyP6B330l4Fu7MfCuDjuIlIiLA8f1Y,1479
|
|
21
|
+
pygnss/gnss/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
+
pygnss/gnss/types.py,sha256=lmL15KRckRiTwVkYvGzF4c1BrojnQlegrYCXSz1hGaI,10377
|
|
23
|
+
pygnss/gnss/observables.py,sha256=0x0NLkTjxf8cO9F_f_Q1b-1hEeoNjWB2x-53ecUEv0M,1656
|
|
24
|
+
pygnss/gnss/edit.py,sha256=T1r0WbJmt8tLJpG_IIsy4Atej6cy0IStBaSGxw0S5ho,1884
|
|
25
|
+
pygnss/gnss/residuals.py,sha256=8qKGNOYkrqxHGOSjIfH21K82PAqEh2068kf78j5usL8,1244
|
|
26
|
+
pygnss/filter/ukf.py,sha256=koaal4aLyYtYwPhVIvjn4uXsmSDDOQnnFEv4xenryqo,10646
|
|
27
|
+
pygnss/filter/__init__.py,sha256=0gGBaZZgaFSiTxt0Mycn0oGZjJyATo8AAAgXhxh9k6c,1850
|
|
28
|
+
pygnss/filter/ekf.py,sha256=D-qtalFRguVj4HcOtCtE0lGGXtVibC7qg-AZhKjmwgM,2017
|
|
15
29
|
pygnss/filter/models.py,sha256=gXq7-YBcAoDq4-7Wr0ChNWxwXr9m1EEhUnlLtKVlsAQ,2165
|
|
16
|
-
pygnss/
|
|
17
|
-
pygnss/filter/ekf.py,sha256=wtjjXbeJ7_MSL32dMsoTcppEAaWvqMNuDIcMmDCwyFQ,1871
|
|
18
|
-
pygnss/filter/ukf.py,sha256=wEgDKV6VpEIIZl2KG3sLT0HA-K8yAw9UI0WlA1gyYm0,10500
|
|
19
|
-
pygnss/_c_ext/src/mtable_init.c,sha256=5w869E6PX-ca9UHhKBxLFRW694-VaNwGlMs0I5v99mk,1132
|
|
20
|
-
pygnss/_c_ext/src/hatanaka.c,sha256=IhQa7s2bwNCVb8ARxmhFDdJ8VzitN2-cpMlCMqRD8Wk,2445
|
|
21
|
-
pygnss/_c_ext/src/helpers.c,sha256=gINr73ktRgox_S7fYdFR58lLqAUACRpJfog4M5BW1-Q,364
|
|
22
|
-
pygnss/parsers/rtklib/stats.py,sha256=YV6yadxMeQMQYZvsUCaSf4ZTpK8Bbv3f2xgu0l4PekA,5449
|
|
30
|
+
pygnss/orbit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
31
|
pygnss/orbit/kepler.py,sha256=QORTgg5yBtsQXxLWSzoZ1pmh-CwPiZlFdIYqhQhv1a0,1745
|
|
24
32
|
pygnss/orbit/tle.py,sha256=6CIEielPgui3DXNv46XxOGlig31ROIwjH42xLGaeE5M,5905
|
|
25
|
-
pygnss/
|
|
26
|
-
pygnss/
|
|
27
|
-
pygnss/
|
|
28
|
-
pygnss/
|
|
29
|
-
pygnss/gnss/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
pygnss/gnss/observables.py,sha256=0x0NLkTjxf8cO9F_f_Q1b-1hEeoNjWB2x-53ecUEv0M,1656
|
|
31
|
-
pygnss-0.1.0.dist-info/LICENSE,sha256=Wwany6RAAZ9vVHjFLA9KBJ0HE77d52s2NOUA1CPAEug,1067
|
|
32
|
-
pygnss-0.1.0.dist-info/WHEEL,sha256=c9GU1jhDUn7S-APtjPhve05mT2FAOW_4NMGdpCIyIBM,112
|
|
33
|
-
pygnss-0.1.0.dist-info/RECORD,,
|
|
34
|
-
pygnss-0.1.0.dist-info/top_level.txt,sha256=oZRSR-qOv98VW2PRRMGCVNCJmewcJjyJYmxzxfeimtg,7
|
|
35
|
-
pygnss-0.1.0.dist-info/entry_points.txt,sha256=mCuKrljB_wh9ZQVROiId9m68EDbTiY1oef_L1N3IDDA,262
|
|
36
|
-
pygnss-0.1.0.dist-info/METADATA,sha256=SC0RWTHDiJbzIZNN4GimNwhH90bRDqbuQSVnvsV_5I4,2240
|
|
33
|
+
pygnss/_c_ext/src/hatanaka.c,sha256=YNWaMzQQQnTNls5J6TMNuyhlq505NGDfzU-MJAHab8Q,2520
|
|
34
|
+
pygnss/_c_ext/src/helpers.c,sha256=gINr73ktRgox_S7fYdFR58lLqAUACRpJfog4M5BW1-Q,364
|
|
35
|
+
pygnss/_c_ext/src/mtable_init.c,sha256=5w869E6PX-ca9UHhKBxLFRW694-VaNwGlMs0I5v99mk,1132
|
|
36
|
+
pygnss/parsers/rtklib/stats.py,sha256=YV6yadxMeQMQYZvsUCaSf4ZTpK8Bbv3f2xgu0l4PekA,5449
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|