From 2a87c980ae4a3f3ebc3e8e9950e941dcb38d812b Mon Sep 17 00:00:00 2001 From: Sebastiaan van der Tol <tol@astron.nl> Date: Wed, 19 Aug 2020 06:06:32 +0200 Subject: [PATCH] Use option instead of commenting out code --- cpp/element.cc | 18 +++++++++--------- demo/comparison-oskar/stationresponse.cpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cpp/element.cc b/cpp/element.cc index 50ce7295..f3c119ae 100644 --- a/cpp/element.cc +++ b/cpp/element.cc @@ -13,15 +13,15 @@ matrix22c_t Element::LocalResponse(real_t time, real_t freq, id, freq, thetaphi[0], thetaphi[1], reinterpret_cast<std::complex<double>(&)[2][2]>(result)); -// if (options.rotate) { -// vector3r_t up = {0.0, 0.0, 1.0}; -// vector3r_t e_phi = normalize(cross(up, direction)); -// vector3r_t e_theta = cross(e_phi, direction); -// matrix22r_t rotation; -// rotation[0] = {dot(e_theta, options.north), dot(e_theta, options.east)}; -// rotation[1] = {dot(e_phi, options.north), dot(e_phi, options.east)}; -// result = result * rotation; -// } + if (options.rotate) { + vector3r_t up = {0.0, 0.0, 1.0}; + vector3r_t e_phi = normalize(cross(up, direction)); + vector3r_t e_theta = cross(e_phi, direction); + matrix22r_t rotation; + rotation[0] = {dot(e_theta, options.north), dot(e_theta, options.east)}; + rotation[1] = {dot(e_phi, options.north), dot(e_phi, options.east)}; + result = result * rotation; + } return result; } diff --git a/demo/comparison-oskar/stationresponse.cpp b/demo/comparison-oskar/stationresponse.cpp index ecd6b90f..0f34e492 100644 --- a/demo/comparison-oskar/stationresponse.cpp +++ b/demo/comparison-oskar/stationresponse.cpp @@ -89,7 +89,7 @@ int main(int argc, char** argv){ }; real_t freq0 = 50e6; - auto result = station->Response(time, freq, direction, freq0, station0, tile0); + auto result = station->Response(time, freq, direction, freq0, station0, tile0, false); result_arr[i][j][0][0] = result[0][0]; result_arr[i][j][0][1] = result[0][1]; result_arr[i][j][1][0] = result[1][0]; -- GitLab