pygnss 0.1.0__cp313-cp313-musllinux_1_2_i686.whl → 0.2.0__cp313-cp313-musllinux_1_2_i686.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 CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.0"
1
+ __version__ = "0.2.0"
@@ -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); // Decrement the reference count of 'row'
49
+ Py_DECREF(row); // Decrement the reference count of 'row'
48
50
 
49
51
  ret = 0;
50
52
  exit:
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
- self.state_handler.process_state(self.x, self.P)
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
- self.state_handler.process_state(self.x, self.P)
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.1.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
- # pyrok-tools
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*.whl`
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/hatanaka.py,sha256=s8XnJ_ZEm3IknBcUQJU5vW5lKRFpLSlhWQDIsRjB3uo,1286
2
- pygnss/file.py,sha256=kkMBWjoTPkxJD1UgH0mXJT2fxnhU8u7_l2Ph5Xz2-hY,933
3
- pygnss/rinex.py,sha256=LsOOh3Fc263kkM8KOUBNeMeIAmbOn2ASSBO4rAUJWj8,68783
1
+ pygnss-0.2.0.dist-info/LICENSE,sha256=Wwany6RAAZ9vVHjFLA9KBJ0HE77d52s2NOUA1CPAEug,1067
2
+ pygnss-0.2.0.dist-info/WHEEL,sha256=_cnBs0VTJSy6TRwvMOZQ_5mpn0qxt2Jp1Y6Uq6s1G8k,110
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
10
+ pygnss/_c_ext.cpython-313-i386-linux-musl.so,sha256=193Nq6KeqZmDxhsp3JEekQtQ6G6gKifnvl-7DuqfqEI,80664
5
11
  pygnss/geodetic.py,sha256=gfVsOeEKLn2RaJYpaCk0OrQpYz6QiDPMX6PoJHEaP9Q,34029
6
12
  pygnss/cl.py,sha256=ISmd2RjikUMmj3nLPN0VSjvQLG5rLizp2X2ajeBkoDE,4509
7
- pygnss/_c_ext.cpython-313-i386-linux-musl.so,sha256=aOPfS0656QmdUX5g1TeSN6G3m01hlmhcAwXqTq5RmhE,80532
13
+ pygnss/constants.py,sha256=1hF6K92X6E6Ofo0rAuCBCgrwln9jxio26RV2a6vyURk,133
14
+ pygnss/decorator.py,sha256=ldlZuvwuIlJf2pkoWteyXyp5tLds8KRkphrPsrURw9U,491
8
15
  pygnss/tensorial.py,sha256=aA0-0WK2MXhDUg0_8HMbECOt9cXmp3EnKFQXjdYMBXA,1598
9
16
  pygnss/time.py,sha256=YdMNs2xA43LrSgEOgB7jpEq0dCWv89fUBF5syDLjbu0,11178
10
- pygnss/logger.py,sha256=4kvcTWXPoiG-MlyP6B330l4Fu7MfCuDjuIlIiLA8f1Y,1479
11
- pygnss/decorator.py,sha256=ldlZuvwuIlJf2pkoWteyXyp5tLds8KRkphrPsrURw9U,491
17
+ pygnss/hatanaka.py,sha256=P9XG6bZwUzfAPYn--6-DXfFQIEefeimE7fMJm_DF5zE,1951
12
18
  pygnss/stats.py,sha256=mDiY0K-VTndlFEkbxTzq9PYxCOjYDYsY3ZQV0PuMREM,1924
13
- pygnss/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
14
- pygnss/constants.py,sha256=1hF6K92X6E6Ofo0rAuCBCgrwln9jxio26RV2a6vyURk,133
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/filter/__init__.py,sha256=Ek5NM48EiDbnjYDz7l1QLojkAQre5tzPjCgssH0hwoU,1830
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/orbit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
- pygnss/gnss/types.py,sha256=lmL15KRckRiTwVkYvGzF4c1BrojnQlegrYCXSz1hGaI,10377
27
- pygnss/gnss/residuals.py,sha256=8qKGNOYkrqxHGOSjIfH21K82PAqEh2068kf78j5usL8,1244
28
- pygnss/gnss/edit.py,sha256=T1r0WbJmt8tLJpG_IIsy4Atej6cy0IStBaSGxw0S5ho,1884
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=_cnBs0VTJSy6TRwvMOZQ_5mpn0qxt2Jp1Y6Uq6s1G8k,110
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