1- print ("""Photopollution Calculator Copyright (C) 2018 Conor Casey
1+ print ("""Photopollution Calculator Copyright (C) 2019 Conor Casey
22This program comes with ABSOLUTELY NO WARRANTY.
33This is free software, and you are welcome to redistribute it
44under certain conditions. For further details, type `license'.
77To get a history of the updates released for this program, type "updates"
88To exit the program, type 'quit'.
99
10- Current Edition: v2 .0.0""" )
10+ Current Edition: v3 .0.0""" )
1111
1212def main ():
1313 #Imports Population Density Data from the Central Statistics Office
@@ -72,37 +72,27 @@ def main():
7272 main ()
7373
7474 #Calculation of Light Pollution
75- lux = 0.03510566 * user_input - 14.32414198
76-
77- #Get Limerick's Population Density In Order to Understand what the LUX Values Mean
78- limerick = pd_data [pd_data .Towns .isin (["Limerick City" ])]
79- limerick .reset_index (inplace = True , drop = True )
80- limerick_pd = float (limerick .PD )
81- limerick_lux = 0.03510566 * (limerick_pd ) - 14.32414198
75+ sqm = - 2.51632097e-03 * user_input + 2.07271443e+01
8276
8377 #Understanding LUX Values
84- calculations = (lux ) / (limerick_lux ) * 100
8578 def conditions ():
86- if calculations >= 80 :
87- return " Terrible Stargazing Conditions"
88- elif calculations >= 60 :
89- return " Poor Stargazing Conditions"
90- elif calculations >= 40 :
91- return " Fair Stargazing Conditions"
92- elif calculations >= 20 :
79+ if sqm > 21 :
80+ return " Excellent Stargazing Conditions"
81+ elif sqm > 20 :
82+ return " Great Stargazing Conditions"
83+ elif sqm > 19 :
9384 return " Good Stargazing Conditions"
94- elif calculations >= 0 :
95- return " Excellent Stargazing Conditions"
85+ elif sqm > 18 :
86+ return " Fair Stargazing Conditions"
87+ elif sqm > 17 :
88+ return " Poor Stargazing Conditions"
89+ elif sqm < 17 :
90+ return " Terrible Stargazing Conditions"
9691
9792 #Result/Output
98- if calculations >= 0 :
99- print ("""
100- Photopollution in this location is approximately """ + str (int (math .ceil (lux ))) + " LUX, this should" + """
93+ print ("""
94+ Photopollution in this location is approximately """ + str (round (sqm , 2 )) + " mags / arcsec^2, this should" + """
10195correlate to""" + conditions ())
102- elif calculations < 0 :
103- print ("""
104- Oops, it appears we are getting a negative LUX value. Your population density
105- is extremely low, therefore, this correlates to Excellent Stargazing Conditions.""" )
10696
10797 #Restarts Program
10898 restart = input ("""
@@ -115,4 +105,4 @@ def conditions():
115105 quit ()
116106main ()
117107
118- #End of Code
108+ #End of Code
0 commit comments