|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
CLAS (QZSS L6D) CSSR decoder and grid correction type definitions. More...
#include <stdio.h>#include "mrtklib/mrtk_bits.h"#include "mrtklib/mrtk_foundation.h"#include "mrtklib/mrtk_l6.h"#include "mrtklib/mrtk_nav.h"#include "mrtklib/mrtk_rtkpos.h"#include "mrtklib/mrtk_time.h"Go to the source code of this file.
Classes | |
| struct | stecd_t |
| struct | stec_t |
| struct | zwdd_t |
| struct | zwd_t |
| struct | clas_oload_t |
| struct | clas_gp_t |
| struct | cssropt_t |
| struct | ssrn_t |
| struct | cssr_t |
| struct | clas_corr_t |
| struct | clas_orbit_bank_t |
| struct | clas_clock_bank_t |
| struct | clas_bias_bank_t |
| struct | clas_trop_bank_t |
| struct | clas_latest_trop_t |
| struct | clas_bank_ctrl_t |
| struct | clas_grid_t |
| struct | clas_osrd_t |
| struct | clas_dec_ssr_t |
| struct | clas_l6buf_t |
| struct | clas_ctx_t |
| struct | clas_satcorr_t |
| struct | clas_osr_ctx_t |
Macros | |
| #define | CLAS_VER "0.1" /* CLAS module version */ |
| #define | CSSR_MAX_GNSS 16 /* max GNSS systems in CSSR */ |
| #define | CSSR_MAX_SV_GNSS 40 /* max satellites per GNSS system */ |
| #define | CSSR_MAX_SV 64 /* max satellites in CSSR message */ |
| #define | CSSR_MAX_SIG 16 /* max signals per satellite */ |
| #define | CSSR_MAX_CELLMASK 64 /* max cellmask entries */ |
| #define | CSSR_MAX_NET 32 /* max networks in CSSR message */ |
| #define | CSSR_MAX_LOCAL_SV 32 /* max local satellites per network */ |
| #define | CSSR_MAX_GP 128 /* max grid points in CSSR message */ |
| #define | CSSR_SYS_GPS 0 |
| #define | CSSR_SYS_GLO 1 |
| #define | CSSR_SYS_GAL 2 |
| #define | CSSR_SYS_BDS 3 |
| #define | CSSR_SYS_QZS 4 |
| #define | CSSR_SYS_SBS 5 |
| #define | CSSR_SYS_NONE -1 |
| #define | CSSR_TYPE_NUM 14 /* total subtype count */ |
| #define | CSSR_TYPE_MASK 1 /* ST1: Satellite/signal mask */ |
| #define | CSSR_TYPE_OC 2 /* ST2: Orbit correction */ |
| #define | CSSR_TYPE_CC 3 /* ST3: Clock correction */ |
| #define | CSSR_TYPE_CB 4 /* ST4: Code bias */ |
| #define | CSSR_TYPE_PB 5 /* ST5: Phase bias */ |
| #define | CSSR_TYPE_BIAS 6 /* ST6: Combined bias */ |
| #define | CSSR_TYPE_URA 7 /* ST7: URA */ |
| #define | CSSR_TYPE_STEC 8 /* ST8: STEC correction (CLAS-only) */ |
| #define | CSSR_TYPE_GRID 9 /* ST9: Grid definition (CLAS-only) */ |
| #define | CSSR_TYPE_SI 10 /* ST10: Service information (CLAS-only) */ |
| #define | CSSR_TYPE_COMBO 11 /* ST11: Combined correction (CLAS-only) */ |
| #define | CSSR_TYPE_ATMOS 12 /* ST12: Atmospheric corr. (CLAS-only) */ |
| #define | CSSR_TYPE_INIT 254 /* initialization marker */ |
| #define | CSSR_TYPE_NULL 255 /* null/invalid marker */ |
| #define | P2_S16_MAX 32767 |
| #define | P2_S15_MAX 16383 |
| #define | P2_S14_MAX 8191 |
| #define | P2_S13_MAX 4095 |
| #define | P2_S12_MAX 2047 |
| #define | P2_S11_MAX 1023 |
| #define | P2_S10_MAX 511 |
| #define | P2_S9_MAX 255 |
| #define | P2_S8_MAX 127 |
| #define | P2_S7_MAX 63 |
| #define | P2_S6_MAX 31 |
| #define | CSSR_TROP_HS_REF 2.3 /* hydrostatic reference (m) */ |
| #define | CSSR_TROP_WET_REF 0.252 /* wet delay reference (m) */ |
| #define | CSSR_UPDATE_TROP 0 |
| #define | CSSR_UPDATE_STEC 1 |
| #define | CSSR_UPDATE_PBIAS 2 |
| #define | CSSR_TROPVALIDAGE 3600 /* max troposphere correction age */ |
| #define | CSSR_STECVALIDAGE 3600 /* max STEC correction age */ |
| #define | CSSR_INVALID_VALUE -10000 /* invalid correction marker */ |
| #define | L6FRMPREAMB L6_PREAMBLE /* L6 frame preamble (4 bytes) */ |
| #define | BLEN_MSG L6_FRAME_LEN /* L6 subframe length (bytes) */ |
| #define | CLAS_CH_NUM 2 /* L6 channels */ |
| #define | CLAS_MAX_NETWORK 13 /* max networks (upstream uses 32, 13 covers networks 1-12) */ |
| #define | CLAS_BANK_NUM 32 /* bank depth (ring buffer entries) */ |
| #define | CLAS_MAX_GP 80 /* max grid points in bank storage */ |
| #define | CLAS_MAX_NGRID 4 /* grid points for interpolation */ |
| #define | CLAS_MAXPBCORSSR 20.0 /* max phase bias correction (m) */ |
| #define | CLAS_L6_RELOCK_TIMEOUT 10.0 |
| #define | CLAS_CSSRINVALID (-10000) |
| #define | CLAS_MAXAGESSR_BIAS 120.0 |
| #define | CLAS_MAXPBCORSSR 20.0 |
Typedefs | |
| typedef clas_osrd_t | osrd_t |
Enumerations | |
| enum | { CSSR_REF_MASK = 0 , CSSR_REF_ORBIT , CSSR_REF_CLOCK , CSSR_REF_CBIAS , CSSR_REF_PBIAS , CSSR_REF_BIAS , CSSR_REF_URA , CSSR_REF_STEC , CSSR_REF_GRID , CSSR_REF_COMBINED , CSSR_REF_ATMOSPHERIC , CSSR_REF_MAX } |
Functions | |
| int | clas_ctx_init (clas_ctx_t *ctx) |
| Initialize CLAS context (allocate bank control on heap). | |
| void | clas_ctx_free (clas_ctx_t *ctx) |
| Free CLAS context (release heap-allocated bank control). | |
| int | clas_input_cssr (clas_ctx_t *ctx, uint8_t data, int ch) |
| Input CSSR byte stream (one byte at a time, real-time). | |
| void | clas_set_l6tag (clas_ctx_t *ctx, int ch, double tag) |
| Set the receiver time tag of the L6 frame about to be input. | |
| int | clas_decode_msg (clas_ctx_t *ctx, int ch) |
| Decode the next pending CSSR message from the assembled bit buffer. | |
| int | clas_input_cssrf (clas_ctx_t *ctx, FILE *fp, int ch) |
| Input CSSR from file (one message at a time, post-processing). | |
| void | clas_bank_init (clas_ctx_t *ctx, int ch) |
| Initialize bank control for a channel. | |
| int | clas_bank_get_close (const clas_ctx_t *ctx, gtime_t time, int network, int ch, clas_corr_t *corr) |
| Merge closest corrections from all banks into a clas_corr_t snapshot. | |
| int | clas_backup_valid (const clas_ctx_t *ctx, gtime_t obstime, int l6mrg) |
| Save/restore the latest usable CSSR snapshot for short correction gaps. | |
| void | clas_backup_current (clas_ctx_t *ctx, const clas_grid_t *grid, int l6mrg) |
| void | clas_restore_backup (clas_ctx_t *ctx, gtime_t time, clas_grid_t *grid, int l6mrg) |
| void | clas_clear_current (clas_ctx_t *ctx, int ch) |
| Drop the current correction snapshot of one channel. | |
| void | clas_update_global (nav_t *nav, const clas_corr_t *corr, int ch) |
| Apply global corrections (orbit/clock/bias) to nav_t.ssr[]. | |
| void | clas_update_local (nav_t *nav, const clas_corr_t *corr, int ch) |
| Apply local corrections (trop/STEC) to nav_t. | |
| int | clas_read_grid_def (clas_ctx_t *ctx, const char *file) |
| Read CLAS grid definition file. | |
| void | clas_check_grid_status (clas_ctx_t *ctx, const clas_corr_t *corr, int ch) |
| Check and update grid status flags based on correction availability. | |
| void | clas_check_grid_status_time (clas_ctx_t *ctx, gtime_t time, int ch) |
| int | clas_get_correct_fac (int msgid) |
| Get L6 facility ID from message ID byte. | |
| int | clas_route_l6frame (clas_ctx_t *ctx, int prn, int ptn, int l6mrg, gtime_t now) |
| Route one interleaved L6D frame to a CLAS channel (or drop it). | |
| int | clas_get_grid_index (clas_ctx_t *ctx, const double *pos, clas_grid_t *grid, int gridsel, gtime_t obstime) |
| Select surrounding grid points and compute interpolation weights. | |
| int | clas_stec_grid_data (clas_corr_t *corr, const int *index, gtime_t time, int sat, int n, const double *weight, const double *Gmat, const double *Emat, double *iono, double *rate, double *var, int *brk) |
| Interpolate STEC (ionosphere delay) from grid points. | |
| int | clas_trop_grid_data (clas_corr_t *corr, const int *index, gtime_t time, int n, const double *weight, const double *Gmat, const double *Emat, double *zwd, double *ztd, int *tbrk) |
| Interpolate troposphere delay from grid points. | |
| void | clas_init_oload (clas_ctx_t *ctx) |
| Initialize ocean loading data in context. | |
| int | readblqgrid (const char *file, clas_ctx_t *ctx) |
| Read BLQ ocean tide loading parameters for CLAS grid points. | |
| double | clas_osr_prectrop (gtime_t time, const double *pos, const double *azel, double zwd, double ztd) |
| Precise troposphere model for CLAS (MOPS standard + mapping function). | |
| int | clas_osr_selfreqpair (int sat, const prcopt_t *opt, const obsd_t *obs) |
| Select frequency pair for multi-frequency processing. | |
| int | clas_osr_satcorr_update (gtime_t time, gtime_t teph, int sat, const prcopt_t *opt, const nav_t *nav, int ch, clas_osr_ctx_t *ctx) |
| Compute zero-differenced phase/code residuals with CLAS corrections. | |
| int | clas_osr_zdres (const obsd_t *obs, int n, const double *rs, const double *dts, const double *vare, const int *svh, nav_t *nav, double *x, double *y, double *e, double *azel, rtk_t *rtk, int osrlog, clas_osr_ctx_t *osr_ctx, clas_grid_t *grid, clas_corr_t *corr, ssat_t *ssat, prcopt_t *opt, sol_t *sol, clas_osrd_t *osr, int ch) |
| Compute zero-differenced phase/code residuals with CLAS corrections. | |
| void | clas_osr_compensatedisp (clas_corr_t *corr, const int *index, const obsd_t *obs, int sat, double iono, const double *pb, double *compL, int *pbreset, const prcopt_t *opt, ssat_t ssat, int ch, clas_osr_ctx_t *osr_ctx, const nav_t *nav) |
| Compensate time variation of signal bias and ionosphere delay. | |
| int | clas_osr_corrmeas (const obsd_t *obs, nav_t *nav, const double *pos, const double *azel, const prcopt_t *opt, clas_grid_t *grid, clas_corr_t *corr, ssat_t ssat, int *brk, clas_osrd_t *osr, int *pbreset, int ch, clas_osr_ctx_t *osr_ctx) |
| Assemble per-satellite ionosphere/bias/antenna corrections. | |
| void | clas_osr_ctx_init (clas_osr_ctx_t *ctx) |
| Initialize OSR conversion context. | |
| int | clas_ssr2osr (rtk_t *rtk, obsd_t *obs, int n, nav_t *nav, clas_osrd_t *osr, int mode, clas_ctx_t *clas) |
| Convert compact SSR corrections to observation-space representations. | |
| int | cssr_gnss2sys (int gnss, int *prn0) |
| Convert CSSR GNSS ID to RTKLIB system bitmask. | |
| int | cssr_sys2gnss (int sys, int *prn0) |
| Convert RTKLIB system bitmask to CSSR GNSS ID. | |
| int | readisb (const char *file, nav_t *nav) |
| Read ISB correction table from file. | |
| int | readL2C (const char *file, nav_t *nav) |
| Read L2C 1/4 cycle phase shift table from file. | |
| void | setisb (const nav_t *nav, const char *rectype0, const char *rectype1, sta_t *sta0, sta_t *sta1) |
| Set ISB corrections for rover and reference stations. | |
| void | chk_isb (int sysno, const prcopt_t *opt, const sta_t *sta, double y[5][2]) |
| Get ISB correction values for a satellite system. | |
| int | isL2C (int code) |
| Check if observation code is L2C. | |
CLAS (QZSS L6D) CSSR decoder and grid correction type definitions.
References: [1] claslib (https://github.com/mf-arai/claslib) โ upstream implementation [2] IS-QZSS-L6-001 โ CLAS Interface Specification [3] IS-QZSS-L6-003 โ CLAS Compact SSR Specification
Notes:
Definition in file mrtk_clas.h.
| #define BLEN_MSG L6_FRAME_LEN /* L6 subframe length (bytes) */ |
Definition at line 151 of file mrtk_clas.h.
Referenced by clas_input_cssr().
| #define CLAS_BANK_NUM 32 /* bank depth (ring buffer entries) */ |
Definition at line 187 of file mrtk_clas.h.
Referenced by clas_has_orbit_bank(), get_close_cbias(), get_close_clock(), get_close_orbit(), get_close_pbias(), get_close_trop(), get_same_bias(), get_same_clock(), get_same_orbit(), get_same_trop(), set_cssr_bank_cbias(), set_cssr_bank_clock(), set_cssr_bank_orbit(), set_cssr_bank_pbias(), and set_cssr_bank_trop().
| #define CLAS_CH_NUM 2 /* L6 channels */ |
Definition at line 185 of file mrtk_clas.h.
Referenced by clas_backup_current(), clas_backup_valid(), clas_bank_init(), clas_check_grid_status(), clas_check_grid_status_time(), clas_clear_current(), clas_ctx_free(), clas_ctx_init(), clas_get_grid_index(), clas_has_orbit_bank(), clas_osr_ctx_init(), clas_restore_backup(), clas_route_l6frame(), freepreceph(), readpreceph(), and update_clas().
| #define CLAS_CSSRINVALID (-10000) |
Invalid CSSR bias value sentinel
Definition at line 956 of file mrtk_clas.h.
Referenced by clas_osr_compensatedisp(), clas_osr_corrmeas(), and clas_osr_zdres().
| #define CLAS_L6_RELOCK_TIMEOUT 10.0 |
Seconds an L6 channel's active source PRN may be silent before the demux re-locks the channel to a newly arriving PRN/pattern (QZS handover).
Definition at line 808 of file mrtk_clas.h.
Referenced by clas_route_l6frame().
| #define CLAS_MAX_GP 80 /* max grid points in bank storage */ |
Definition at line 188 of file mrtk_clas.h.
Referenced by clas_check_grid_status(), clas_check_grid_status_time(), clas_read_grid_def(), decode_cssr_atmos(), decode_cssr_grid(), init_grid_index(), pickup_candidates_of_grid(), and readblqgrid().
| #define CLAS_MAX_NETWORK 13 /* max networks (upstream uses 32, 13 covers networks 1-12) */ |
Definition at line 186 of file mrtk_clas.h.
Referenced by clas_bank_init(), clas_check_grid_status(), clas_check_grid_status_time(), clas_init_oload(), clas_read_grid_def(), decoderaw(), get_close_cbias(), get_close_clock(), get_close_orbit(), get_close_pbias(), get_close_trop(), pickup_candidates_of_grid(), readblqgrid(), and update_clas().
| #define CLAS_MAX_NGRID 4 /* grid points for interpolation */ |
Definition at line 194 of file mrtk_clas.h.
| #define CLAS_MAXAGESSR_BIAS 120.0 |
Maximum age for SSR bias corrections (seconds)
Definition at line 959 of file mrtk_clas.h.
Referenced by clas_osr_corrmeas().
| #define CLAS_MAXPBCORSSR 20.0 |
Maximum phase bias correction for SSR (meters)
Definition at line 195 of file mrtk_clas.h.
| #define CLAS_MAXPBCORSSR 20.0 /* max phase bias correction (m) */ |
Maximum phase bias correction for SSR (meters)
Definition at line 195 of file mrtk_clas.h.
| #define CLAS_VER "0.1" /* CLAS module version */ |
Definition at line 52 of file mrtk_clas.h.
| #define CSSR_INVALID_VALUE -10000 /* invalid correction marker */ |
Definition at line 144 of file mrtk_clas.h.
Referenced by add_base_value_to_cbias(), add_base_value_to_pbias(), clas_bank_get_close(), clas_check_grid_status_time(), decode_cssr_atmos(), decode_cssr_combo(), decode_cssr_grid(), decode_cssr_oc(), decode_sval(), get_cssr_latest_iono(), get_cssr_latest_trop(), set_cssr_bank_clock(), set_cssr_bank_orbit(), set_cssr_bank_trop(), set_cssr_latest_trop(), and trop_data().
| #define CSSR_MAX_CELLMASK 64 /* max cellmask entries */ |
Definition at line 65 of file mrtk_clas.h.
| #define CSSR_MAX_GNSS 16 /* max GNSS systems in CSSR */ |
Definition at line 61 of file mrtk_clas.h.
Referenced by decode_cssr_mask(), and svmask2sat().
| #define CSSR_MAX_GP 128 /* max grid points in CSSR message */ |
Definition at line 68 of file mrtk_clas.h.
Referenced by decode_cssr_atmos(), and decode_cssr_grid().
| #define CSSR_MAX_LOCAL_SV 32 /* max local satellites per network */ |
Definition at line 67 of file mrtk_clas.h.
| #define CSSR_MAX_NET 32 /* max networks in CSSR message */ |
Definition at line 66 of file mrtk_clas.h.
Referenced by decode_cssr_atmos(), decode_cssr_grid(), and decode_cssr_stec().
| #define CSSR_MAX_SIG 16 /* max signals per satellite */ |
Definition at line 64 of file mrtk_clas.h.
Referenced by decode_cssr_bias(), decode_cssr_cb(), decode_cssr_pb(), sigmask2nsig(), sigmask2sig(), and sigmask2sig_p().
| #define CSSR_MAX_SV 64 /* max satellites in CSSR message */ |
Definition at line 63 of file mrtk_clas.h.
Referenced by check_bit_width_bias(), check_bit_width_cb(), check_bit_width_combo(), check_bit_width_oc(), check_bit_width_pb(), check_bit_width_stec(), decode_cssr_atmos(), decode_cssr_bias(), decode_cssr_cb(), decode_cssr_cc(), decode_cssr_combo(), decode_cssr_grid(), decode_cssr_mask(), decode_cssr_oc(), decode_cssr_pb(), decode_cssr_stec(), and decode_cssr_ura().
| #define CSSR_MAX_SV_GNSS 40 /* max satellites per GNSS system */ |
Definition at line 62 of file mrtk_clas.h.
Referenced by svmask2nsat(), svmask2nsatlist(), and svmask2sat().
| #define CSSR_STECVALIDAGE 3600 /* max STEC correction age */ |
Definition at line 138 of file mrtk_clas.h.
Referenced by get_cssr_latest_iono().
| #define CSSR_SYS_BDS 3 |
Definition at line 77 of file mrtk_clas.h.
Referenced by cssr_gnss2sys(), and cssr_sys2gnss().
| #define CSSR_SYS_GAL 2 |
Definition at line 76 of file mrtk_clas.h.
Referenced by cssr_gnss2sys(), and cssr_sys2gnss().
| #define CSSR_SYS_GLO 1 |
Definition at line 75 of file mrtk_clas.h.
Referenced by cssr_gnss2sys(), and cssr_sys2gnss().
| #define CSSR_SYS_GPS 0 |
Definition at line 74 of file mrtk_clas.h.
Referenced by cssr_gnss2sys(), and cssr_sys2gnss().
| #define CSSR_SYS_NONE -1 |
Definition at line 80 of file mrtk_clas.h.
Referenced by cssr_sys2gnss().
| #define CSSR_SYS_QZS 4 |
Definition at line 78 of file mrtk_clas.h.
Referenced by cssr_gnss2sys(), and cssr_sys2gnss().
| #define CSSR_SYS_SBS 5 |
Definition at line 79 of file mrtk_clas.h.
Referenced by cssr_gnss2sys(), and cssr_sys2gnss().
| #define CSSR_TROP_HS_REF 2.3 /* hydrostatic reference (m) */ |
Definition at line 122 of file mrtk_clas.h.
Referenced by decode_cssr_atmos(), and decode_cssr_grid().
| #define CSSR_TROP_WET_REF 0.252 /* wet delay reference (m) */ |
Definition at line 123 of file mrtk_clas.h.
| #define CSSR_TROPVALIDAGE 3600 /* max troposphere correction age */ |
Definition at line 137 of file mrtk_clas.h.
Referenced by get_cssr_latest_trop().
| #define CSSR_TYPE_ATMOS 12 /* ST12: Atmospheric corr. (CLAS-only) */ |
Definition at line 98 of file mrtk_clas.h.
Referenced by decode_qzs_msg().
| #define CSSR_TYPE_BIAS 6 /* ST6: Combined bias */ |
Definition at line 92 of file mrtk_clas.h.
Referenced by decode_qzs_msg().
| #define CSSR_TYPE_CB 4 /* ST4: Code bias */ |
Definition at line 90 of file mrtk_clas.h.
Referenced by decode_qzs_msg().
| #define CSSR_TYPE_CC 3 /* ST3: Clock correction */ |
Definition at line 89 of file mrtk_clas.h.
Referenced by decode_qzs_msg().
| #define CSSR_TYPE_COMBO 11 /* ST11: Combined correction (CLAS-only) */ |
Definition at line 97 of file mrtk_clas.h.
Referenced by decode_qzs_msg().
| #define CSSR_TYPE_GRID 9 /* ST9: Grid definition (CLAS-only) */ |
Definition at line 95 of file mrtk_clas.h.
Referenced by decode_qzs_msg().
| #define CSSR_TYPE_INIT 254 /* initialization marker */ |
Definition at line 99 of file mrtk_clas.h.
| #define CSSR_TYPE_MASK 1 /* ST1: Satellite/signal mask */ |
Definition at line 87 of file mrtk_clas.h.
Referenced by decode_cssr_head(), decode_qzs_msg(), and update_clas().
| #define CSSR_TYPE_NULL 255 /* null/invalid marker */ |
Definition at line 100 of file mrtk_clas.h.
| #define CSSR_TYPE_NUM 14 /* total subtype count */ |
Definition at line 86 of file mrtk_clas.h.
| #define CSSR_TYPE_OC 2 /* ST2: Orbit correction */ |
Definition at line 88 of file mrtk_clas.h.
Referenced by decode_qzs_msg().
| #define CSSR_TYPE_PB 5 /* ST5: Phase bias */ |
Definition at line 91 of file mrtk_clas.h.
Referenced by decode_qzs_msg().
| #define CSSR_TYPE_SI 10 /* ST10: Service information (CLAS-only) */ |
Definition at line 96 of file mrtk_clas.h.
Referenced by decode_qzs_msg().
| #define CSSR_TYPE_STEC 8 /* ST8: STEC correction (CLAS-only) */ |
Definition at line 94 of file mrtk_clas.h.
Referenced by decode_qzs_msg().
| #define CSSR_TYPE_URA 7 /* ST7: URA */ |
Definition at line 93 of file mrtk_clas.h.
Referenced by decode_qzs_msg().
| #define CSSR_UPDATE_PBIAS 2 |
Definition at line 131 of file mrtk_clas.h.
| #define CSSR_UPDATE_STEC 1 |
Definition at line 130 of file mrtk_clas.h.
| #define CSSR_UPDATE_TROP 0 |
Definition at line 129 of file mrtk_clas.h.
| #define L6FRMPREAMB L6_PREAMBLE /* L6 frame preamble (4 bytes) */ |
Definition at line 150 of file mrtk_clas.h.
Referenced by clas_input_cssr().
| #define P2_S10_MAX 511 |
Definition at line 112 of file mrtk_clas.h.
| #define P2_S11_MAX 1023 |
Definition at line 111 of file mrtk_clas.h.
| #define P2_S12_MAX 2047 |
Definition at line 110 of file mrtk_clas.h.
| #define P2_S13_MAX 4095 |
Definition at line 109 of file mrtk_clas.h.
| #define P2_S14_MAX 8191 |
Definition at line 108 of file mrtk_clas.h.
| #define P2_S15_MAX 16383 |
Definition at line 107 of file mrtk_clas.h.
| #define P2_S16_MAX 32767 |
Definition at line 106 of file mrtk_clas.h.
| #define P2_S6_MAX 31 |
Definition at line 116 of file mrtk_clas.h.
| #define P2_S7_MAX 63 |
Definition at line 115 of file mrtk_clas.h.
| #define P2_S8_MAX 127 |
Definition at line 114 of file mrtk_clas.h.
Referenced by decode_cssr_grid().
| #define P2_S9_MAX 255 |
Definition at line 113 of file mrtk_clas.h.
Referenced by decode_cssr_grid().
| typedef clas_osrd_t osrd_t |
Definition at line 513 of file mrtk_clas.h.
| anonymous enum |
| Enumerator | |
|---|---|
| CSSR_REF_MASK | |
| CSSR_REF_ORBIT | |
| CSSR_REF_CLOCK | |
| CSSR_REF_CBIAS | |
| CSSR_REF_PBIAS | |
| CSSR_REF_BIAS | |
| CSSR_REF_URA | |
| CSSR_REF_STEC | |
| CSSR_REF_GRID | |
| CSSR_REF_COMBINED | |
| CSSR_REF_ATMOSPHERIC | |
| CSSR_REF_MAX | |
Definition at line 157 of file mrtk_clas.h.
Get ISB correction values for a satellite system.
| [in] | sysno | Satellite system code (SYS_GPS, etc.) |
| [in] | opt | Processing options |
| [in] | sta | Station data with ISB values |
| [out] | y | ISB corrections [NFREQ][2] (0:phase, 1:code) (m) |
Definition at line 451 of file mrtk_clas_isb.c.
References prcopt_t::isb, sta_t::isb, ISBOPT_TABLE, and sys2isbidx().
Referenced by clas_osr_zdres().
| void clas_backup_current | ( | clas_ctx_t * | ctx, |
| const clas_grid_t * | grid, | ||
| int | l6mrg ) |
Definition at line 1250 of file mrtk_clas.c.
References clas_ctx_t::backup, clas_ctx_t::backup_grid, CLAS_CH_NUM, clas_ctx_t::current, init_grid_index(), and SSR_CH_NUM.
Referenced by ppp_rtk_pos().
| int clas_backup_valid | ( | const clas_ctx_t * | ctx, |
| gtime_t | obstime, | ||
| int | l6mrg ) |
Save/restore the latest usable CSSR snapshot for short correction gaps.
Mirrors claslib's BackupCSSR/BackupGrid path. The backup is considered valid while its latest global correction time is within 180 s of the observation.
Definition at line 1233 of file mrtk_clas.c.
References clas_ctx_t::backup, backup_cssr_time(), CLAS_CH_NUM, SSR_CH_NUM, timediff(), and clas_corr_t::use.
Referenced by ppp_rtk_pos().
| int clas_bank_get_close | ( | const clas_ctx_t * | ctx, |
| gtime_t | time, | ||
| int | network, | ||
| int | ch, | ||
| clas_corr_t * | corr ) |
Merge closest corrections from all banks into a clas_corr_t snapshot.
| [in] | ctx | CLAS context |
| [in] | time | Target time for matching |
| [in] | network | Network id |
| [in] | ch | Channel index |
| [out] | corr | Output merged correction snapshot |
Definition at line 1121 of file mrtk_clas.c.
References add_data_stec(), add_data_trop(), clas_ctx_t::bank, clas_corr_t::bias_time, clas_clock_bank_t::c0, clas_corr_t::c0, clas_bias_bank_t::cbias, clas_corr_t::cbias, clas_corr_t::clock_time, corr_bias_slot(), CSSR_INVALID_VALUE, clas_corr_t::deph0, clas_orbit_bank_t::deph0, clas_corr_t::deph1, clas_orbit_bank_t::deph1, clas_corr_t::deph2, clas_orbit_bank_t::deph2, clas_bank_ctrl_t::Facility, clas_corr_t::facility, clas_corr_t::flag, clas_corr_t::gridnum, clas_trop_bank_t::gridnum, clas_trop_bank_t::gridpos, init_grid_index(), clas_bias_bank_t::iod, clas_clock_bank_t::iod, clas_corr_t::iod, clas_orbit_bank_t::iod, clas_corr_t::iode, clas_orbit_bank_t::iode, clas_trop_bank_t::iono, MAXCODE, MAXSAT, clas_corr_t::network, clas_corr_t::orbit_time, clas_bias_bank_t::pbias, clas_corr_t::pbias, clas_bias_bank_t::prn, clas_clock_bank_t::prn, clas_corr_t::prn, clas_orbit_bank_t::prn, clas_trop_bank_t::prn, clas_trop_bank_t::satnum, set_grid_data(), clas_bias_bank_t::sflag, clas_bias_bank_t::smode, clas_corr_t::smode, clas_corr_t::stec, sub_get_close_cssr(), clas_bias_bank_t::time, clas_clock_bank_t::time, clas_corr_t::time, clas_orbit_bank_t::time, clas_trop_bank_t::time, clas_trop_bank_t::total, clas_corr_t::trop_time, clas_bias_bank_t::udi, clas_clock_bank_t::udi, clas_corr_t::udi, clas_orbit_bank_t::udi, clas_corr_t::update_time, clas_bank_ctrl_t::use, clas_corr_t::use, clas_trop_bank_t::wet, and clas_corr_t::zwd.
Referenced by clas_ssr2osr(), decoderaw(), ppp_rtk_pos(), and update_clas().
| void clas_bank_init | ( | clas_ctx_t * | ctx, |
| int | ch ) |
Initialize bank control for a channel.
| [in,out] | ctx | CLAS context |
| [in] | ch | Channel index |
Definition at line 101 of file mrtk_clas.c.
References clas_ctx_t::bank, clas_bank_ctrl_t::BiasBank, CLAS_CH_NUM, CLAS_MAX_NETWORK, clas_bank_ctrl_t::ClockBank, clas_bank_ctrl_t::Facility, clas_bank_ctrl_t::fastfix, clas_bank_ctrl_t::LatestTrop, clas_bank_ctrl_t::NextBias, clas_bank_ctrl_t::NextClock, clas_bank_ctrl_t::NextOrbit, clas_bank_ctrl_t::NextTrop, clas_bank_ctrl_t::OrbitBank, clas_bank_ctrl_t::separation, clas_bank_ctrl_t::TropBank, and clas_bank_ctrl_t::use.
Referenced by clas_ctx_init().
| void clas_check_grid_status | ( | clas_ctx_t * | ctx, |
| const clas_corr_t * | corr, | ||
| int | ch ) |
Check and update grid status flags based on correction availability.
Validates that orbit, trop, and STEC corrections exist for each grid point and sets grid_stat[ch][network][gp] accordingly. Must be called after clas_bank_get_close() to enable grid-based positioning.
| [in,out] | ctx | CLAS context (updates grid_stat) |
| [in] | time | Current observation time |
| [in] | ch | L6 channel index (0..CLAS_CH_NUM-1) |
Definition at line 1320 of file mrtk_clas.c.
References clas_ctx_t::bank, CLAS_CH_NUM, CLAS_MAX_GP, CLAS_MAX_NETWORK, clas_bank_ctrl_t::fastfix, clas_ctx_t::grid_stat, clas_corr_t::gridnum, stec_t::n, clas_corr_t::network, clas_corr_t::orbit_time, clas_corr_t::stec, gtime_t::time, timediff(), trace(), clas_corr_t::trop_time, clas_corr_t::update_time, clas_corr_t::use, zwdd_t::valid, and clas_corr_t::zwddata.
Referenced by clas_ssr2osr(), decoderaw(), ppp_rtk_pos(), and update_clas().
| void clas_check_grid_status_time | ( | clas_ctx_t * | ctx, |
| gtime_t | time, | ||
| int | ch ) |
Definition at line 1365 of file mrtk_clas.c.
References clas_ctx_t::bank, CLAS_CH_NUM, CLAS_MAX_GP, CLAS_MAX_NETWORK, CSSR_INVALID_VALUE, clas_bank_ctrl_t::fastfix, get_close_orbit(), get_close_trop(), clas_ctx_t::grid_stat, clas_trop_bank_t::gridnum, clas_trop_bank_t::iono, clas_orbit_bank_t::network, clas_trop_bank_t::satnum, clas_orbit_bank_t::time, clas_trop_bank_t::time, timediff(), clas_trop_bank_t::total, trace(), clas_bank_ctrl_t::use, and clas_trop_bank_t::wet.
Referenced by update_clas().
| void clas_clear_current | ( | clas_ctx_t * | ctx, |
| int | ch ) |
Drop the current correction snapshot of one channel.
Used when a channel supplies no corrections for the epoch, so that clas_update_global() clears nav_t.ssr_ch[ch] instead of re-applying the previous epoch's snapshot.
| [in,out] | ctx | CLAS context |
| [in] | ch | Channel index |
Definition at line 1266 of file mrtk_clas.c.
References CLAS_CH_NUM, clas_ctx_t::current, and init_grid_index().
Referenced by ppp_rtk_pos().
| void clas_ctx_free | ( | clas_ctx_t * | ctx | ) |
Free CLAS context (release heap-allocated bank control).
| [in,out] | ctx | CLAS context to free |
Definition at line 88 of file mrtk_clas.c.
References clas_ctx_t::bank, CLAS_CH_NUM, free, and clas_ctx_t::initialized.
Referenced by clas_ctx_init(), freepreceph(), and rtksvrfree().
| int clas_ctx_init | ( | clas_ctx_t * | ctx | ) |
Initialize CLAS context (allocate bank control on heap).
| [out] | ctx | CLAS context to initialize |
Definition at line 54 of file mrtk_clas.c.
References clas_ctx_t::bank, calloc, clas_bank_init(), CLAS_CH_NUM, clas_ctx_free(), CSSR_REF_MAX, clas_ctx_t::initialized, clas_ctx_t::l6delivery, clas_ctx_t::l6facility, clas_ctx_t::l6lock_time, clas_ctx_t::l6pattern, gtime_t::sec, gtime_t::time, and clas_ctx_t::tow_ref.
Referenced by readpreceph(), and rtksvrstart().
| int clas_decode_msg | ( | clas_ctx_t * | ctx, |
| int | ch ) |
Decode the next pending CSSR message from the assembled bit buffer.
Call this after clas_input_cssr() to trigger CSSR message decoding. clas_input_cssr() only assembles L6 frames; this function performs the actual CSSR decode step and returns a completion code.
| [in,out] | ctx | CLAS context |
| [in] | ch | Channel index (0 = primary) |
Definition at line 3213 of file mrtk_clas.c.
References decode_qzs_msg().
Referenced by decoderaw().
| int clas_get_correct_fac | ( | int | msgid | ) |
Get L6 facility ID from message ID byte.
| [in] | msgid | L6 message ID byte |
Definition at line 3037 of file mrtk_clas.c.
Referenced by clas_input_cssr().
| int clas_get_grid_index | ( | clas_ctx_t * | ctx, |
| const double * | pos, | ||
| clas_grid_t * | grid, | ||
| int | gridsel, | ||
| gtime_t | obstime ) |
Select surrounding grid points and compute interpolation weights.
| [in,out] | ctx | CLAS context (grid_pos, grid_stat) |
| [in] | pos | Receiver position {lat,lon,hgt} (rad,m) |
| [out] | grid | Interpolation result (weights, indices, matrix) |
| [in] | gridsel | Grid selection threshold (m), 0=always multi-grid |
| [in] | obstime | Observation time (reserved) |
Definition at line 459 of file mrtk_clas_grid.c.
References calc_grid_weight(), CLAS_CH_NUM, clas_grid_t::Emat, find_grid_surround_pos(), free, clas_grid_t::Gmat, clas_grid_t::index, grid_info::index, is_exists_inside(), mat(), matcpy(), matinv(), MAX_GRID_CACHE, clas_grid_t::network, grid_info::network, clas_grid_t::num, output_selected_grid(), pickup_candidates_of_grid(), grid_info::pos, R2D, trace(), tracemat(), and clas_grid_t::weight.
Referenced by clas_ssr2osr(), and ppp_rtk_pos().
| void clas_init_oload | ( | clas_ctx_t * | ctx | ) |
Initialize ocean loading data in context.
| [in,out] | ctx | CLAS context |
Definition at line 824 of file mrtk_clas_grid.c.
References CLAS_MAX_NETWORK, clas_oload_t::gridnum, and clas_ctx_t::oload.
| int clas_input_cssr | ( | clas_ctx_t * | ctx, |
| uint8_t | data, | ||
| int | ch ) |
Input CSSR byte stream (one byte at a time, real-time).
| [in,out] | ctx | CLAS context |
| [in] | data | Input byte |
| [in] | ch | Channel index (0 or 1) |
Definition at line 3127 of file mrtk_clas.c.
References l6_header_t::alert, BLEN_MSG, clas_l6buf_t::buff, clas_get_correct_fac(), clas_l6buf_t::decode_start, clas_l6buf_t::fbuff, clas_l6buf_t::frame, clas_l6buf_t::ftag, clas_l6buf_t::ftag_last, clas_l6buf_t::havebit, l6_parse_header(), l6_service_name(), L6_SVC_CLAS, L6_SVC_NULL, clas_ctx_t::l6buf, clas_ctx_t::l6delivery, clas_ctx_t::l6facility, L6FRMPREAMB, clas_l6buf_t::len, l6_header_t::msgid, clas_l6buf_t::nbit, clas_l6buf_t::nbyte, clas_l6buf_t::nframe, clas_l6buf_t::preamble, l6_header_t::prn, setbitu(), l6_header_t::sf_ind, l6_header_t::svc, and trace().
Referenced by clas_input_cssrf(), and decoderaw().
| int clas_input_cssrf | ( | clas_ctx_t * | ctx, |
| FILE * | fp, | ||
| int | ch ) |
Input CSSR from file (one message at a time, post-processing).
| [in,out] | ctx | CLAS context |
| [in] | fp | File pointer |
| [in] | ch | Channel index |
Definition at line 3217 of file mrtk_clas.c.
References clas_input_cssr(), and decode_qzs_msg().
Referenced by update_clas().
| void clas_osr_compensatedisp | ( | clas_corr_t * | corr, |
| const int * | index, | ||
| const obsd_t * | obs, | ||
| int | sat, | ||
| double | iono, | ||
| const double * | pb, | ||
| double * | compL, | ||
| int * | pbreset, | ||
| const prcopt_t * | opt, | ||
| ssat_t | ssat, | ||
| int | ch, | ||
| clas_osr_ctx_t * | osr_ctx, | ||
| const nav_t * | nav ) |
Compensate time variation of signal bias and ionosphere delay.
| [in] | corr | Merged correction snapshot |
| [in] | index | Grid point indices |
| [in] | obs | Observation for this satellite |
| [in] | sat | Satellite number |
| [in] | iono | Ionosphere delay (m) |
| [in] | pb | Phase biases per frequency |
| [out] | compL | Compensation output per frequency |
| [in,out] | pbreset | Phase bias reset flags |
| [in] | opt | Processing options |
| [in] | ssat | Satellite status |
| [in] | ch | SSR channel |
| [in,out] | osr_ctx | OSR context for persistent state |
| [in] | nav | Navigation data (for wavelengths) |
Ported from upstream claslib compensatedisp(). All static variables replaced by clas_osr_ctx_t members (comp_*).
| [in] | corr | Merged correction snapshot |
| [in] | index | Grid point indices |
| [in] | obs | Observation for this satellite |
| [in] | sat | Satellite number |
| [in] | iono | Ionosphere delay (m) |
| [in] | pb | Phase biases per frequency |
| [out] | compL | Compensation output per frequency |
| [in,out] | pbreset | Phase bias reset flags |
| [in] | opt | Processing options |
| [in] | ssat | Satellite status |
| [in] | ch | SSR channel (0 in MRTKLIB) |
| [in,out] | osr_ctx | OSR context for persistent state |
| [in] | nav | Navigation data (for wavelengths) |
Definition at line 430 of file mrtk_clas_osr.c.
References CLAS_CSSRINVALID, stec_t::data, FREQ1, FREQ2, obsd_t::L, MAXSAT, stec_t::n, prcopt_t::nf, obsfreqs, osr_ctx, prcopt_t::posopt, stecd_t::sat, sat_wavelengths(), ssat_t::slip, clas_corr_t::smode, SQR, clas_corr_t::stec, obsd_t::time, stecd_t::time, and timediff().
Referenced by clas_osr_corrmeas().
| int clas_osr_corrmeas | ( | const obsd_t * | obs, |
| nav_t * | nav, | ||
| const double * | pos, | ||
| const double * | azel, | ||
| const prcopt_t * | opt, | ||
| clas_grid_t * | grid, | ||
| clas_corr_t * | corr, | ||
| ssat_t | ssat, | ||
| int * | brk, | ||
| clas_osrd_t * | osr, | ||
| int * | pbreset, | ||
| int | ch, | ||
| clas_osr_ctx_t * | osr_ctx ) |
Assemble per-satellite ionosphere/bias/antenna corrections.
| [in] | obs | Observation for this satellite |
| [in,out] | nav | Navigation data |
| [in] | pos | Receiver position {lat,lon,hgt} (rad,m) |
| [in] | azel | Azimuth/elevation for this satellite |
| [in] | opt | Processing options |
| [in] | grid | Grid interpolation state |
| [in] | corr | Merged correction snapshot |
| [in] | ssat | Satellite status |
| [out] | brk | Slip break flag |
| [out] | osr | OSR output for this satellite |
| [in,out] | pbreset | Phase bias reset flags |
| [in] | ch | SSR channel |
| [in,out] | osr_ctx | OSR context |
Ported from upstream claslib corrmeas(). Decodes phase and code biases from SSR corrections, applies STEC grid interpolation for ionosphere, performs consistency checks, and computes receiver antenna correction.
| [in] | obs | Observation for this satellite |
| [in,out] | nav | Navigation data |
| [in] | pos | Receiver position {lat,lon,hgt} (rad,m) |
| [in] | azel | Azimuth/elevation for this satellite |
| [in] | opt | Processing options |
| [in] | grid | Grid interpolation state |
| [in] | corr | Merged correction snapshot |
| [in] | ssat | Satellite status |
| [out] | brk | Slip break flag |
| [out] | osr | OSR output for this satellite |
| [in,out] | pbreset | Phase bias reset flags |
| [in] | ch | SSR channel (0 in MRTKLIB) |
| [in,out] | osr_ctx | OSR context |
Definition at line 582 of file mrtk_clas_osr.c.
References prcopt_t::antdel, antmodel(), clas_osrd_t::antr, clas_osrd_t::cbias, ssr_t::cbias, CLAS_CSSRINVALID, CLAS_MAXAGESSR_BIAS, clas_osr_compensatedisp(), clas_stec_grid_data(), claslib_pcv_slot(), obsd_t::code, code_on_same_freq(), clas_osrd_t::compL, count_nsig(), stec_t::data, clas_grid_t::Emat, clas_grid_t::Gmat, clas_grid_t::index, clas_osrd_t::iono, MAXCODE, stec_t::n, prcopt_t::nf, NFREQPCV, clas_grid_t::num, osr_ctx, clas_osrd_t::pbias, ssr_t::pbias, prcopt_t::pcvr, ssat_t::phw, prcopt_t::posopt, obsd_t::sat, stecd_t::sat, sat_wavelengths(), satsys(), clas_corr_t::smode, nav_s::ssr_ch, clas_corr_t::stec, ssr_t::t0, obsd_t::time, stecd_t::time, time2gpst(), time_str(), timediff(), trace(), clas_grid_t::weight, and clas_osrd_t::wupL.
Referenced by clas_osr_zdres().
| void clas_osr_ctx_init | ( | clas_osr_ctx_t * | ctx | ) |
Initialize OSR conversion context.
| [out] | ctx | OSR context to initialize |
Initialize OSR conversion context.
| [out] | ctx | OSR context to initialize |
Definition at line 297 of file mrtk_clas_osr.c.
References CLAS_CH_NUM, clas_satcorr_t::currtow, clas_osr_ctx_t::initialized, MAXSAT, clas_satcorr_t::prev_orb_tow, clas_satcorr_t::previode, clas_satcorr_t::prevtow, and clas_osr_ctx_t::satcorr.
Referenced by clas_ssr2osr().
| double clas_osr_prectrop | ( | gtime_t | time, |
| const double * | pos, | ||
| const double * | azel, | ||
| double | zwd, | ||
| double | ztd ) |
Precise troposphere model for CLAS (MOPS standard + mapping function).
| [in] | time | Observation time |
| [in] | pos | Receiver position {lat,lon,hgt} (rad,m) |
| [in] | azel | Azimuth/elevation {az,el} (rad) |
| [in] | zwd | Zenith wet delay from grid (m) |
| [in] | ztd | Zenith total delay from grid (m) |
Computes slant tropospheric delay from zenith wet and total delays obtained from CLAS grid interpolation.
| [in] | time | Observation time |
| [in] | pos | Receiver position {lat,lon,hgt} (rad,m) |
| [in] | azel | Azimuth/elevation {az,el} (rad) |
| [in] | zwd | Zenith wet delay from grid (m) |
| [in] | ztd | Zenith total delay from grid (m) |
Definition at line 328 of file mrtk_clas_osr.c.
References geoidh(), get_stTv(), and tropmapf().
Referenced by clas_osr_zdres().
| int clas_osr_satcorr_update | ( | gtime_t | time, |
| gtime_t | teph, | ||
| int | sat, | ||
| const prcopt_t * | opt, | ||
| const nav_t * | nav, | ||
| int | ch, | ||
| clas_osr_ctx_t * | ctx ) |
Compute zero-differenced phase/code residuals with CLAS corrections.
| [in] | obs | Observation data for epoch |
| [in] | n | Number of observations |
| [in] | rs | Satellite positions+velocities (6*n) |
| [in] | dts | Satellite clock corrections (2*n) |
| [in] | vare | Satellite position variances (n) |
| [in] | svh | Satellite health flags (n) |
| [in,out] | nav | Navigation data |
| [in,out] | x | State vector (position extracted from [0:2]) |
| [out] | y | Residuals (n*nf*2) |
| [out] | e | Line-of-sight vectors (3*n) |
| [out] | azel | Azimuth/elevation (2*n) |
| [in] | rtk | RTK control struct |
| [in] | osrlog | Enable OSR logging |
| [in,out] | osr_ctx | OSR context for persistent state |
| [in] | grid | Grid interpolation state |
| [in] | corr | Merged correction snapshot |
| [in,out] | ssat | Satellite status array |
| [in] | opt | Processing options |
| [in,out] | sol | Solution struct |
| [out] | osr | OSR output per satellite |
| [in] | ch | SSR channel (0 or 1) |
Update per-satellite SIS correction state for IODE adjustment.
| [in] | time | Observation time |
| [in] | teph | Time for ephemeris selection |
| [in] | sat | Satellite number |
| [in] | opt | Processing options |
| [in] | nav | Navigation data |
| [in] | ch | SSR channel index |
| [in,out] | ctx | OSR context (satcorr state updated) |
Compute zero-differenced phase/code residuals with CLAS corrections.
Tracks orbit/clock corrections and detects 5-second/25-second SSR boundary transitions. Computes currsis = SIS discontinuity for adjust_cpc/adjust_prc.
Ported from upstream satpos_ssr_sis() in ephemeris.c.
Definition at line 793 of file mrtk_clas_osr.c.
References clas_satcorr_t::clk, cross3(), clas_satcorr_t::currsis, clas_satcorr_t::currtow, ssr_t::dclk, ssr_t::ddeph, ssr_t::deph, dot(), ephpos(), ssr_t::hrclk, ssr_t::iod, ssr_t::iode, MAXAGESSR_SIS, MAXCCORSSR_SIS, MAXECORSSR_SIS, norm(), normv3(), clas_satcorr_t::orb, prcopt_t::posopt, clas_satcorr_t::prev_orb_tow, clas_satcorr_t::previode, clas_satcorr_t::prevsis, clas_satcorr_t::prevtow, clas_osr_ctx_t::satcorr, clas_osr_ctx_t::saved_rr, nav_s::ssr_ch, ssr_t::t0, gtime_t::time, time2gpst(), timediff(), clas_satcorr_t::tow, trace(), and ssr_t::udi.
Referenced by ppp_rtk_pos().
Select frequency pair for multi-frequency processing.
| [in] | sat | Satellite number |
| [in] | opt | Processing options |
| [in] | obs | Observation data |
Returns a bitmask indicating which secondary frequencies to use alongside L1. The selection depends on the satellite system and the processing options posopt[10] (GPS) and posopt[12] (QZS).
Note: MRTKLIB's prcopt_t.posopt[] is 6 elements (indices 0-5) while upstream claslib uses indices up to 12. For forward compatibility the indices 10/12 are checked against the array size; if out of range, default to L1+L2.
| [in] | sat | Satellite number |
| [in] | opt | Processing options |
| [in] | obs | Observation data for this satellite |
Definition at line 368 of file mrtk_clas_osr.c.
References obsd_t::L, obsd_t::P, POSL1, POSL1L2, POSL1L2L5, POSL1L5, POSL1L5_L2, prcopt_t::posopt, satsys(), SYS_GAL, SYS_GPS, and SYS_QZS.
Referenced by clas_osr_zdres(), and udion().
| int clas_osr_zdres | ( | const obsd_t * | obs, |
| int | n, | ||
| const double * | rs, | ||
| const double * | dts, | ||
| const double * | vare, | ||
| const int * | svh, | ||
| nav_t * | nav, | ||
| double * | x, | ||
| double * | y, | ||
| double * | e, | ||
| double * | azel, | ||
| rtk_t * | rtk, | ||
| int | osrlog, | ||
| clas_osr_ctx_t * | osr_ctx, | ||
| clas_grid_t * | grid, | ||
| clas_corr_t * | corr, | ||
| ssat_t * | ssat, | ||
| prcopt_t * | opt, | ||
| sol_t * | sol, | ||
| clas_osrd_t * | osr, | ||
| int | ch ) |
Compute zero-differenced phase/code residuals with CLAS corrections.
Ported from upstream claslib zdres(). This is the ENA_PPP_RTK path (always enabled). CSSR2OSR_VRS path is removed.
Key differences from upstream:
| [in] | obs | Observation data for epoch |
| [in] | n | Number of observations |
| [in] | rs | Satellite positions+velocities (6*n) |
| [in] | dts | Satellite clock corrections (2*n) |
| [in] | vare | Satellite position variances (n) |
| [in] | svh | Satellite health flags (n) |
| [in,out] | nav | Navigation data |
| [in,out] | x | State vector (position extracted from [0:2]) |
| [out] | y | Residuals (n*nf*2), can be NULL |
| [out] | e | Line-of-sight vectors (3*n) |
| [out] | azel | Azimuth/elevation (2*n) |
| [in] | rtk | RTK control struct |
| [in] | osrlog | Enable OSR logging |
| [in,out] | osr_ctx | OSR context for persistent state |
| [in] | grid | Grid interpolation state |
| [in] | corr | Merged correction snapshot |
| [in,out] | ssat | Satellite status array |
| [in] | opt | Processing options |
| [in,out] | sol | Solution struct |
| [out] | osr | OSR output per satellite |
| [in] | ch | SSR channel (0 in MRTKLIB) |
Definition at line 1080 of file mrtk_clas_osr.c.
References clas_osrd_t::antr, sft_t::bias, clas_osrd_t::c, clas_osrd_t::cbias, chk_isb(), CLAS_CSSRINVALID, nav_s::clas_ctx, clas_osr_adjust_cpc(), clas_osr_adjust_prc(), clas_osr_adjust_r_dts(), clas_osr_corrmeas(), clas_osr_prectrop(), clas_osr_selfreqpair(), clas_trop_grid_data(), CLIGHT, clas_osrd_t::clk, obsd_t::code, ssat_t::code, code2freq_num(), clas_osrd_t::compL, clas_osrd_t::CPC, ecef2pos(), prcopt_t::elmin, clas_grid_t::Emat, nav_s::erp, nav_s::filreset, free, FREQ1, FREQ2, geodist(), geterp(), clas_grid_t::Gmat, gpst2utc(), clas_oload_t::gridnum, IB_RTK, clas_grid_t::index, clas_osrd_t::iono, prcopt_t::isb, ISBOPT_TABLE, isL2C(), obsd_t::L, malloc, MAXOBS, MAXSAT, erp_t::n, sft_t::n, clas_grid_t::network, prcopt_t::nf, norm(), clas_grid_t::num, ocean_tide_clasgrid(), prcopt_t::odisp, clas_ctx_t::oload, clas_osrd_t::orb, osr_ctx, obsd_t::P, clas_osrd_t::p, clas_osrd_t::pbias, prcopt_t::phasshft, ssat_t::phw, prcopt_t::posopt, clas_osrd_t::PRC, R2D, sft_t::rectyp, prcopt_t::rectype, clas_osrd_t::relatv, clas_osrd_t::sat, obsd_t::sat, sat_wavelengths(), satazel(), satsys(), nav_s::sfts, shapiro(), clas_osrd_t::sis, clas_corr_t::smode, prcopt_t::snrmask, nav_s::ssr_ch, nav_s::stas, SYS_GAL, ssr_t::t0, testsnr(), prcopt_t::tidecorr, tidedisp(), obsd_t::time, sol_t::time, time2gpst(), time_str(), timeadd(), timediff(), trace(), clas_osrd_t::trop, utc2gpst(), clas_grid_t::weight, windupcorr(), clas_osrd_t::wupL, and xyz2enu().
Referenced by clas_ssr2osr(), and ppp_rtk_pos().
| int clas_read_grid_def | ( | clas_ctx_t * | ctx, |
| const char * | file ) |
Read CLAS grid definition file.
| [in,out] | ctx | CLAS context (stores grid positions) |
| [in] | file | Grid definition file path |
Definition at line 3238 of file mrtk_clas.c.
References CLAS_MAX_GP, CLAS_MAX_NETWORK, clas_ctx_t::grid_pos, clas_ctx_t::gridsel, and trace().
Referenced by execses().
| void clas_restore_backup | ( | clas_ctx_t * | ctx, |
| gtime_t | time, | ||
| clas_grid_t * | grid, | ||
| int | l6mrg ) |
Definition at line 1274 of file mrtk_clas.c.
References clas_ctx_t::backup, backup_cssr_time(), clas_ctx_t::backup_grid, clas_ctx_t::bank, clas_clock_bank_t::c0, clas_corr_t::c0, CLAS_CH_NUM, clas_corr_t::clock_time, clas_ctx_t::current, clas_corr_t::flag, get_close_clock(), init_grid_index(), clas_clock_bank_t::iod, clas_corr_t::iod, MAXSAT, clas_grid_t::network, clas_corr_t::orbit_time, clas_clock_bank_t::prn, clas_corr_t::prn, SSR_CH_NUM, clas_clock_bank_t::time, clas_corr_t::time, timediff(), clas_clock_bank_t::udi, clas_corr_t::udi, clas_bank_ctrl_t::use, and clas_corr_t::use.
Referenced by ppp_rtk_pos().
| int clas_route_l6frame | ( | clas_ctx_t * | ctx, |
| int | prn, | ||
| int | ptn, | ||
| int | l6mrg, | ||
| gtime_t | now ) |
Route one interleaved L6D frame to a CLAS channel (or drop it).
A single UBX/SBF stream from a multi-channel L6 receiver (e.g. u-blox D9C, and future receivers with more channels) carries L6D frames from several QZS PRNs interleaved. Each CLAS channel decodes one PRN's subframe sequence statefully, so frames from different PRNs must NOT be mixed into the same channel. This router keeps each channel locked to a single active source PRN and drops frames from any other PRN, re-locking only after the active source has been silent for CLAS_L6_RELOCK_TIMEOUT seconds.
Channels are keyed by CLAS Transmit Pattern ID (IS-QZSS-L6 ยง4.1.1.2): there are only two patterns, so two channels suffice regardless of how many PRNs the receiver tracks. Single-channel CLAS (l6mrg=0) uses ch 0 only and collapses to whichever pattern is currently active; dual-channel CLAS (l6mrg!=0) maps each pattern to its own channel for merging.
| [in,out] | ctx | CLAS context (holds per-channel PRN/pattern/time lock) |
| [in] | prn | Broadcasting QZS PRN (L6 frame byte buff[4]) |
| [in] | ptn | CLAS Transmit Pattern ID, (buff[5] & 0x06) >> 1 |
| [in] | l6mrg | L6 merge mode (0:single channel, !=0:dual channel) |
| [in] | now | Current observation time (GPST) used for the timeout |
Definition at line 3070 of file mrtk_clas.c.
References CLAS_CH_NUM, CLAS_L6_RELOCK_TIMEOUT, clas_ctx_t::l6delivery, clas_ctx_t::l6lock_time, clas_ctx_t::l6pattern, gtime_t::time, timediff(), and trace().
Referenced by decoderaw().
| void clas_set_l6tag | ( | clas_ctx_t * | ctx, |
| int | ch, | ||
| double | tag ) |
Set the receiver time tag of the L6 frame about to be input.
L6 frames are broadcast once per second and the L6 header has no frame counter, so a lost frame can only be seen from the receiver time. Call this before inputting each frame when the receiver reports a per-frame time (SBF QZSRawL6 block TOW, UBX-RXM-QZSSL6 time tag). A subframe with a frame missing is then discarded instead of being decoded from shifted bits (#363). Inputs without a time tag (raw L6 byte streams and files) are not checked.
| [in,out] | ctx | CLAS context |
| [in] | ch | Channel index (0 or 1) |
| [in] | tag | Receiver time of the frame (s, any origin; 0: unknown) |
Definition at line 3215 of file mrtk_clas.c.
References clas_l6buf_t::ftag, and clas_ctx_t::l6buf.
Referenced by decoderaw().
| int clas_ssr2osr | ( | rtk_t * | rtk, |
| obsd_t * | obs, | ||
| int | n, | ||
| nav_t * | nav, | ||
| clas_osrd_t * | osr, | ||
| int | mode, | ||
| clas_ctx_t * | clas ) |
Convert compact SSR corrections to observation-space representations.
Top-level wrapper that sets up grid/CSSR corrections and calls clas_osr_zdres(). Verbatim port of upstream claslib ssr2osr() from cssr2osr.c.
| [in,out] | rtk | RTK control structure |
| [in,out] | obs | Observation data array |
| [in] | n | Number of observations |
| [in,out] | nav | Navigation data |
| [out] | osr | OSR output per satellite |
| [in] | mode | 0=normal (upstream compat) |
| [in] | clas | CLAS decoder context |
This is the top-level wrapper that sets up satellite state, grid/CSSR corrections, then calls clas_osr_zdres() to compute per-satellite residuals.
| [in,out] | rtk | RTK control structure |
| [in,out] | obs | Observation data array (may be modified) |
| [in] | n | Number of observations |
| [in,out] | nav | Navigation data (SSR corrections applied here) |
| [out] | osr | OSR output per satellite |
| [in] | mode | 0=normal, unused (upstream compat) |
| [in] | clas | CLAS decoder context (replaces upstream globals) |
Definition at line 1493 of file mrtk_clas_osr.c.
References sol_t::age, clas_osrd_t::c, clas_bank_get_close(), clas_check_grid_status(), clas_get_grid_index(), clas_osr_ctx_init(), clas_osr_zdres(), clas_update_global(), clas_update_local(), obsd_t::code, clas_ctx_t::current, ecef2pos(), EPHOPT_SSRAPC, ssat_t::fix, free, clas_ctx_t::grid, obsd_t::L, clas_ctx_t::l6buf, obsd_t::LLI, mat(), MAXOBS, MAXSAT, prcopt_t::mode, clas_grid_t::network, prcopt_t::nf, norm(), rtk_t::opt, osr_ctx, obsd_t::P, clas_osrd_t::p, ssat_t::ph, PMODE_SSR2OSR_FIXED, prcopt_t::posopt, ssat_t::pt, obsd_t::rcv, sol_t::rr, prcopt_t::ru, clas_osrd_t::sat, obsd_t::sat, sat_wavelengths(), satposs(), satsys(), set_ssr_ch_idx(), ssat_t::slip, ssat_t::slipc, clas_corr_t::smode, obsd_t::SNR, ssat_t::snr, SNR_UNIT, rtk_t::sol, SOLQ_SINGLE, rtk_t::ssat, nav_s::ssr_ch, sol_t::stat, ssat_t::sys, ssr_t::t0, clas_l6buf_t::time, obsd_t::time, timediff(), trace(), ssat_t::vsat, rtk_t::x, and zeros().
Referenced by rtkpos().
| int clas_stec_grid_data | ( | clas_corr_t * | corr, |
| const int * | index, | ||
| gtime_t | time, | ||
| int | sat, | ||
| int | n, | ||
| const double * | weight, | ||
| const double * | Gmat, | ||
| const double * | Emat, | ||
| double * | iono, | ||
| double * | rate, | ||
| double * | var, | ||
| int * | brk ) |
Interpolate STEC (ionosphere delay) from grid points.
| [in] | corr | Merged correction snapshot |
| [in] | index | Selected grid point indices |
| [in] | time | Time (GPST) |
| [in] | sat | Satellite number |
| [in] | n | Number of grids (1-4) |
| [in] | weight | Interpolation weights |
| [in] | Gmat | Interpolation matrix (4x4, can be NULL) |
| [in] | Emat | Basis vector (4x1, can be NULL) |
| [out] | iono | Interpolated L1 ionosphere delay (m) |
| [out] | rate | Interpolated ionosphere rate (m/s) |
| [out] | var | Interpolated variance (m^2) |
| [out] | brk | Slip break flag |
Definition at line 588 of file mrtk_clas_grid.c.
References dot(), free, mat(), matmul(), SQR, clas_corr_t::stec, and stec_data().
Referenced by clas_osr_corrmeas().
| int clas_trop_grid_data | ( | clas_corr_t * | corr, |
| const int * | index, | ||
| gtime_t | time, | ||
| int | n, | ||
| const double * | weight, | ||
| const double * | Gmat, | ||
| const double * | Emat, | ||
| double * | zwd, | ||
| double * | ztd, | ||
| int * | tbrk ) |
Interpolate troposphere delay from grid points.
| [in] | corr | Merged correction snapshot |
| [in] | index | Selected grid point indices |
| [in] | time | Time (GPST) |
| [in] | n | Number of grids (1-4) |
| [in] | weight | Interpolation weights |
| [in] | Gmat | Interpolation matrix (4x4, can be NULL) |
| [in] | Emat | Basis vector (4x1, can be NULL) |
| [out] | zwd | Interpolated zenith wet delay |
| [out] | ztd | Interpolated zenith total delay |
| [out] | tbrk | Validity flag (0=all valid, 1=partial) |
Definition at line 749 of file mrtk_clas_grid.c.
References dot(), free, imat(), mat(), matmul(), trop_data(), and clas_corr_t::zwd.
Referenced by clas_osr_zdres().
| void clas_update_global | ( | nav_t * | nav, |
| const clas_corr_t * | corr, | ||
| int | ch ) |
Apply global corrections (orbit/clock/bias) to nav_t.ssr[].
| [in,out] | nav | Navigation data |
| [in] | corr | Merged correction snapshot |
| [in] | ch | Channel index |
Definition at line 1430 of file mrtk_clas.c.
References clas_corr_t::c0, clas_corr_t::cbias, ssr_t::cbias, ssr_t::dclk, ssr_t::ddeph, ssr_t::deph, clas_corr_t::deph0, clas_corr_t::deph1, clas_corr_t::deph2, ssr_t::discnt, clas_corr_t::facility, nav_s::facility, clas_corr_t::iod, ssr_t::iod, clas_corr_t::iode, ssr_t::iode, MAXCODE, MAXSAT, clas_corr_t::pbias, ssr_t::pbias, clas_corr_t::prn, clas_corr_t::smode, nav_s::ssr_ch, ssr_t::t0, clas_corr_t::time, clas_corr_t::udi, ssr_t::udi, and ssr_t::update.
Referenced by clas_ssr2osr(), decoderaw(), ppp_rtk_pos(), and update_clas().
| void clas_update_local | ( | nav_t * | nav, |
| const clas_corr_t * | corr, | ||
| int | ch ) |
Apply local corrections (trop/STEC) to nav_t.
| [in,out] | nav | Navigation data |
| [in] | corr | Merged correction snapshot |
| [in] | ch | Channel index |
Definition at line 1493 of file mrtk_clas.c.
Referenced by clas_ssr2osr(), and ppp_rtk_pos().
| int cssr_gnss2sys | ( | int | gnss, |
| int * | prn0 ) |
Convert CSSR GNSS ID to RTKLIB system bitmask.
| [in] | gnss | CSSR GNSS ID (CSSR_SYS_GPS, etc.) |
| [out] | prn0 | Output base PRN offset (can be NULL) |
Definition at line 175 of file mrtk_clas.c.
References CSSR_SYS_BDS, CSSR_SYS_GAL, CSSR_SYS_GLO, CSSR_SYS_GPS, CSSR_SYS_QZS, CSSR_SYS_SBS, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_NONE, SYS_QZS, and SYS_SBS.
Referenced by svmask2nsatlist(), and svmask2sat().
| int cssr_sys2gnss | ( | int | sys, |
| int * | prn0 ) |
Convert RTKLIB system bitmask to CSSR GNSS ID.
| [in] | sys | RTKLIB system (SYS_GPS, etc.) |
| [out] | prn0 | Output base PRN offset (can be NULL) |
Definition at line 140 of file mrtk_clas.c.
References CSSR_SYS_BDS, CSSR_SYS_GAL, CSSR_SYS_GLO, CSSR_SYS_GPS, CSSR_SYS_NONE, CSSR_SYS_QZS, CSSR_SYS_SBS, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_QZS, and SYS_SBS.
Referenced by sigmask2sig(), and sigmask2sig_p().
| int isL2C | ( | int | code | ) |
Check if observation code is L2C.
| [in] | code | Observation code (CODE_???) |
Definition at line 546 of file mrtk_clas_isb.c.
References CODE_L2L, CODE_L2S, and CODE_L2X.
Referenced by clas_osr_zdres(), and zdres().
| int readblqgrid | ( | const char * | file, |
| clas_ctx_t * | ctx ) |
Read BLQ ocean tide loading parameters for CLAS grid points.
| [in] | file | BLQ grid file |
| [in,out] | ctx | CLAS context (oload[] populated) |
Definition at line 839 of file mrtk_clas_grid.c.
References CLAS_MAX_GP, CLAS_MAX_NETWORK, clas_oload_t::gridnum, clas_oload_t::odisp, clas_ctx_t::oload, clas_oload_t::pos, readblqrecord(), and trace().
Referenced by execses().
| int readisb | ( | const char * | file, |
| nav_t * | nav ) |
Read ISB correction table from file.
| [in] | file | ISB table file path (wild-card * expanded) |
| [in,out] | nav | Navigation data (isb array populated) |
Definition at line 308 of file mrtk_clas_isb.c.
References expath(), free, malloc, MAXEXFILE, nav_s::ni, nav_s::nimax, readisbf(), and trace().
Referenced by execses().
| int readL2C | ( | const char * | file, |
| nav_t * | nav ) |
Read L2C 1/4 cycle phase shift table from file.
| [in] | file | L2C phase shift table file path |
| [in,out] | nav | Navigation data (sfts populated) |
Definition at line 489 of file mrtk_clas_isb.c.
References sft_t::bias, MAXRECTYP, sft_t::n, PHASE_CYCLE, sft_t::rectyp, nav_s::sfts, str2num(), trace(), and trim_str().
Referenced by execses().
| void setisb | ( | const nav_t * | nav, |
| const char * | rectype0, | ||
| const char * | rectype1, | ||
| sta_t * | sta0, | ||
| sta_t * | sta1 ) |
Set ISB corrections for rover and reference stations.
| [in] | nav | Navigation data (contains isb table) |
| [in] | rectype0 | Rover receiver type |
| [in] | rectype1 | Reference receiver type |
| [out] | sta0 | Rover station (isb field populated) |
| [out] | sta1 | Reference station (isb field populated, can be NULL) |
Definition at line 340 of file mrtk_clas_isb.c.
References isb_t::gsb, nav_s::isb, sta_t::isb, nav_s::ni, NSYS, isb_t::sta_name, isb_t::sta_name_base, and trace().
Referenced by execses().