Skip to content

Commit ef8609d

Browse files
Merge pull request #647 from ourairquality/float-snr-std
SNR, P and L std, float storage
2 parents 5459aea + fc73a06 commit ef8609d

34 files changed

Lines changed: 228 additions & 224 deletions

app/consapp/rtkrcv/rtkrcv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ static void probserv(vt_t *vt, int nf)
879879
for (j=0;j<nf;j++) vt_printf(vt,"%13.3f",obs[i].P[j]);
880880
for (j=0;j<nf;j++) vt_printf(vt,"%14.3f",obs[i].L[j]);
881881
for (j=0;j<nf;j++) vt_printf(vt,"%8.1f" ,obs[i].D[j]);
882-
for (j=0;j<nf;j++) vt_printf(vt,"%3.0f" ,obs[i].SNR[j]*SNR_UNIT);
882+
for (j=0;j<nf;j++) vt_printf(vt,"%3.0f" ,obs[i].SNR[j]);
883883
for (j=0;j<nf;j++) vt_printf(vt,"%2d" ,obs[i].LLI[j]);
884884
vt_printf(vt,"\n");
885885
}

app/qtapp/rtknavi_qt/mondlg.cpp

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,8 +1014,11 @@ void MonitorDialog::setObservations()
10141014
const QString label[] = {tr("Trcv (GPST)"), tr("SAT"), tr("STR")};
10151015
int i, j = 0, width[] = {230, 46, 40};
10161016
int nex = ui->cBSelectObservation->currentIndex() ? NEXOBS : 0;
1017+
// Show standard deviations when the extended observations are
1018+
// also selected, but this could be a separate option.
1019+
int std = ui->cBSelectObservation->currentIndex();
10171020

1018-
ui->tWConsole->setColumnCount(3 + (NFREQ + nex) * 6);
1021+
ui->tWConsole->setColumnCount(3 + (NFREQ + nex) * (6 + std * 2));
10191022
ui->tWConsole->setRowCount(0);
10201023
header.clear();
10211024

@@ -1034,11 +1037,19 @@ void MonitorDialog::setObservations()
10341037
for (i = 0; i < NFREQ + nex; i++) {
10351038
ui->tWConsole->setColumnWidth(j++, 135 * fontScale / 96);
10361039
header << (i < NFREQ ? tr("P%1 (m)").arg(i+1) : tr("PX%1 (m)").arg(i - NFREQ + 1));
1040+
if (std) {
1041+
ui->tWConsole->setColumnWidth(j++, 65 * fontScale / 96);
1042+
header << tr("Std");
1043+
}
10371044
}
10381045
for (i = 0; i < NFREQ + nex; i++) {
10391046
ui->tWConsole->setColumnWidth(j++, 160 * fontScale / 96);
10401047
header << (i < NFREQ ? tr("L%1 (cycle)").arg(i+1) : tr("LX%1 (cycle)").arg(i - NFREQ + 1));
1041-
}
1048+
if (std) {
1049+
ui->tWConsole->setColumnWidth(j++, 75 * fontScale / 96);
1050+
header << tr("Std");
1051+
}
1052+
}
10421053
for (i = 0; i < NFREQ + nex; i++) {
10431054
ui->tWConsole->setColumnWidth(j++, 120 * fontScale / 96);
10441055
header << (i < NFREQ ? tr("D%1 (Hz)").arg(i+1) : tr("DX%1 (Hz)").arg(i - NFREQ + 1));
@@ -1057,6 +1068,7 @@ void MonitorDialog::showObservations()
10571068
char tstr[40], id[8], *code;
10581069
int i, k, n = 0, nex = ui->cBSelectObservation->currentIndex() ? NEXOBS : 0;
10591070
int sys = sys_tbl[ui->cBSelectNavigationSystems->currentIndex()];
1071+
int std = ui->cBSelectObservation->currentIndex();
10601072

10611073
obsd_t *obs = static_cast<obsd_t *>(calloc(MAXOBS * 2, sizeof(obsd_t)));
10621074
if (obs == NULL) {
@@ -1100,13 +1112,23 @@ void MonitorDialog::showObservations()
11001112
else ui->tWConsole->item(i, j++)->setText("-");
11011113
}
11021114
for (k = 0; k < NFREQ + nex; k++) {
1103-
if (obs[i].SNR[k]) ui->tWConsole->item(i, j++)->setText(QString::number(obs[i].SNR[k] * SNR_UNIT, 'f', 1));
1115+
if (obs[i].SNR[k]) ui->tWConsole->item(i, j++)->setText(QString::number(obs[i].SNR[k], 'f', 1));
11041116
else ui->tWConsole->item(i, j++)->setText("-");
11051117
}
1106-
for (k = 0; k < NFREQ + nex; k++)
1118+
for (k = 0; k < NFREQ + nex; k++) {
11071119
ui->tWConsole->item(i, j++)->setText(QString::number(obs[i].P[k], 'f', 3));
1108-
for (k = 0; k < NFREQ + nex; k++)
1120+
if (std) {
1121+
if (obs[i].Pstd[k]) ui->tWConsole->item(i, j++)->setText(QString::number(obs[i].Pstd[k], 'f', 3));
1122+
else ui->tWConsole->item(i, j++)->setText("-");
1123+
}
1124+
}
1125+
for (k = 0; k < NFREQ + nex; k++) {
11091126
ui->tWConsole->item(i, j++)->setText(QString::number(obs[i].L[k], 'f', 3));
1127+
if (std) {
1128+
if (obs[i].Lstd[k]) ui->tWConsole->item(i, j++)->setText(QString::number(obs[i].Lstd[k], 'f', 4));
1129+
else ui->tWConsole->item(i, j++)->setText("-");
1130+
}
1131+
}
11101132
for (k = 0; k < NFREQ + nex; k++)
11111133
ui->tWConsole->item(i, j++)->setText(QString::number(obs[i].D[k], 'f', 3));
11121134
for (k = 0; k < NFREQ + nex; k++)

app/qtapp/rtkplot_qt/plotcmn.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ QColor Plot::observationColor(const obsd_t *obs, double az, double el, QVariant
356356
if (obs->L[freq-1] == 0.0 && obs->P[freq-1] == 0.0) {
357357
return Qt::black;
358358
}
359-
color = snrColor(obs->SNR[freq-1] * SNR_UNIT);
359+
color = snrColor(obs->SNR[freq-1]);
360360
} else { // code
361361
for (i = 0; i < NFREQ + NEXOBS; i++) {
362362
if (!strcmp(code2obs(obs->code[i]), qPrintable(obstype.toString()))) break;
@@ -367,7 +367,7 @@ QColor Plot::observationColor(const obsd_t *obs, double az, double el, QVariant
367367
if (obs->L[i] == 0.0 && obs->P[i] == 0.0) {
368368
return Qt::black;
369369
}
370-
color = snrColor(obs->SNR[i] * SNR_UNIT);
370+
color = snrColor(obs->SNR[i]);
371371
}
372372

373373
// check against elevation mask

app/qtapp/rtkplot_qt/plotdata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ void Plot::saveSnrMp(const QString &file)
10391039
time2str(timeadd(gpst2utc(time), 9 * 3600.0), tstr, 1);
10401040
}
10411041
data = QString("%1 %2 %3 %4 %5 %6f\n").arg(tstr).arg(sat, 6).arg(azimuth[j] * R2D, 8, 'f', 1)
1042-
.arg(elevation[j] * R2D, 8, 'f', 1).arg(observation.data[j].SNR[k] * SNR_UNIT, 9, 'f', 2).arg(!multipath[k] ? 0.0 : multipath[k][j], 10, 'f', 4);
1042+
.arg(elevation[j] * R2D, 8, 'f', 1).arg(observation.data[j].SNR[k], 9, 'f', 2).arg(!multipath[k] ? 0.0 : multipath[k][j], 10, 'f', 4);
10431043
fp.write(data.toLatin1());
10441044
}
10451045
}

app/qtapp/rtkplot_qt/plotdraw.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ void Plot::drawSky(QPainter &c, int level)
13891389
if (obs->P[j] == 0.0 && obs->L[j] == 0.0)
13901390
s += "-- ";
13911391
else
1392-
s += QStringLiteral("%1 ").arg(obs->SNR[j] * SNR_UNIT, 2, 'f', 0, QChar('0'));
1392+
s += QStringLiteral("%1 ").arg(obs->SNR[j], 2, 'f', 0, QChar('0'));
13931393
}
13941394

