Skip to content
Snippets Groups Projects
Commit a700c077 authored by John Romein's avatar John Romein
Browse files

BugID: 225

Test input with base frequency of 49975296 Hz, which is in LOFAR frequency
range.
parent 4efb50e2
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,7 @@ AH_BGL_Processing::~AH_BGL_Processing() ...@@ -52,7 +52,7 @@ AH_BGL_Processing::~AH_BGL_Processing()
void AH_BGL_Processing::define(const KeyValueMap &/*kvm*/) void AH_BGL_Processing::define(const KeyValueMap &/*kvm*/)
{ {
const double baseFrequency = 99950592.0; /* 499th Nyquist zone */ const double baseFrequency = 49975296.0; /* 250th Nyquist zone */
ACC::APS::ParameterSet myPset("CS1.cfg"); ACC::APS::ParameterSet myPset("CS1.cfg");
...@@ -71,18 +71,10 @@ void AH_BGL_Processing::define(const KeyValueMap &/*kvm*/) ...@@ -71,18 +71,10 @@ void AH_BGL_Processing::define(const KeyValueMap &/*kvm*/)
void AH_BGL_Processing::init() void AH_BGL_Processing::init()
{ {
double signalFrequency = 100007824.0; /* channel 73 */
const char *env = getenv("SIGNAL_FREQUENCY");
if (env != 0) {
signalFrequency = atof(env);
std::cerr << "setting signal frequency to " << env << '\n';
}
itsWH->basePreprocess(); itsWH->basePreprocess();
// Fill inDHs here // Fill inDHs here
itsWH->get_DH_Subband()->setTestPattern(signalFrequency); //itsWH->get_DH_Subband()->setTestPattern(signalFrequency);
itsWH->get_DH_RFI_Mitigation()->setTestPattern(); itsWH->get_DH_RFI_Mitigation()->setTestPattern();
#if defined DELAY_COMPENSATION #if defined DELAY_COMPENSATION
...@@ -92,8 +84,18 @@ void AH_BGL_Processing::init() ...@@ -92,8 +84,18 @@ void AH_BGL_Processing::init()
void AH_BGL_Processing::run(int steps) void AH_BGL_Processing::run(int steps)
{ {
double signalFrequency = 50032528.0; /* channel 73 */
const char *env = getenv("SIGNAL_FREQUENCY");
if (env != 0) {
signalFrequency = atof(env);
std::cerr << "setting signal frequency to " << env << '\n';
}
for (int i = 0; i < steps; i ++) { for (int i = 0; i < steps; i ++) {
itsWH->get_DH_Subband()->setTestPattern(signalFrequency + i);
itsWH->baseProcess(); itsWH->baseProcess();
itsWH->get_DH_Visibilities()->checkCorrelatorTestPattern();
} }
} }
...@@ -105,7 +107,7 @@ void AH_BGL_Processing::dump() const ...@@ -105,7 +107,7 @@ void AH_BGL_Processing::dump() const
void AH_BGL_Processing::postrun() void AH_BGL_Processing::postrun()
{ {
// check result here // check result here
itsWH->get_DH_Visibilities()->checkCorrelatorTestPattern(); //itsWH->get_DH_Visibilities()->checkCorrelatorTestPattern();
} }
void AH_BGL_Processing::undefine() void AH_BGL_Processing::undefine()
......
...@@ -65,8 +65,8 @@ void DH_FineDelay::setTestPattern() ...@@ -65,8 +65,8 @@ void DH_FineDelay::setTestPattern()
memset(itsDelays, 0, sizeof(AllDelaysType)); memset(itsDelays, 0, sizeof(AllDelaysType));
#if NR_STATIONS >= 2 #if NR_STATIONS >= 2
(*itsDelays)[1].delayAtBegin = 2.499804413e-9; (*itsDelays)[1].delayAtBegin = 4.996749315e-9;
(*itsDelays)[1].delayAfterEnd = 2.499804413e-9; (*itsDelays)[1].delayAfterEnd = 4.996749315e-9;
#endif #endif
} }
......
...@@ -98,7 +98,7 @@ void DH_Subband::setTestPattern(double Hz) ...@@ -98,7 +98,7 @@ void DH_Subband::setTestPattern(double Hz)
#if 1 #if 1
const double c = 299792458; const double c = 299792458;
const double antennaDistance = 2.997690041 * .25; // meter const double antennaDistance = 5.99195103633380268132 * .25; // meter
double labda = c / Hz; double labda = c / Hz;
double phaseShift = 2 * M_PI * antennaDistance / labda; double phaseShift = 2 * M_PI * antennaDistance / labda;
...@@ -126,7 +126,7 @@ void DH_Subband::setTestPattern(double Hz) ...@@ -126,7 +126,7 @@ void DH_Subband::setTestPattern(double Hz)
memset(itsFlags, 0, sizeof *itsFlags); memset(itsFlags, 0, sizeof *itsFlags);
#if NR_INPUT_SAMPLES >= 17000 #if 0 && NR_INPUT_SAMPLES >= 17000
(*itsFlags)[4][14000] = true; (*itsFlags)[4][14000] = true;
(*itsFlags)[5][17000] = true; (*itsFlags)[5][17000] = true;
#endif #endif
......
...@@ -79,31 +79,47 @@ void DH_Visibilities::fillDataPointers() ...@@ -79,31 +79,47 @@ void DH_Visibilities::fillDataPointers()
void DH_Visibilities::checkCorrelatorTestPattern() void DH_Visibilities::checkCorrelatorTestPattern()
{ {
#if 0
float sum = 0.0;
for (int ch = 0; ch < NR_SUBBAND_CHANNELS; ch ++)
sum += real((*itsVisibilities)[0][ch][0][0]);
std::cout << sum << '\n';
#endif
//std::cout << (*itsVisibilities)[0][73][0][0] << ' ' << (*itsVisibilities)[0][74][0][0] << '\n';
#if 1
static const int channels[] = { 0, 73, 255 }; static const int channels[] = { 0, 73, 255 };
for (int stat1 = 0; stat1 < std::min(NR_STATIONS, 8); stat1 ++) { for (int stat1 = 0; stat1 < std::min(NR_STATIONS, 8); stat1 ++) {
for (int stat2 = stat1; stat2 < std::min(NR_STATIONS, 8); stat2 ++) { for (int stat2 = stat1; stat2 < std::min(NR_STATIONS, 8); stat2 ++) {
std::cerr << "S(" << stat1 << ") * ~S(" << stat2 << ") :\n"; std::cout << "S(" << stat1 << ") * ~S(" << stat2 << ") :\n";
int bl = baseline(stat1, stat2); int bl = baseline(stat1, stat2);
for (int pol1 = 0; pol1 < NR_POLARIZATIONS; pol1 ++) { for (int pol1 = 0; pol1 < NR_POLARIZATIONS; pol1 ++) {
for (int pol2 = 0; pol2 < NR_POLARIZATIONS; pol2 ++) { for (int pol2 = 0; pol2 < NR_POLARIZATIONS; pol2 ++) {
std::cerr << " " << (char) ('x' + pol1) << (char) ('x' + pol2) << ':'; std::cout << " " << (char) ('x' + pol1) << (char) ('x' + pol2) << ':';
for (int chidx = 0; chidx < sizeof(channels) / sizeof(int); chidx ++) { for (int chidx = 0; chidx < sizeof(channels) / sizeof(int); chidx ++) {
int ch = channels[chidx]; int ch = channels[chidx];
if (ch < NR_SUBBAND_CHANNELS) { if (ch < NR_SUBBAND_CHANNELS) {
std::cerr << ' ' << (*itsVisibilities)[bl][ch][pol1][pol2] << '/' << (*itsNrValidSamplesCounted)[bl][ch]; std::cout << ' ' << (*itsVisibilities)[bl][ch][pol1][pol2] << '/' << (*itsNrValidSamplesCounted)[bl][ch];
} }
} }
std::cerr << '\n'; std::cout << '\n';
} }
} }
} }
} }
std::cerr << "newgraph yaxis log newcurve linetype solid marktype x pts\n"; std::cout << "newgraph yaxis newcurve linetype solid marktype none pts\n";
float max = 0.0;
for (int ch = 0; ch < NR_SUBBAND_CHANNELS; ch ++)
if (real((*itsVisibilities)[0][ch][0][0]) > max)
max = real((*itsVisibilities)[0][ch][0][0]);
for (int ch = 0; ch < NR_SUBBAND_CHANNELS; ch ++) for (int ch = 0; ch < NR_SUBBAND_CHANNELS; ch ++)
std::cerr << ch << ' ' << real((*itsVisibilities)[0][ch][0][0]) << '\n'; std::cout << ch << ' ' << (10 * std::log10(real((*itsVisibilities)[0][ch][0][0]) / max)) << '\n';
#endif
} }
void DH_Visibilities::setStorageTestPattern(int factor) void DH_Visibilities::setStorageTestPattern(int factor)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment