Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
einsteinathome
pulsatingscience
Commits
1ed0b772
Commit
1ed0b772
authored
Sep 30, 2017
by
Bruce Allen
Browse files
Moving some code around, no content change, just formatting
parent
bd22b32f
Changes
2
Show whitespace changes
Inline
Side-by-side
lib/antenna_lib.cpp
View file @
1ed0b772
...
...
@@ -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
// from a stand-alone terminal program. This function does not modify
// the input struct, but does populate/modify the output strut!
...
...
@@ -368,13 +396,13 @@ void get_antenna(struct OutputStruct *out, struct InputStruct *in) {
double
iota
=
180
-
inputdata
.
iota
;
double
psi
=
-
inputdata
.
psi
;
#ifdef DEBUG
fprintf
(
stderr
,
"get_antenna(): iota = %f degrees
\n
Psi = %f degrees
\n
"
,
iota
,
psi
);
#endif
iota
*=
deg_to_rad
;
psi
*=
deg_to_rad
;
double
ci
=
cos
(
iota
);
double
c2p
=
cos
(
2
*
psi
);
double
s2p
=
sin
(
2
*
psi
);
...
...
@@ -434,28 +462,3 @@ void get_antenna(struct OutputStruct *out, struct InputStruct *in) {
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
;
}
lib/antenna_main.cpp
View file @
1ed0b772
...
...
@@ -44,7 +44,6 @@ int main(int argc, char *argv[]) {
myinput
.
iota
=
atof
(
argv
[
1
]);
myinput
.
psi
=
atof
(
argv
[
2
]);
// pass inclination angle, polarization axis, orientation offsets
for
(
i
=
0
;
i
<
3
;
i
++
)
myinput
.
orientation
[
i
]
=
0.0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment