I am trying to pull 2 separate variable from 2 arrays and have python solve a set of equations using both variables. I need to use the variables in pairs only, the arrays are already in the correct order so I feel like I just need to enumerate the variables so python only uses each variable once instead of what it is currently doing which is computing every possible combination of the variables.
pa
is Phase Angle in radians, such as: 1.20729, 1.20616.
distance
is in meters, such as: 34753800.126, 21632361.184.
A
= Area and is set to 1
Ref
is Reflectivity and is set to 0.175
The result should be the apparent magnitude of each pair of variables, such as:
- 13.6148934 (uses 1.20729 and 34753800.126)
- 12.584035 ( uses 1.20616 and 21632361.184)
I don't want a result that uses 1.20729 and 21632361.184
with open('ApparentMagnitude.txt', 'w') as output:
for pa in PA_Rads_Array:
for distance in Meters_Array:
P = (1/pi) * (np.sin(pa) + ((pi - pa) * np.cos(pa)))
RAP = Ref * A * P
RAPd = RAP/(distance**2)
M = -26.7 - (2.5 * np.log10(RAPd))
output.write(str(M) + "\n")