13951395
// LLI
@@ -1412,7 +1412,7 @@ void Plot::drawSky(QPainter &c, int level)
14121412
if (obs->P[freq - 1] == 0.0 && obs->L[freq - 1] == 0.0)
14131413
s += "---- ";
14141414
else
1415-
s += QStringLiteral("%1 ").arg(obs->SNR[freq - 1] * SNR_UNIT, 4, 'f', 1);
1415+
s += QStringLiteral("%1 ").arg(obs->SNR[freq - 1], 4, 'f', 1);
14161416

14171417
// LLI
14181418
if (obs->L[freq-1] == 0.0)
@@ -1434,7 +1434,7 @@ void Plot::drawSky(QPainter &c, int level)
14341434
if (obs->P[j] == 0.0 && obs->L[j] == 0.0)
14351435
s += "---- ";
14361436
else
1437-
s += QStringLiteral("%1 ").arg(obs->SNR[j] * SNR_UNIT, 4, 'f', 1);
1437+
s += QStringLiteral("%1 ").arg(obs->SNR[j], 4, 'f', 1);
14381438

14391439
// LLI
14401440
if (obs->L[j] == 0.0)
@@ -1630,7 +1630,7 @@ void Plot::drawSky(QPainter &c, int level)
16301630
if (obs->P[j] == 0.0 && obs->L[j] == 0.0)
16311631
s += "-- ";
16321632
else
1633-
s += QStringLiteral("%1 ").arg(obs->SNR[j] * SNR_UNIT, 2, 'f', 0, QChar('0'));
1633+
s += QStringLiteral("%1 ").arg(obs->SNR[j], 2, 'f', 0, QChar('0'));
16341634
}
16351635

16361636
// LLI
@@ -1653,7 +1653,7 @@ void Plot::drawSky(QPainter &c, int level)
16531653
if (obs->P[freq - 1] == 0.0 && obs->L[freq - 1] == 0.0)
16541654
s += "---- ";
16551655
else
1656-
s += QStringLiteral("%1 ").arg(obs->SNR[freq - 1] * SNR_UNIT, 4, 'f', 1);
1656+
s += QStringLiteral("%1 ").arg(obs->SNR[freq - 1], 4, 'f', 1);
16571657

16581658
// LLI
16591659
if (obs->L[freq-1] == 0.0)
@@ -1675,7 +1675,7 @@ void Plot::drawSky(QPainter &c, int level)
16751675
if (obs->P[j] == 0.0 && obs->L[j] == 0.0)
16761676
s += "---- ";
16771677
else
1678-
s += QStringLiteral("%1 ").arg(obs->SNR[j] * SNR_UNIT, 4, 'f', 1);
1678+
s += QStringLiteral("%1 ").arg(obs->SNR[j], 4, 'f', 1);
16791679

16801680
// LLI
16811681
if (obs->L[j] == 0.0)
@@ -1734,7 +1734,7 @@ void Plot::drawSolSky(QPainter &c, int level) {
17341734
if (satelliteMask[solstat->sat - 1] || !satelliteSelection[solstat->sat - 1]) continue;
17351735
if (solstat->frq != frq || solstat->el <= 0) continue;
17361736

1737-
QColor col = snrColor(solstat->snr * SNR_UNIT);
1737+
QColor col = snrColor(solstat->snr);
17381738
// Include satellites with invalid data but note this in the color.
17391739
if ((solstat->flag & 0x20) == 0) col = plotOptDialog->getMarkerColor(0, 7);
17401740
// Check against elevation mask.
@@ -1845,7 +1845,7 @@ void Plot::drawSolSky(QPainter &c, int level) {
18451845
if (satelliteMask[solstat->sat - 1] || !satelliteSelection[solstat->sat - 1]) continue;
18461846
if (solstat->frq != frq || solstat->el <= 0) continue;
18471847

1848-
QColor col = snrColor(solstat->snr * SNR_UNIT);
1848+
QColor col = snrColor(solstat->snr);
18491849
// Include satellites with invalid data but note this in the color.
18501850
if ((solstat->flag & 0x20) == 0) col = plotOptDialog->getMarkerColor(0, 7);
18511851
// Check against elevation mask.
@@ -2348,12 +2348,12 @@ void Plot::drawSnr(QPainter &c, int level)
23482348
}
23492349
if (idx >= NFREQ + NEXOBS) continue;
23502350
}
2351-
if (obs->SNR[idx] * SNR_UNIT <= 0.0) continue; // skip negative SNR
2351+
if (obs->SNR[idx] <= 0.0) continue; // skip negative SNR
23522352

23532353
// calculate position
23542354
x[n] = timePosition(obs->time);
23552355
if (panel == 0) { // SNR
2356-
y[n] = obs->SNR[idx] * SNR_UNIT;
2356+
y[n] = obs->SNR[idx];
23572357
col[n] = plotOptDialog->getMarkerColor(0, 4);
23582358
} else if (panel == 1) { // multipath
23592359
if (!multipath[idx] || multipath[idx][j] == 0.0) continue;
@@ -2365,7 +2365,7 @@ void Plot::drawSnr(QPainter &c, int level)
23652365
if (simulatedObservation)
23662366
col[n] = sysColor(obs->sat);
23672367
else
2368-
col[n] = snrColor(obs->SNR[idx] * SNR_UNIT);
2368+
col[n] = snrColor(obs->SNR[idx]);
23692369

23702370
if (elevation[j] > 0.0 && elevation[j] < plotOptDialog->getElevationMask() * D2R) col[n] = plotOptDialog->getMarkerColor(0, 0);
23712371
}
@@ -2546,10 +2546,10 @@ void Plot::drawSnrE(QPainter &c, int level)
25462546
}
25472547
if (idx >= NFREQ + NEXOBS) continue;
25482548
}
2549-
if (obs->SNR[idx] * SNR_UNIT <= 0.0) continue;
2549+
if (obs->SNR[idx] <= 0.0) continue;
25502550

25512551
x[0][n[0]] = x[1][n[1]] = elevation[j] * R2D;
2552-
y[0][n[0]] = obs->SNR[idx] * SNR_UNIT;
2552+
y[0][n[0]] = obs->SNR[idx];
25532553
y[1][n[1]] = !multipath[idx] ? 0.0 : multipath[idx][j];
25542554

25552555
col[0][n[0]] = col[1][n[1]] = (elevation[j] > 0.0 && elevation[j] < plotOptDialog->getElevationMask() * D2R) ?\
@@ -2945,7 +2945,7 @@ void Plot::drawResidual(QPainter &c, int level)
29452945
y[0][m[0]] = solstat->resp;
29462946
y[1][m[1]] = solstat->resc;
29472947
y[2][m[2]] = solstat->el * R2D;
2948-
y[3][m[3]] = solstat->snr * SNR_UNIT;
2948+
y[3][m[3]] = solstat->snr;
29492949

29502950
if (!(solstat->flag >> 5)) q = 0; // invalid
29512951
else if ((solstat->flag & 7) <= 1) q = 2; // float

app/winapp/rtknavi/mondlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ void __fastcall TMonitorDialog::ShowObs(void)
10271027
else Tbl->Cells[j++][i+1]="-";
10281028
}
10291029
for (k=0;k<NFREQ+nex;k++) {
1030-
if (obs[i].SNR[k]) Tbl->Cells[j++][i+1]=s.sprintf("%.1f",obs[i].SNR[k]*SNR_UNIT);
1030+
if (obs[i].SNR[k]) Tbl->Cells[j++][i+1]=s.sprintf("%.1f",obs[i].SNR[k]);
10311031
else Tbl->Cells[j++][i+1]=s.sprintf("-");
10321032
}
10331033
for (k=0;k<NFREQ+nex;k++) {

app/winapp/rtkplot/plotcmn.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ TColor __fastcall TPlot::ObsColor(const obsd_t *obs, double az, double el)
343343
if (obs->L[freq-1]==0.0&&obs->P[freq-1]==0.0) {
344344
return clBlack;
345345
}
346-
color=SnrColor(obs->SNR[freq-1]*SNR_UNIT);
346+
color=SnrColor(obs->SNR[freq-1]);
347347
}
348348
else {
349349
for (i=0;i<NFREQ+NEXOBS;i++) {
@@ -355,7 +355,7 @@ TColor __fastcall TPlot::ObsColor(const obsd_t *obs, double az, double el)
355355
if (obs->L[i]==0.0&&obs->P[i]==0.0) {
356356
return clBlack;
357357
}
358-
color=SnrColor(obs->SNR[i]*SNR_UNIT);
358+
color=SnrColor(obs->SNR[i]);
359359
}
360360
if (el<ElMask*D2R||(ElMaskP&&el<ElMaskData[(int)(az*R2D+0.5)])) {
361361
return HideLowSat?clBlack:MColor[0][0];

app/winapp/rtkplot/plotdata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ void __fastcall TPlot::SaveSnrMp(AnsiString file)
10541054
time2str(timeadd(gpst2utc(time),9*3600.0),tstr,1);
10551055
}
10561056
fprintf(fp,"%s %6s %8.1f %8.1f %9.2f %10.4f\n",tstr,sat,Az[j]*R2D,
1057-
El[j]*R2D,Obs.data[j].SNR[k]*SNR_UNIT,!Mp[k]?0.0:Mp[k][j]);
1057+
El[j]*R2D,Obs.data[j].SNR[k],!Mp[k]?0.0:Mp[k][j]);
10581058
}
10591059
}
10601060
fclose(fp);

