Created
January 5, 2020 10:47
-
-
Save torrance/d2f968a0a7f35fbfe44fca30c07b1dee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <beam2016implementation.h> | |
#include <complex> | |
#include <math.h> | |
extern "C" { | |
Beam2016Implementation* beam_new(double* delays, double* amps, char* path) { | |
return new Beam2016Implementation(delays, amps, path); | |
} | |
void beam_del(Beam2016Implementation* beam) { | |
delete beam; | |
} | |
void beamjones(Beam2016Implementation* beam, int freq, size_t N, double* alts, double* azs, std::complex<double>* jones) { | |
for (size_t i = 0; i < N; i++) { | |
double az_deg = azs[i] * (180./M_PI); | |
double za_deg = (90. - alts[i]) * (180./M_PI); | |
auto j = beam->CalcJones(az_deg, za_deg, freq, false); | |
jones[4 * i + 0] = j.j00; | |
jones[4 * i + 1] = j.j01; | |
jones[4 * i + 2] = j.j10; | |
jones[4 * i + 3] = j.j11; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment