<jupyter_start><jupyter_text>Finding timezone was tricky. Sources:http://tdc-www.harvard.edu/iraf/rvsao/bcvcorr/obsdb.html     (Found timezone)https://greenwichmeantime.com/time-zone/gmt-plus-7/          (Got GMT version)https://en.wikipedia.org/wiki/List_of_tz_database_time_zones (Found location that much timezone)  Location and Dates<jupyter_code># The observer
observatory1 = Observer(longitude = 105.8197 * u.deg,
                    latitude = 32.7802 * u.deg,
                    elevation = 63.4 * u.m,
                    timezone = 'Antarctica/Davis',
                    name = "Apache Point Observatory"
                    )
observatory = Observer.at_site('Apache Point Observatory')
#What I will be observing
my_target = FixedTarget.from_name("M31")

#Observing times
date1 = Time("2019-04-16")
date2 = Time("2019-12-31")
observatory<jupyter_output><empty_output><jupyter_text>How long you can observe it for on the 2 dates<jupyter_code>date = date2
# Copied from Astro300 lecture
astro_set = observatory.twilight_evening_astronomical(date, which='next')
astro_rise = observatory.twilight_morning_astronomical(date, which='next')
midnight_mro = observatory.midnight(date1, which='next')
observing_length = (astro_rise - astro_set).to(u.h)

print("You can observe M31 for {0:.1f} at APO on the December 31st, 2019.".format(observing_length))
date = date1
# Copied from Astro300 lecture
astro_set = observatory.twilight_evening_astronomical(date, which='next')
astro_rise = observatory.twilight_morning_astronomical(date, which='next')
midnight_mro = observatory.midnight(date1, which='next')
observing_length = (astro_rise - astro_set).to(u.h)

print("You can observe M31 for {0:.1f} at APO on the April 4th, 2019.".format(observing_length))<jupyter_output>You can observe M31 for 8.1 h at APO on the April 4th, 2019.<jupyter_text>Best season to view itStrategy: Check viewing coniditions each month and determine best<jupyter_code># Getting a list of dates beginning with the first of each month
dates = list()
for i in range(1,13):
    #Adds 0 if necessary
    appender = ""
    if (i < 10):
        appender = "0"
    
    date = "2019-" + appender + str(i) + "-01 07:00:00"
    item = Time(date)
    dates.append(item)
dates<jupyter_output><empty_output><jupyter_text>Code Taken from Astro 300my_target = FixedTarget.from_name("ngc2403")mro.target_is_up(midnight_mro, my_target)altaz_my_target = mro.altaz(midnight_mro, my_target)altaz_my_target.alt, altaz_my_target.azaltaz_my_target.secz<jupyter_code>visible = observatory.target_is_up(dates,my_target)
visible
# If it is visible I'll find the airmass of it each month
months = list()
vis_for_months = list()
for i in range(len(visible)):
    if visible[i]:
        altaz_my_target = observatory.altaz(dates[i], my_target)
        visibility = altaz_my_target.secz
        if visibility < 2:
            months.append(i)
            vis_for_months.append(visibility)
vis_for_months
months
vis_for_months<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup