diff --git a/astro.cpp b/astro.cpp index 6fffb4853..e34745a9d 100644 --- a/astro.cpp +++ b/astro.cpp @@ -120,8 +120,7 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const QString message; { QTextStream out {&message}; - out - << " " << date << "\n" + out << " " << date << "\n" "UTC: " << utc << "\n" << fixed << qSetFieldWidth (6) @@ -140,67 +139,15 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const "Dec: " << decmoon << "\n" "SunAz: " << azsun << "\n" "SunEl: " << elsun << "\n" - "Freq: " << nfreq << "\n" - "Tsky: " << ntsky << "\n" - "MNR: " << xnr << "\n" - "Dgrd: " << dgrd; + "Freq: " << nfreq << "\n"; + if(nfreq>=50) { //Suppress data not relevant below VHF + out << "Tsky: " << ntsky << "\n" + "MNR: " << xnr << "\n" + "Dgrd: " << dgrd; + } } 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}; //Apply Doppler corrections only for 50 MHz and above if (freq_moon >= 50000000) { diff --git a/lib/astro.f90 b/lib/astro.f90 index c446e85ed..c1d1b5a63 100644 --- a/lib/astro.f90 +++ b/lib/astro.f90 @@ -87,7 +87,7 @@ subroutine astro(nyear,month,nday,uth,freq8,Mygrid, & endif 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 tsys=tsky+tr dgrd=-10.0*log10(tsys/tsysmin) + dbMoon diff --git a/lib/avecho.f90 b/lib/avecho.f90 index 88916ba20..e36c32807 100644 --- a/lib/avecho.f90 +++ b/lib/avecho.f90 @@ -3,9 +3,10 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,xlevel,sigdb,snr,dfreq,width) integer TXLENGTH parameter (TXLENGTH=27648) !27*1024 parameter (NFFT=32768,NH=NFFT/2) + parameter (NZ=4096) integer*2 id2(34560) !Buffer for Rx data - real sa(4096) !Avg spectrum relative to initial Doppler echo freq - real sb(4096) !Avg spectrum with Dither and changing Doppler removed + real sa(NZ) !Avg spectrum relative to initial Doppler echo freq + real sb(NZ) !Avg spectrum with Dither and changing Doppler removed integer nsum !Number of integrations real dop0 !Doppler shift for initial 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) complex c(0:NH) 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 dop=ndop @@ -48,7 +49,7 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,xlevel,sigdb,snr,dfreq,width) nsum=nsum+1 - do i=1,4096 + do i=1,NZ 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 enddo @@ -58,7 +59,7 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,xlevel,sigdb,snr,dfreq,width) sum=0. sq=0. - do i=1,4096 + do i=1,NZ y=r0 + (r1-r0)*(i-100.0)/1800.0 blue(i)=sa(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. 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) enddo 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) enddo 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) do i=1,nsmo - call smo121(red,4096) - call smo121(blue,4096) + call smo121(red,NZ) + call smo121(blue,NZ) enddo 900 return