app/winapp/rtkplot/plotdraw.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ void __fastcall TPlot::DrawSky(int level)
13511351
ustr+=" ";
13521352
for (j=0;j<NFREQ;j++) {
13531353
if (obs->P[j]==0.0&&obs->L[j]==0.0) ustr+="-- ";
1354-
else ustr+=ss.sprintf("%02.0f ",obs->SNR[j]*SNR_UNIT);
1354+
else ustr+=ss.sprintf("%02.0f ",obs->SNR[j]);
13551355
}
13561356
for (j=0;j<NFREQ;j++) {
13571357
if (obs->L[j]==0.0) ustr+="-";
@@ -1365,7 +1365,7 @@ void __fastcall TPlot::DrawSky(int level)
13651365
obs->P[freq-1]==0.0?"-":"C",obs->L[freq-1]==0.0?"-":"L",
13661366
obs->D[freq-1]==0.0?"-":"D");
13671367
if (obs->P[freq-1]==0.0&&obs->L[freq-1]==0.0) ustr+="---- ";
1368-
else ustr+=ss.sprintf("%4.1f ",obs->SNR[freq-1]*SNR_UNIT);
1368+
else ustr+=ss.sprintf("%4.1f ",obs->SNR[freq-1]);
13691369
if (obs->L[freq-1]==0.0) ustr+=" -";
13701370
else ustr+=ss.sprintf("%2d",obs->LLI[freq-1]);
13711371
}
@@ -1378,7 +1378,7 @@ void __fastcall TPlot::DrawSky(int level)
13781378
obs->P[j]==0.0?"-":"C",obs->L[j]==0.0?"-":"L",
13791379
obs->D[j]==0.0?"-":"D");
13801380
if (obs->P[j]==0.0&&obs->L[j]==0.0) ustr+="---- ";
1381-
else ustr+=ss.sprintf("%4.1f ",obs->SNR[j]*SNR_UNIT);
1381+
else ustr+=ss.sprintf("%4.1f ",obs->SNR[j]);
13821382
if (obs->L[j]==0.0) ustr+=" -";
13831383
else ustr+=ss.sprintf("%2d",obs->LLI[j]);
13841384
}
@@ -1422,7 +1422,7 @@ void __fastcall TPlot::DrawSolSky(int level) {
14221422
if (SatMask[solstat->sat - 1] || !SatSel[solstat->sat - 1]) continue;
14231423
if (solstat->frq != frq || solstat->el <= 0.0) continue;
14241424

1425-
TColor col = SnrColor(solstat->snr*SNR_UNIT);
1425+
TColor col = SnrColor(solstat->snr);
14261426
// Include satellites with invalid data but note this in the color.
14271427
if ((solstat->flag & 0x20) == 0) col = MColor[0][7];
14281428
double azel[2];
@@ -1518,7 +1518,7 @@ void __fastcall TPlot::DrawSolSky(int level) {
15181518
if (SatMask[solstat->sat - 1] || !SatSel[solstat->sat - 1]) continue;
15191519
if (solstat->frq != frq || solstat->el <= 0.0) continue;
15201520

1521-
TColor col = SnrColor(solstat->snr*SNR_UNIT);
1521+
TColor col = SnrColor(solstat->snr);
15221522
// Include satellites with invalid data but note this in the color.
15231523
if ((solstat->flag & 0x20) == 0) col = MColor[0][7];
15241524
double azel[2];
@@ -1955,11 +1955,11 @@ void __fastcall TPlot::DrawSnr(int level)
19551955
}
19561956
if (k>=NFREQ+NEXOBS) continue;
19571957
}
1958-
if (obs->SNR[k]*SNR_UNIT<=0.0) continue;
1958+
if (obs->SNR[k]<=0.0) continue;
19591959

