Fix bad value of Dgrd. Fix bounds error in avecho. Don't display

astronomical data not relevant below VHF.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5582 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2015-06-11 14:38:31 +00:00
parent 5968277cd7
commit cddc9b20e9
3 changed files with 18 additions and 70 deletions

View File

@ -120,8 +120,7 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const
QString message; QString message;
{ {
QTextStream out {&message}; QTextStream out {&message};
out out << " " << date << "\n"
<< " " << date << "\n"
"UTC: " << utc << "\n" "UTC: " << utc << "\n"
<< fixed << fixed
<< qSetFieldWidth (6) << qSetFieldWidth (6)
@ -140,67 +139,15 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const
"Dec: " << decmoon << "\n" "Dec: " << decmoon << "\n"
"SunAz: " << azsun << "\n" "SunAz: " << azsun << "\n"
"SunEl: " << elsun << "\n" "SunEl: " << elsun << "\n"
"Freq: " << nfreq << "\n" "Freq: " << nfreq << "\n";
"Tsky: " << ntsky << "\n" if(nfreq>=50) { //Suppress data not relevant below VHF
"MNR: " << xnr << "\n" out << "Tsky: " << ntsky << "\n"
"Dgrd: " << dgrd; "MNR: " << xnr << "\n"
"Dgrd: " << dgrd;
}
} }
ui_->text_label->setText(message); ui_->text_label->setText(message);
/*
static QFile f {QDir {QStandardPaths::writableLocation (
QStandardPaths::DataLocation)}.absoluteFilePath ("azel.dat")};
if (!f.open (QIODevice::WriteOnly | QIODevice::Text)) {
QMessageBox mb;
mb.setText ("Cannot open \"" + f.fileName () + "\" for writing:" + f.errorString ());
mb.exec();
return;
}
{
QTextStream out {&f};
out << fixed
<< qSetRealNumberPrecision (1)
<< qSetPadChar ('0')
<< right
<< qSetFieldWidth (2) << nhr
<< qSetFieldWidth (0) << ':'
<< qSetFieldWidth (2) << nmin
<< qSetFieldWidth (0) << ':'
<< qSetFieldWidth (2) << isec
<< qSetFieldWidth (0) << ','
<< qSetFieldWidth (5) << azmoon
<< qSetFieldWidth (0) << ','
<< qSetFieldWidth (5) << elmoon
<< qSetFieldWidth (0) << ",Moon\n"
<< qSetFieldWidth (2) << nhr
<< qSetFieldWidth (0) << ':'
<< qSetFieldWidth (2) << nmin
<< qSetFieldWidth (0) << ':'
<< qSetFieldWidth (2) << isec
<< qSetFieldWidth (0) << ','
<< qSetFieldWidth (5) << azsun
<< qSetFieldWidth (0) << ','
<< qSetFieldWidth (5) << elsun
<< qSetFieldWidth (0) << ",Sun\n"
<< qSetFieldWidth (2) << nhr
<< qSetFieldWidth (0) << ':'
<< qSetFieldWidth (2) << nmin
<< qSetFieldWidth (0) << ':'
<< qSetFieldWidth (2) << isec
<< qSetFieldWidth (0) << ','
<< qSetFieldWidth (5) << 0.
<< qSetFieldWidth (0) << ','
<< qSetFieldWidth (5) << 0.
<< qSetFieldWidth (0) << ",Sun\n"
<< qSetPadChar (' ')
<< qSetFieldWidth (4) << nfreq
<< qSetFieldWidth (0) << ','
<< qSetFieldWidth (6) << ndop
<< qSetFieldWidth (0) << ",Doppler";
}
f.close();
*/
FrequencyDelta astro_correction {0}; FrequencyDelta astro_correction {0};
//Apply Doppler corrections only for 50 MHz and above //Apply Doppler corrections only for 50 MHz and above
if (freq_moon >= 50000000) { if (freq_moon >= 50000000) {

View File

@ -87,7 +87,7 @@ subroutine astro(nyear,month,nday,uth,freq8,Mygrid, &
endif endif
tr=80.0 !Good preamp tr=80.0 !Good preamp
tskymin=13.0*(408.0/freq8)**2.6 !Cold sky temperature tskymin=13.0*(408.0d6/freq8)**2.6 !Cold sky temperature
tsysmin=tskymin+tr tsysmin=tskymin+tr
tsys=tsky+tr tsys=tsky+tr
dgrd=-10.0*log10(tsys/tsysmin) + dbMoon dgrd=-10.0*log10(tsys/tsysmin) + dbMoon

View File

@ -3,9 +3,10 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,xlevel,sigdb,snr,dfreq,width)
integer TXLENGTH integer TXLENGTH
parameter (TXLENGTH=27648) !27*1024 parameter (TXLENGTH=27648) !27*1024
parameter (NFFT=32768,NH=NFFT/2) parameter (NFFT=32768,NH=NFFT/2)
parameter (NZ=4096)
integer*2 id2(34560) !Buffer for Rx data integer*2 id2(34560) !Buffer for Rx data
real sa(4096) !Avg spectrum relative to initial Doppler echo freq real sa(NZ) !Avg spectrum relative to initial Doppler echo freq
real sb(4096) !Avg spectrum with Dither and changing Doppler removed real sb(NZ) !Avg spectrum with Dither and changing Doppler removed
integer nsum !Number of integrations integer nsum !Number of integrations
real dop0 !Doppler shift for initial integration (Hz) real dop0 !Doppler shift for initial integration (Hz)
real dop !Doppler shift for current integration (Hz) real dop !Doppler shift for current integration (Hz)
@ -14,7 +15,7 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,xlevel,sigdb,snr,dfreq,width)
integer ipkv(1) integer ipkv(1)
complex c(0:NH) complex c(0:NH)
equivalence (x,c),(ipk,ipkv) equivalence (x,c),(ipk,ipkv)
common/echocom/nclearave,nsum,blue(4096),red(4096) common/echocom/nclearave,nsum,blue(NZ),red(NZ)
save dop0,sa,sb save dop0,sa,sb
dop=ndop dop=ndop
@ -48,7 +49,7 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,xlevel,sigdb,snr,dfreq,width)
nsum=nsum+1 nsum=nsum+1
do i=1,4096 do i=1,NZ
sa(i)=sa(i) + s(ia+i-2048) !Center at initial doppler freq sa(i)=sa(i) + s(ia+i-2048) !Center at initial doppler freq
sb(i)=sb(i) + s(ib+i-2048) !Center at expected echo freq sb(i)=sb(i) + s(ib+i-2048) !Center at expected echo freq
enddo enddo
@ -58,7 +59,7 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,xlevel,sigdb,snr,dfreq,width)
sum=0. sum=0.
sq=0. sq=0.
do i=1,4096 do i=1,NZ
y=r0 + (r1-r0)*(i-100.0)/1800.0 y=r0 + (r1-r0)*(i-100.0)/1800.0
blue(i)=sa(i)/y blue(i)=sa(i)/y
red(i)=sb(i)/y red(i)=sb(i)/y
@ -93,11 +94,11 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,xlevel,sigdb,snr,dfreq,width)
sum=0. sum=0.
do i=ipk,ipk+300 do i=ipk,ipk+300
if(red(i).lt.1.0) exit if(i.gt.NZ .or. red(i).lt.1.0) exit
sum=sum+(red(i)-1.0) sum=sum+(red(i)-1.0)
enddo enddo
do i=ipk-1,ipk-300,-1 do i=ipk-1,ipk-300,-1
if(red(i).lt.1.0) exit if(i.lt.1 .or. red(i).lt.1.0) exit
sum=sum+(red(i)-1.0) sum=sum+(red(i)-1.0)
enddo enddo
bins=sum/(red(ipk)-1.0) bins=sum/(red(ipk)-1.0)
@ -105,8 +106,8 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,xlevel,sigdb,snr,dfreq,width)
nsmo=max(0.0,0.25*bins) nsmo=max(0.0,0.25*bins)
do i=1,nsmo do i=1,nsmo
call smo121(red,4096) call smo121(red,NZ)
call smo121(blue,4096) call smo121(blue,NZ)
enddo enddo
900 return 900 return