GNSSIR (C library)#
-
struct arc#
-
struct enu_position#
-
struct gnss_system#
-
struct gnssrstream#
-
struct lz4stream#
-
struct nmea_trans_cycle#
- #include <nmea.h>
Cycle structure holding a paired nmea-cycle with a transmissivity cycle.
Public Members
-
double mjd[2]#
-
enu_position sites[2]#
-
int sats_in_view#
-
gnss_system system[NMEA_GSV_MAX_SATELLITES]#
-
int prn[NMEA_GSV_MAX_SATELLITES]#
-
float elevation[NMEA_GSV_MAX_SATELLITES]#
-
float azimuth[NMEA_GSV_MAX_SATELLITES]#
-
float cnr0[2][NMEA_GSV_MAX_SATELLITES]#
-
float gamma[NMEA_GSV_MAX_SATELLITES]#
-
double mjd[2]#
-
struct skymask#
- file arcs.c
- #include <memory.h>#include “arcs.h”#include “position.h”
Functions
-
int realloc_and_copy(void **dvec, size_t currentlen, size_t sz)#
-
int init_arc_buffer(arc_buffer *arcbuf, int expiry_sec, int max_arclen_sec)#
-
int free_arc_buffer(arc_buffer *arcbuf)#
-
arc *find_arcptr(arc_buffer *arcbuf, int prn)#
-
int new_arc(arc **arcptr, arc_buffer *arcbuf, int prn, const gnss_system *sys, const enu_position *site)#
-
int check_finalization(arc_buffer *arcbuf, double mjdcurrent)#
-
int append_cycle_data(const nmea_cycle *cyc, arc_buffer *arcbuf)#
-
int next_finalized_arc(const arc_buffer *abuf)#
-
int insert_new_arc(arc_buffer *abuf, int itharc)#
-
int purge_arc(arc_buffer *abuf, int itharc)#
-
int realloc_and_copy(void **dvec, size_t currentlen, size_t sz)#
- file arcs.h
- #include “gnssir.h”#include “nmea.h”#include “skymask.h”
Typedefs
-
typedef enum arc_state arc_state
-
typedef struct arc arc
-
typedef struct arc_buffer arc_buffer
Functions
-
int init_arc(arc *data)
-
int free_arc(arc *data)
-
int append_to_arc(arc *data, double mjd, float elevation, float azimuth, float cnr0)
-
int init_arc_buffer(arc_buffer *arcbuf, int expiry_sec, int max_arclen_sec)
-
int free_arc_buffer(arc_buffer *arcbuf)
-
int append_cycle_data(const nmea_cycle *cyc, arc_buffer *arcbuf)
-
int next_finalized_arc(const arc_buffer *abuf)
-
int purge_arc(arc_buffer *abuf, int itharc)
-
int insert_new_arc(arc_buffer *abuf, int itharc)
-
typedef enum arc_state arc_state
- file gnssir.c
- #include “gnssir.h”#include <string.h>
Variables
-
const gnss_system gnss_unknown = GNSS_UNKNOWN#
-
const gnss_system gnss_gpsl1 = GPSL1#
-
const gnss_system gnss_gpsl2 = GPSL2#
-
const gnss_system gnss_unknown = GNSS_UNKNOWN#
- file gnssir.h
- #include <stdio.h>#include <stdlib.h>
Defines
-
GNSSIR_SUCCESS#
ERROR and SUCCESS CODES.
-
GNSSIR_MEMORY_ERROR#
-
ALLOC(s)#
-
ALLOC_AND_ZERO(s)#
-
FREEMEM(p)#
-
F_FILL_VALUE#
-
SPEED_OF_LIGHT#
-
GNSS_BAND(FREQ, WMHZ, NAME, RINEXCODE)#
-
GPSL1#
-
GPSL2#
-
GPSL5#
-
QZSSL5#
-
QZSSL2C#
-
QZSSE6#
-
QZSSL1#
-
GLONASSIL1#
-
GLONASSIL2#
-
GLONASSIIL1#
-
GLONASSIIL2#
-
GNSS_UNKNOWN#
-
LOGWARNING#
-
warn_print(fmt, ...)#
Typedefs
-
typedef struct gnss_system gnss_system
Functions
-
void copy_GNSS_as(gnss_system *sys, const gnss_system *sysfrom)#
Variables
-
const gnss_system gnss_gpsl1
-
const gnss_system gnss_gpsl2
-
const gnss_system gnss_glonassiil1#
-
const gnss_system gnss_unknown
-
GNSSIR_SUCCESS#
- file lz4stream.c
- #include “lz4stream.h”#include <stdlib.h>#include <string.h>
- file lz4stream.h
- #include “lz4static/lz4.h”#include “lz4static/lz4file.h”#include <stdio.h>
Defines
-
LZ4_MAX_MESSAGE#
-
LZ4_RING_BUFFER#
-
LZ4_CHUNK_SIZE#
-
LZ4_ERROR#
-
LZ4_EOF#
-
LZ4_SUCCESS#
-
LZ4_LINEBUF_TOO_SMALL#
Typedefs
-
typedef struct lz4stream lz4stream
-
LZ4_MAX_MESSAGE#
- file nmea.c
- #include <stdio.h>#include <string.h>#include <stdlib.h>#include <math.h>#include “nmea.h”#include “timeutil.h”
Functions
-
unsigned char calculate_checksum(const char *nmea)#
-
int shift_to_komma(const char **nmeaPtr, const char **kommaPtr, int skip)#
-
float convert_deg(const float deg)#
-
void extract_time(const char *nmeaPtr, int *hr, int *min, double *sec)#
-
int init_nmea_cycle(nmea_cycle *data)#
-
int init_nmea_trans_cycle(nmea_trans_cycle *data)#
-
int read_nmea_cycle(gnssrstream *sid, nmea_cycle *data)#
-
int pair_nmea_trans_cycle(const nmea_cycle *c_obstr, const nmea_cycle *c_clear, int delta_sec, nmea_trans_cycle *tc_out)#
Create a transmissivity cycle from two individual cycles (no checks on matching time will be done!! (this is a user choice)
-
int update_nmea_RMC(const char *nmea, nmea_cycle *data)#
-
void get_gnss_system(const char *nmea, gnss_system *system)#
-
int update_nmea_GSV(const char *nmea, nmea_cycle *data)#
-
int update_nmea_GGA(const char *nmea, nmea_cycle *data)#
-
unsigned char calculate_checksum(const char *nmea)#
- file nmea.h
- #include <stdio.h>#include <zlib.h>#include <string.h>#include “gnssir.h”#include “stream.h”#include “position.h”
Typedefs
-
typedef enum nmea_type nmea_type
-
typedef struct nmea_trans_cycle nmea_trans_cycle
-
typedef struct nmea_cycle nmea_cycle
Enums
Functions
-
unsigned char calculate_checksum(const char *nmea)
-
int update_nmea_RMC(const char *nmea, nmea_cycle *data)
-
int update_nmea_GSV(const char *nmea, nmea_cycle *data)
-
int update_nmea_GGA(const char *nmea, nmea_cycle *data)
-
nmea_type check_nmea(char *nmea)
-
int init_nmea_cycle(nmea_cycle *data)
-
int init_nmea_trans_cycle(nmea_trans_cycle *data)
-
int read_nmea_cycle(gnssrstream *sid, nmea_cycle *data)
-
int pair_nmea_trans_cycle(const nmea_cycle *c_clear, const nmea_cycle *c_obstr, int delta_sec, nmea_trans_cycle *tc_out)
Create a transmissivity cycle from two individual cycles (no checks on matching time will be done!! (this is a user choice)
-
typedef enum nmea_type nmea_type
- file position.c
- #include “gnssir.h”#include “position.h”
Functions
-
int init_enu_position(enu_position *data)#
-
int copy_enu_position(const enu_position *in, enu_position *out)#
-
int set_enu_position(enu_position *data, float lat, float lon, float ortho_height, float geoid_height, double mjd)#
-
int init_enu_position(enu_position *data)#
- file position.h
Typedefs
-
typedef struct enu_position enu_position
Functions
-
int init_enu_position(enu_position *data)
-
int copy_enu_position(const enu_position *in, enu_position *out)
-
int set_enu_position(enu_position *data, float lat, float lon, float ortho_height, float geoid_height, double mjd)
-
typedef struct enu_position enu_position
- file skymask.c
- #include “skymask.h”
Functions
-
int within_mask(const skymask *skymsk, float azimuth, float elevation)#
Tests whether a point (azimuth, elevation) lies within a skymask polygon.
Uses a fast point-in-polygon test algorithm based on ray casting to determine if a given sky coordinate falls within the polygon defined by the skymask vertices.
See also
See also
az_center
Note
The azimuth value is automatically wrapped to match the skymask’s coordinate system center
Note
Algorithm adapted from: https://stackoverflow.com/questions/36399381/whats-the-fastest-way-of-checking-if-a-point-is-inside-a-polygon-in-python
- Parameters:
skymsk – Pointer to the skymask structure containing polygon vertices
azimuth – The azimuth angle in degrees of the point to test
elevation – The elevation angle in degrees of the point to test
- Returns:
1 if the point is inside the polygon, 0 if outside, 2 if on the edge
-
float wrap_azimuth(float azimuth, az_center center)#
Wraps azimuth angle to match the specified azimuth center (0 or 180 degrees).
Converts azimuth angles between two coordinate systems:
D180 center: Range [0, 360) degrees
D0 center: Range [-180, 180) degrees
Note
If azimuth is negative and center is D180, adds 360 to convert to [0,360) range
Note
If azimuth is greater than 180 and center is D0, subtracts 360 to convert to [-180,180) range
Note
If no conversion is needed, returns the original azimuth value
- Parameters:
azimuth – The azimuth angle in degrees to be wrapped
center – The target coordinate system center (see az_center enum in skymask.h)
- Returns:
The wrapped azimuth angle in the target coordinate system
-
int within_mask(const skymask *skymsk, float azimuth, float elevation)#
- file skymask.h
- #include “gnssir.h”
Enums
-
enum az_center#
Defines the azimuthal center point for a skymask polygon.
This enumeration specifies different coordinate system conventions for representing azimuth angles, determining whether angles are centered around 0° or 180°.
Values:
-
enumerator D0#
Center at 0°: Azimuth range is [-180°, 180°)
-
enumerator D180#
Center at 180°: Azimuth range is [0°, 360°)
-
enumerator DUNK#
Unknown or unspecified center (value: 1)
-
enumerator D0#
Functions
-
int init_skymask(skymask *skymsk)
-
int within_mask(const skymask *skymsk, float azimuth, float elevation)
Tests whether a point (azimuth, elevation) lies within a skymask polygon.
Uses a fast point-in-polygon test algorithm based on ray casting to determine if a given sky coordinate falls within the polygon defined by the skymask vertices.
See also
See also
az_center
Note
The azimuth value is automatically wrapped to match the skymask’s coordinate system center
Note
Algorithm adapted from: https://stackoverflow.com/questions/36399381/whats-the-fastest-way-of-checking-if-a-point-is-inside-a-polygon-in-python
- Parameters:
skymsk – Pointer to the skymask structure containing polygon vertices
azimuth – The azimuth angle in degrees of the point to test
elevation – The elevation angle in degrees of the point to test
- Returns:
1 if the point is inside the polygon, 0 if outside, 2 if on the edge
-
int add_polypoint(skymask *skymsk, float azimuth, float elevation)
-
int close_poly(skymask *skymsk)
-
int setup_simple_skymask(skymask *skymsk, float min_az, float max_az, float min_el, float max_el)
-
float wrap_azimuth(float azimuth, az_center center)
Wraps azimuth angle to match the specified azimuth center (0 or 180 degrees).
Converts azimuth angles between two coordinate systems:
D180 center: Range [0, 360) degrees
D0 center: Range [-180, 180) degrees
Note
If azimuth is negative and center is D180, adds 360 to convert to [0,360) range
Note
If azimuth is greater than 180 and center is D0, subtracts 360 to convert to [-180,180) range
Note
If no conversion is needed, returns the original azimuth value
- Parameters:
azimuth – The azimuth angle in degrees to be wrapped
center – The target coordinate system center (see az_center enum in skymask.h)
- Returns:
The wrapped azimuth angle in the target coordinate system
-
enum az_center#
- file stream.c
- #include <stdio.h>#include <string.h>#include “gnssir.h”#include “stream.h”
Functions
-
int open_stream(const char *filename, gnssrstream *sid)#
-
void close_stream(gnssrstream *sid)#
-
int readline(gnssrstream *sid, char *buffer, size_t slen)#
-
int open_stream(const char *filename, gnssrstream *sid)#
- file stream.h
- #include <string.h>#include <stdio.h>
Typedefs
-
typedef struct gnssrstream gnssrstream
Functions
-
int open_stream(const char *filename, gnssrstream *strid)
-
int readline(gnssrstream *strid, char *buffer, size_t slen)
-
void close_stream(gnssrstream *strid)
-
int eof(gnssrstream *strid)#
-
typedef struct gnssrstream gnssrstream
- file timeutil.c
- file timeutil.h
Functions
-
double mjd(const int year, const int month, const int day, const int hour, const int minute, const double seccond)
-
void mjd_to_datetime(double mjd, int *year, int *month, int *day, int *hour, int *minute, double *second)
-
double mjd(const int year, const int month, const int day, const int hour, const int minute, const double seccond)
- dir /home/docs/checkouts/readthedocs.org/user_builds/gnssr4water/envs/latest/lib/python3.12/site-packages/gnssir/src