def nautical_twilight(self, date_obs, site_longitude=30.335555, site_latitude=36.824166, site_elevation=2500, site_name="tug", time_zone="Europe/Istanbul", which="next"): # TUG's location info settings tug = Observer(longitude=site_longitude * u.deg, latitude=site_latitude * u.deg, elevation=site_elevation * u.m, name=site_name, timezone=time_zone) # convert date astropy date format astropy_time = Time(date_obs) # evening tw calculate et = tug.twilight_evening_nautical(astropy_time, which=which) # morning tw calculate mt = tug.twilight_morning_nautical(astropy_time, which=which) # localized time conversion return (tug.astropy_time_to_datetime(mt), tug.astropy_time_to_datetime(et))
def nautical_twilight(self, date_obs, site_longitude=30.335555, site_latitude=36.824166, site_elevation=2500, site_name="tug", time_zone="Europe/Istanbul", which="next"): # TUG's location info settings tug = Observer(longitude=site_longitude*u.deg, latitude=site_latitude*u.deg, elevation=site_elevation*u.m, name=site_name, timezone=time_zone) # convert date astropy date format astropy_time = Time(date_obs) # evening tw calculate et = tug.twilight_evening_nautical(astropy_time, which=which) # morning tw calculate mt = tug.twilight_morning_nautical(astropy_time, which=which) # localized time conversion return(tug.astropy_time_to_datetime(mt), tug.astropy_time_to_datetime(et))
def astronomical_twilight(self, date_obs, site_longitude=30.335555, site_latitude=36.824166, site_elevation=2500, site_name="tug", time_zone="Europe/Istanbul", which="next"): """ It calculates astronomical twilight. @param date_obs @type date_obs: date @param site_longitude: Site longitude. @type site_longitude: float @param site_latitude: Site latitude. @type site_latitude: float @param site_elevation: Site elevation. @type site_elevation: float @param site_name: Station name: T60|T100|RTT150. @type site_name: string @param time_zone: Time zone. @type time_zone: int @param which: Which. @type which: string @return: tuple """ # TUG's location info settings tug = Observer(longitude=site_longitude*u.deg, latitude=site_latitude*u.deg, elevation=site_elevation*u.m, name=site_name, timezone=time_zone) # convert date astropy date format astropy_time = Time(date_obs) # evening tw calculate et = tug.twilight_evening_astronomical(astropy_time, which=which) # morning tw calculate mt = tug.twilight_morning_astronomical(astropy_time, which=which) # localized time conversion return(tug.astropy_time_to_datetime(mt), tug.astropy_time_to_datetime(et))
def astronomical_twilight(self, date_obs, site_longitude=30.335555, site_latitude=36.824166, site_elevation=2500, site_name="tug", time_zone="Europe/Istanbul", which="next"): """ It calculates astronomical twilight. @param date_obs @type date_obs: date @param site_longitude: Site longitude. @type site_longitude: float @param site_latitude: Site latitude. @type site_latitude: float @param site_elevation: Site elevation. @type site_elevation: float @param site_name: Station name: T60|T100|RTT150. @type site_name: string @param time_zone: Time zone. @type time_zone: int @param which: Which. @type which: string @return: tuple """ # TUG's location info settings tug = Observer(longitude=site_longitude * u.deg, latitude=site_latitude * u.deg, elevation=site_elevation * u.m, name=site_name, timezone=time_zone) # convert date astropy date format astropy_time = Time(date_obs) # evening tw calculate et = tug.twilight_evening_astronomical(astropy_time, which=which) # morning tw calculate mt = tug.twilight_morning_astronomical(astropy_time, which=which) # localized time conversion return (tug.astropy_time_to_datetime(mt), tug.astropy_time_to_datetime(et))
messier_list = [] messier_not_visible = [] messier_error_list = [] for i, obj in enumerate(star_names): if i > 0 and i % 5 == 0: print("Pausing...") sleep(10) rtime, stime, alt_at_rise, up = get_star_info(obj) if not up or alt_at_rise < 0: # TODO: fix this - we need to check if the object will be up during the interval of time, not at current time… messier_not_visible.append(obj) continue print(f"\n{obj}") try: print("RTime", location.astropy_time_to_datetime(rtime)) print("STime", location.astropy_time_to_datetime(stime)) print("AltRise:", alt_at_rise.to('arcsec')) messier_list.append(obj) except ValueError as ve: messier_error_list.append(obj) print(ve) except Exception as e: messier_error_list.append(obj) print(e) print(f"Currently these {len(messier_list)} Messier objects are up in the sky: ") print(messier_list)