Commit 1ed0b772 authored by Bruce Allen's avatar Bruce Allen
Browse files

Moving some code around, no content change, just formatting

parent bd22b32f
...@@ -340,6 +340,34 @@ void get_UV_combinations(int det, double *alpha, double *beta, double *rdotn) { ...@@ -340,6 +340,34 @@ void get_UV_combinations(int det, double *alpha, double *beta, double *rdotn) {
} }
void print_angles(int i) {
// prints angles between line in between detector i arms and direction to source
double line1[3];
double line2[3];
double sqrt2 = sqrt(2.0);
int j;
// loop over coordinates
for (j=0; j<3; j++) {
line1[j]=(detectors[i].lx[j]+detectors[i].ly[j])/sqrt2;
line2[j]=(detectors[i].lx[j]-detectors[i].ly[j])/sqrt2;
}
float cosang1 = 0.0;
float cosang2 = 0.0;
for (j=0; j<3; j++) {
cosang1 += line1[j]*source.vec[j];
cosang2 += line2[j]*source.vec[j];
}
printf("%s: Cos ang1 = %f, ang1 = %f deg\n", detectors[i].name, cosang1, acos(cosang1)/deg_to_rad);
printf("%s: Cos ang2 = %f, ang2 = %f deg\n", detectors[i].name, cosang2, acos(cosang2)/deg_to_rad);
return;
}
// library function that can be called either from the GUI code or // library function that can be called either from the GUI code or
// from a stand-alone terminal program. This function does not modify // from a stand-alone terminal program. This function does not modify
// the input struct, but does populate/modify the output strut! // the input struct, but does populate/modify the output strut!
...@@ -368,13 +396,13 @@ void get_antenna(struct OutputStruct *out, struct InputStruct *in) { ...@@ -368,13 +396,13 @@ void get_antenna(struct OutputStruct *out, struct InputStruct *in) {
double iota = 180-inputdata.iota; double iota = 180-inputdata.iota;
double psi = -inputdata.psi; double psi = -inputdata.psi;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "get_antenna(): iota = %f degrees\nPsi = %f degrees\n", iota, psi); fprintf(stderr, "get_antenna(): iota = %f degrees\nPsi = %f degrees\n", iota, psi);
#endif #endif
iota *= deg_to_rad; iota *= deg_to_rad;
psi *= deg_to_rad; psi *= deg_to_rad;
double ci = cos(iota); double ci = cos(iota);
double c2p = cos(2*psi); double c2p = cos(2*psi);
double s2p = sin(2*psi); double s2p = sin(2*psi);
...@@ -434,28 +462,3 @@ void get_antenna(struct OutputStruct *out, struct InputStruct *in) { ...@@ -434,28 +462,3 @@ void get_antenna(struct OutputStruct *out, struct InputStruct *in) {
return; return;
} }
void print_angles(int i) {
// prints angles between line in between detector i arms and direction to source
double line1[3];
double line2[3];
double sqrt2 = sqrt(2.0);
int j;
// loop over coordinates
for (j=0; j<3; j++) {
line1[j]=(detectors[i].lx[j]+detectors[i].ly[j])/sqrt2;
line2[j]=(detectors[i].lx[j]-detectors[i].ly[j])/sqrt2;
}
float cosang1 = 0.0;
float cosang2 = 0.0;
for (j=0; j<3; j++) {
cosang1 += line1[j]*source.vec[j];
cosang2 += line2[j]*source.vec[j];
}
printf("%s: Cos ang1 = %f, ang1 = %f deg\n", detectors[i].name, cosang1, acos(cosang1)/deg_to_rad);
printf("%s: Cos ang2 = %f, ang2 = %f deg\n", detectors[i].name, cosang2, acos(cosang2)/deg_to_rad);
return;
}
...@@ -44,7 +44,6 @@ int main(int argc, char *argv[]) { ...@@ -44,7 +44,6 @@ int main(int argc, char *argv[]) {
myinput.iota = atof(argv[1]); myinput.iota = atof(argv[1]);
myinput.psi = atof(argv[2]); myinput.psi = atof(argv[2]);
// pass inclination angle, polarization axis, orientation offsets // pass inclination angle, polarization axis, orientation offsets
for (i=0;i<3;i++) myinput.orientation[i]=0.0; for (i=0;i<3;i++) myinput.orientation[i]=0.0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment