You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: astrophotography.py
+11-10Lines changed: 11 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -23,16 +23,16 @@ def __init__(self):
23
23
config=ConfigParser()
24
24
25
25
# Functions
26
-
defmain():
27
-
setup(config)
28
-
printVariables()
29
-
npfMethod()
30
-
sys.exit()
26
+
defmain():# Functionality -
27
+
setup(config)# Takes config data, sets into appropriate data structs.
28
+
printVariables()# Pretty Prints Variables to be used in calculation.
29
+
npfMethod()# Outputs final shutter speed value.
30
+
sys.exit()# Wraps-up and exits cleanly.
31
31
32
32
defsetup(config):
33
-
try: # Wrapped config.read in a try-except block. #
34
-
config.read(configLocation) # This was done to give the user some - #
35
-
calculation.pixel_pitch=config.get('Pixel Pitch','PIXEL_PITCH') # explanation as to why it failed to execute. #
33
+
try: # Wrapped config.read in a try-except block. #
34
+
config.read(configLocation) # This was done to give the user some - #
35
+
calculation.pixel_pitch=config.get('Pixel Pitch','PIXEL_PITCH') # explanation as to why it failed to execute. #
36
36
37
37
calculation.focal_length= (float(config.get('Specific Camera Variables', 'FOCAL_LENGTH')))
38
38
calculation.aperture=float(config.get('Specific Camera Variables', 'APERTURE'))
@@ -51,8 +51,9 @@ def setup(config):
51
51
raiseException('Could not open config.cfg, this could be down to a permissions error - \nOr even simply that the file does not exist, please check.\n\nhttps://github.com/AxiomYT/NPF-Rule-Calculator-Python\n\nFor further clarification.\n')
print('\033[94m'+"Pixel Pitch -", round(float(calculation.pixel_pitch), 2), "Millimetres"+'\033[0m') # Important that the output is rounded, looks neater. 2x signifigant figures.
54
+
# Important that the outputs are rounded, looks neater. 2x signifigant figures. except for aperture, which can only gain from the specificity.
0 commit comments