19601960
x[n]=TimePos(obs->time);
19611961
if (i==0) {
1962-
y[n]=obs->SNR[k]*SNR_UNIT;
1962+
y[n]=obs->SNR[k];
19631963
col[n]=MColor[0][4];
19641964
}
19651965
else if (i==1) {
@@ -1970,7 +1970,7 @@ void __fastcall TPlot::DrawSnr(int level)
19701970
else {
19711971
y[n]=El[j]*R2D;
19721972
if (SimObs) col[n]=SysColor(obs->sat);
1973-
else col[n]=SnrColor(obs->SNR[k]*SNR_UNIT);
1973+
else col[n]=SnrColor(obs->SNR[k]);
19741974
if (El[j]>0.0&&El[j]<ElMask*D2R) col[n]=MColor[0][0];
19751975
}
19761976
if (timediff(time,obs->time)==0.0&&np<MAXSAT) {
@@ -2112,10 +2112,10 @@ void __fastcall TPlot::DrawSnrE(int level)
21122112
}
21132113
if (k>=NFREQ+NEXOBS) continue;
21142114
}
2115-
if (obs->SNR[k]*SNR_UNIT<=0.0) continue;
2115+
if (obs->SNR[k]<=0.0) continue;
21162116

21172117
x[0][n[0]]=x[1][n[1]]=El[j]*R2D;
2118-
y[0][n[0]]=obs->SNR[k]*SNR_UNIT;
2118+
y[0][n[0]]=obs->SNR[k];
21192119
y[1][n[1]]=!Mp[k]?0.0:Mp[k][j];
21202120

21212121
col[0][n[0]]=col[1][n[1]]=
@@ -2353,7 +2353,7 @@ void __fastcall TPlot::DrawRes(int level)
23532353
y[0][m[0]]=p->resp;
23542354
y[1][m[1]]=p->resc;
23552355
y[2][m[2]]=p->el*R2D;
2356-
y[3][m[3]]=p->snr*SNR_UNIT;
2356+
y[3][m[3]]=p->snr;
23572357
if (!(p->flag>>5)) q=0; // invalid
23582358
else if ((p->flag&7)<=1) q=2; // float
23592359
else if ((p->flag&7)<=3) q=1; // fixed

src/pntpos.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ static double varerr(const prcopt_t *opt, const ssat_t *ssat, const obsd_t *obs,
6565
/* var = R^2*(a^2 + (b^2/sin(el) + c^2*(10^(0.1*(snr_max-snr_rover)))) + (d*rcv_std)^2) */
6666
varr=SQR(opt->err[1])+SQR(opt->err[2])/sin(el);
6767
if (opt->err[6]>0.0) { /* if snr term not zero */
68-
snr_rover=(ssat)?SNR_UNIT*ssat->snr_rover[0]:opt->err[5];
68+
snr_rover=(ssat)?ssat->snr_rover[0]:opt->err[5];
6969
varr+=SQR(opt->err[6])*pow(10,0.1*MAX(opt->err[5]-snr_rover,0));
7070
}
7171
varr*=SQR(opt->eratio[0]);
7272
if (opt->err[7]>0.0) {
73-
varr+=SQR(opt->err[7]*0.01*(1<<(obs->Pstd[0]+5))); /* 0.01*2^(n+5) m */
73+
varr+=SQR(opt->err[7]*obs->Pstd[0]);
7474
}
7575
if (opt->ionoopt==IONOOPT_IFLC) varr*=SQR(3.0); /* iono-free */
7676
return SQR(fact)*varr;
@@ -98,12 +98,12 @@ static int snrmask(const obsd_t *obs, const double *azel, const prcopt_t *opt)
9898
{
9999
int f2;
100100

101-
if (testsnr(0,0,azel[1],obs->SNR[0]*SNR_UNIT,&opt->snrmask)) {
101+
if (testsnr(0,0,azel[1],obs->SNR[0],&opt->snrmask)) {
102102
return 0;
103103
}
104104
if (opt->ionoopt==IONOOPT_IFLC) {
105105
f2=seliflc(opt->nf,satsys(obs->sat,NULL));
106-
if (testsnr(0,f2,azel[1],obs->SNR[f2]*SNR_UNIT,&opt->snrmask)) return 0;
106+
if (testsnr(0,f2,azel[1],obs->SNR[f2],&opt->snrmask)) return 0;
107107
}
108108
return 1;
109109
}

0 commit comments

Comments
 (0)