Last active
April 1, 2019 02:16
-
-
Save timbledum/550e2a618c3dd5ca63eb184f51f02f7b 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
import statistics | |
def calculator(degree, minutes, seconds): | |
calc = 0.0 | |
calc = abs(degree) + (minutes / 60) + (seconds / 3600) | |
minus = "-" if degree < 0 else "" | |
print(f"{degree}° {minutes}` {seconds}`` --> {minus}{calc:.2f}") | |
return calc | |
def print_values(FLclac, FRcalc, FaceMean): | |
print("The reduced value for face left is", FLcalc, "(in DD)") | |
print("The reduced value for face right is", FRcalc, "(in DD)") | |
print("The misclosure for the two faces is", (FLcalc - FRcalc), "(in DD)") | |
print( | |
"The Mean Reduced Vertical Angle for this observation is", FaceMean, "(in DD)" | |
) | |
count = 0 | |
while True: | |
con_ask = input("Do you want to continue entering observations? (Y/N)") | |
if con_ask == "Y" or con_ask == "y": | |
print("Enter values for face left of observation", (count + 1), ":") | |
try: | |
degree = int(input("Enter the Degree: ")) | |
minutes = int(input("Enter the Minutes: ")) | |
seconds = int(input("Enter the Seconds: ")) | |
print( | |
"The Values are:", | |
"degree=", | |
degree, | |
"minutes=", | |
minutes, | |
"seconds=", | |
seconds, | |
) | |
except: | |
print("Error #404, please enter values numerically") | |
calc1 = calculator(degree, minutes, seconds) | |
print("Enter values for face right of observation", (count + 1), ":") | |
try: | |
degree = int(input("Enter the Degree: ")) | |
minutes = int(input("Enter the Minutes: ")) | |
seconds = int(input("Enter the Seconds: ")) | |
print( | |
"The Values are:", | |
"degree=", | |
degree, | |
"minutes=", | |
minutes, | |
"seconds=", | |
seconds, | |
) | |
except: | |
print("Error #404, please enter values numerically") | |
calc2 = calculator(degree, minutes, seconds) | |
count = count + 1 | |
FLcalc = 90 - calc1 | |
FRcalc = calc2 - 270 | |
FaceMean = (FLcalc + FRcalc) / 2 | |
print_values(FLcalc, FRcalc, FaceMean) | |
else: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment