Homework 3 Question 3 (William Matzko)

import numpy as np                                                                               
JD = input('Insert the last known transit in Julian Days ')
P = input('Insert the period (in days) of the planet ')
n = input('How many future transits would you like to see? ')
N = np.array(range(1,n+1))

Next_Transit = (JD + P)
print
print"The next transit time is ",Next_Transit," (JD)"
print
Future_Transit = (JD + N*P)
print"Future transits (in JD) are: ",Future_Transit,""
The above code is written in Python 2.7. It prompts the user to enter the last known transit time in Julian Days (this could be the beginning of the transit, the midpoint, etc.), the period of the planet in days, as well as the desired number of future transits. For instance, if you want to see the next 10 transits, you would put in 10 when prompted to do so. It will return the next transit in one line, and then all the future transits in another line, all in Julian Days. I tried adding a feature that would go through the returned array and remove Julian Days that corresponded to daytime, but I couldn't get it to work out. So, it will return all transits, regardless of whether or not they are actually observable from campus. It's a trivial matter though to put the JD into a converter and see what time it corresponds to, so this isn't really a big problem. Attached is a screenshot of the output. 

I have arbitrarily chosen 100 transits to be returned. We can compare this to the NASA Exoplanet Archive (this is also where I got the JD (in UT time) and the period). For the last known transit time, I just entered the midpoint of the transit. My calculator says the next transit midpoint occurs at 2458144.21622 JD. The Archive was set to display visible transit times between January 22 2018 and May 1 2018. It does not agree with my calculator for the next transit time, but this is to be expected because the output date 2458144.21622 JD roughly corresponds to 11 AM Eastern Time. So, the Archive naturally won't display that. The Archive says the next transit occurs at JD (UT) 2458146.87132. This value does appear in my calculator's output (3rd value in the future transit line). So, my calculator is capable of predicting the next midpoints. The Archive says there are only 28 transits in the specified time frame, the last of which occurs at JD 2458235.80356. This value shows up in my calculator (8th line from bottom, second from left). It isn't productive to manually go through each of my returned values and say which are visible from our campus, but as a rule of thumb if the JD has a decimal between x.530 and x.911, it roughly corresponds to nighttime and is likely visible from our campus. 

Comments

Popular posts from this blog

HW5 Q1 (William Matzko)

HW5 Q2, Q3, Q5 (William Matzko)

HW 5 Q6 (William Matzko)