This repository was archived by the owner on Apr 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +31
-10
lines changed Expand file tree Collapse file tree 4 files changed +31
-10
lines changed Original file line number Diff line number Diff line change 12
12
Bit field packing, unpacking and utility functions.
13
13
14
14
"""
15
-
15
+ from swiftnav.bits cimport parity as c_parity
16
16
17
17
def parity (x ):
18
- raise NotImplementedError
18
+ '''
19
+ Cython wrapper for parity function
20
+
21
+ Parameters
22
+ ----------
23
+ x : int
24
+ Value for parity computation
25
+
26
+ Returns
27
+ -------
28
+ int
29
+ Parity value: 1 or 0.
30
+ '''
31
+ return c_parity(x)
19
32
20
33
def getbitu (buff , pos , length ):
21
34
raise NotImplementedError
Original file line number Diff line number Diff line change @@ -24,12 +24,19 @@ cdef class Ephemeris:
24
24
25
25
def __init__ (self , **kwargs ):
26
26
memset(& self ._thisptr, 0 , sizeof(ephemeris_t))
27
- self ._thisptr.sid = kwargs.pop(' sid' )
28
- self ._thisptr.toe = kwargs.pop(' toe' )
29
- self ._thisptr.ura = kwargs.pop(' ura' )
30
- self ._thisptr.fit_interval = kwargs.pop(' fit_interval' )
31
- self ._thisptr.valid = kwargs.pop(' valid' )
32
- self ._thisptr.healthy = kwargs.pop(' healthy' )
27
+
28
+ if ' sid' in kwargs:
29
+ self ._thisptr.sid = kwargs.pop(' sid' )
30
+ if ' toe' in kwargs:
31
+ self ._thisptr.toe = kwargs.pop(' toe' )
32
+ if ' ura' in kwargs:
33
+ self ._thisptr.ura = kwargs.pop(' ura' )
34
+ if ' fit_interval' in kwargs:
35
+ self ._thisptr.fit_interval = kwargs.pop(' fit_interval' )
36
+ if ' valid' in kwargs:
37
+ self ._thisptr.valid = kwargs.pop(' valid' )
38
+ if ' healthy' in kwargs:
39
+ self ._thisptr.healthy = kwargs.pop(' healthy' )
33
40
if ' kepler' in kwargs:
34
41
self ._thisptr.kepler = kwargs.pop(' kepler' )
35
42
elif ' xyz' in kwargs:
Original file line number Diff line number Diff line change @@ -44,3 +44,4 @@ cdef extern from "libswiftnav/nav_msg.h":
44
44
45
45
cdef class NavMsg:
46
46
cdef nav_msg_t _thisptr
47
+
Original file line number Diff line number Diff line change 9
9
10
10
# cython: embedsignature=True
11
11
12
- from ephemeris cimport ephemeris_t
13
12
from fmt_utils import fmt_repr
14
13
from time cimport gps_time_t
15
14
from signal cimport gnss_signal_t
@@ -42,7 +41,8 @@ cdef class NavMsg:
42
41
43
42
def process_subframe (self , sid , d ):
44
43
cdef gps_l1ca_decoded_data_t tmp_d = d._thisptr
45
- return process_subframe(& self ._thisptr, sid, & tmp_d)
44
+ cdef gnss_signal_t tmp_sid = sid._thisptr
45
+ return process_subframe(& self ._thisptr, tmp_sid, & tmp_d)
46
46
47
47
def __richcmp__ (self , other , op ):
48
48
"""
You can’t perform that action at this time.
0 commit comments