¶ PPP_main.m
graph TD
A["Start<br/>settings from GUI or .mat file"] --> B["Prepare<br/>create results folder, waitbar, frequency and bias checks"]
B --> C["readAllInputFiles<br/>ephemerides, observations, corrections"]
C --> D["Determine epoch range<br/>from configured time frame"]
D --> E["initProcessing<br/>build Epoch, satellites, storeData, Adjust"]
E --> F{Filter direction}
F -->|Forward| G["q_range over all epochs<br/>direction-dependent order"]
F -->|Fwd-Bwd| G
F -->|Bwd-Fwd| G
F -->|Backwards| G
G --> H(("for q in q_range"))
subgraph LOOP[Epoch-wise processing - repeats each epoch]
L1["EpochlyReset_Epoch"] --> L2["Read epoch observations<br/>RINEX2Epoch / RawSensor2Epoch"]
L2 --> L3{"Usable epoch and<br/>enough satellites?"}
L3 -- no --> L3S["SkipEpoch"]
L3 -- yes --> L4["resetSolution, RemoveSort,<br/>findEphCorr2Brdc"]
L4 --> L5["prepareObservations<br/>multipath and SNR checks"]
L5 --> L6["Cycle-slip and receiver<br/>clock-jump detection"]
L6 --> L7["Apply satellite biases<br/>SINEX / DCB / TGD / corr2brdc"]
L7 --> L8["create_LC_observations<br/>build code and phase combinations"]
L8 --> L9["ZD_processing<br/>epoch-wise filter update"]
L9 --> L10["saveData"]
end
H --> L1
L3S --> M{"More epochs<br/>to process?"}
L10 --> M
M -->|yes| L1
M -->|no / stopped| N["shrinkVariables, sparseVariables"]
N --> O["Write settings summary<br/>and settings.mat"]
O --> P["create_output<br/>write result files"]
P --> Q["Push results to<br/>MATLAB base workspace"]
Q --> R["SinglePlotting<br/>open result plots"]
R --> S(["End"])
classDef skipNode fill:#c9852a,stroke:#8a5a1e,color:#2a1a05;
class L3S skipNode
Jump to Table of Content
graph TD
A(["ZD_processing - Adjust, Epoch, settings, input, obs"]) --> B{"settings.IONO.model"}
B -->|Estimate / w constraint| C1["adjPrep_iono"]
B -->|Estimate, decoupled clock| C2["adjPrep_DCM"]
B -->|otherwise| C3["adjPrep_ZD"]
C1 --> D["calc_float_solution<br/>-> float Epoch, Adjust, model"]
C2 --> D
C3 --> D
D --> E{"AMBFIX.bool_AMBFIX?"}
E -->|no| Z(["return with float solution"])
E -->|yes| F{"decoupled clock<br/>model?"}
F -->|no| G["create_HMW_LC<br/>build widelane combination"]
G --> H{"Adjust.fix_now(1)?"}
H -->|no| Z
H -->|yes| I["CheckSatellitesFixable"]
I --> J["handleRefSats<br/>choose reference satellite"]
J --> K{"settings.IONO.model"}
K -->|2-Frequency-IF-LCs| L1["PPPAR_IF"]
K -->|3-Frequency-IF-LCs| L2["PPPAR_3IF"]
K -->|Estimate / off| L3["PPPAR_UC"]
K -->|otherwise| L4["not implemented<br/>warning printed"]
L1 --> Z
L2 --> Z
L3 --> Z
L4 --> Z
F -->|yes| M["CheckSatellitesFixable"]
M --> N["PPPAR_DCM<br/>fix ambiguities + compute fixed solution"]
N --> Z
classDef warnNode fill:#c9852a,stroke:#8a5a1e,color:#2a1a05;
class L4 warnNode
Jump to Table of Content
graph TD
A(["calc_float_solution - input, obs, Adjust, Epoch, settings"]) --> B["Init model struct<br/>approximate position / velocity if needed"]
B --> C{"Kalman Filter and<br/>no float solution yet?"}
C -->|yes| D["Bootstrap: recursive call with<br/>No Filter to get initial parameters"]
C -->|no| E
D --> E["Start linearization loop<br/>max DEF.ITERATION_MAX_NUMBER"]
subgraph ITER[Per iteration]
F{"1st iteration, or<br/>coordinate / clock jump?"}
F -->|yes| G["modelErrorSources<br/>model all error sources"]
F -->|no| H
G --> H["getReceiverClockBiases<br/>update line-of-sight and range"]
H --> I{"check_omc<br/>enabled?"}
I -->|yes| J["check_omc<br/>outlier detection"]
I -->|no| K
J --> K["Initialize float ambiguities<br/>and ionosphere parameters"]
K --> L["model_observations<br/>build modeled code / phase / Doppler"]
L --> M{"decoupled clock<br/>model?"}
M -->|yes| N["CheckSatellitesFixable<br/>handleRefSats"]
M -->|no| O
N --> O["Build design matrix A and omc<br/>DSM_ZD / DSM_DCM / DSM_code_ZD"]
O --> P["createObsCovariance"]
P --> Q{"enough observations<br/>remaining?"}
Q -->|no| R["Abort epoch<br/>set residuals to NaN, return"]
Q -->|yes| S{"settings.ADJ<br/>filter.type"}
S -->|Kalman Filter Iterative| T["KalmanFilterIterative<br/>inner-epoch iteration"]
S -->|Kalman Filter| U["KalmanFilter, calc_res<br/>single shot, no inner iteration"]
S -->|No Filter| V["adjustment<br/>single-epoch LSQ"]
T --> W{"parameter change<br/>below threshold?"}
V --> W
W -->|no, iterate again| F
W -->|yes| X["stop_iteration<br/>save float solution"]
end
E --> F
X --> Y["Handle results:<br/>convergence check, reset ambiguity /<br/>ionosphere / cycle-slip parameters"]
U --> Y
R --> Z(["Return Epoch, Adjust, model"])
Y --> Z
classDef warnNode fill:#c9852a,stroke:#8a5a1e,color:#2a1a05;
class R warnNode
Jump to Table of Content
graph TD
A(["modelErrorSources - settings, input, Epoch, model, Adjust, obs"]) --> B["Approximate receiver position<br/>ECEF -> WGS84 lat, lon, height"]
B --> C{"model.first_call?"}
C -->|yes| D["Sun / moon position, station<br/>displacement models solid tides, ocean<br/>loading, polar tides, LL-to-ECEF rotation"]
C -->|no| E
D --> E["Epoch-wide troposphere data<br/>VMF3 / VMF1 / GRAD / GPT3 interpolation"]
E --> F(("for each satellite in Epoch.sats"))
subgraph SAT[Per-satellite modeling]
G{"valid code<br/>observations?"}
G -->|no| G1["exclude satellite"]
G -->|yes| H["Select GNSS-specific data<br/>PCO / PCV, precise or broadcast orbits and clocks"]
H --> I{"broadcast ephemeris<br/>column found?"}
I -->|no| I1["exclude satellite"]
I -->|yes| J["Satellite clock correction<br/>precise clk file or broadcast"]
J --> K["Iterate x2: satellite position,<br/>earth-rotation and relativistic correction"]
K --> L["Line-of-sight vector, range,<br/>azimuth / elevation, cutoff check"]
L --> M["Boresight angle, satellite orientation<br/>yaw-steering model or ORBEX attitude"]
M --> N["Range corrections:<br/>phase wind-up, Shapiro effect"]
N --> O["Troposphere:<br/>ZHD / ZWD plus mapping functions and gradients"]
O --> P["Ionosphere correction<br/>per settings.IONO.source: IONEX, Klobuchar,<br/>NeQuick, BDGIM, NTCM-G, CODE SH"]
P --> Q["Station displacements<br/>projected onto line of sight"]
Q --> R{"eclipsing<br/>satellite?"}
R -->|yes| R1["exclude satellite"]
R -->|no| S
R1 --> S["Phase center offsets and variations<br/>receiver / satellite PCO, PCV, group delay variation"]
S --> T["Assign all modeled values<br/>to struct model and Epoch"]
end
F --> G
G1 --> U{"more satellites<br/>to process?"}
I1 --> U
T --> U
U -->|yes| G
U -->|no| V(["Return model, Epoch"])
classDef skipNode fill:#c9852a,stroke:#8a5a1e,color:#2a1a05;
class G1,I1,R1 skipNode
Jump to Table of Content