Observer

[2]:
from supy.observer import mainObserver, Staralt

Main Observer

[3]:
observer = mainObserver(OBSERVER_TIMEZONE="Asia/Seoul")  # The default is the 7DT timezone.

Current UTC and local time

[4]:
observer.now().fits, observer.localtime().fits
[4]:
('2025-03-31T08:47:40.276', '2025-03-31T08:47:40.276')

Current Moon alt and az

[5]:
observer.moon_altaz()
[5]:
<SkyCoord (AltAz: obstime=2025-03-31 08:47:40.578078, location=(1811649.30826498, -5196623.61799969, -3216227.90778808) m, pressure=0.0 hPa, temperature=0.0 deg_C, relative_humidity=0.0, obswl=1.0 micron): (az, alt, distance) in (deg, deg, AU)
    (103.63152136, -55.54918245, 0.00243714)>

Current Sunrise and Sunset

[6]:
observer.sun_risetime().fits, observer.sun_settime().fits
[6]:
('2025-03-31T09:33:45.483', '2025-03-31T00:01:09.440')

StarAlt

[7]:
star = Staralt()

Select the target

[8]:
star.observer.now()
[8]:
<Time object: scale='utc' format='datetime' value=2025-03-31 08:47:42.159109>
[18]:
star.set_target(211.6522, 0.0648, "target", time_shift=0)
[18]:
Data Attributes:
objname          : target
now_datetime     : 2025-03-31 09:18:59.203872
time_range_start : 2025-03-30 21:33:15.506510
time_range_end   : 2025-03-31 12:01:41.109275
target_times     : [174 items]
target_alts      : [174 items]
target_moonsep   : [174 items]
visibility       : [174 items]
color_target     : [174 items]
moon_times       : [174 items]
moon_alts        : [174 items]
sun_times        : [174 items]
sun_alts         : [174 items]
tonight          : {'sunset_night': datetime.datetime(2025, 3, 31, 0, 1, 9, 328894), 'sunrise_night': datetime.datetime(2025, 3, 31, 9, 33, 45, 455117), 'sunset_civil': datetime.datetime(2025, 3, 30, 22, 37, 33, 678046), 'sunrise_civil': datetime.datetime(2025, 3, 31, 10, 57, 27, 446144)}
target_minalt    : 30
target_minmoonsep: 30

Check observability

[19]:
star.min_max_obstime
[19]:
('2025-03-31T09:21:03.078706', '2025-03-31T09:31:05.455617')

Next available time

[20]:
star.next_observable_night()
[20]:
('2025-03-31T09:21:03.078706', '2025-03-31T09:31:05.455617')
[30]:
star.data.tonight
[30]:
{'sunset_night': datetime.datetime(2025, 3, 31, 0, 1, 9, 328894),
 'sunrise_night': datetime.datetime(2025, 3, 31, 9, 33, 45, 455117),
 'sunset_civil': datetime.datetime(2025, 3, 30, 22, 37, 33, 678046),
 'sunrise_civil': datetime.datetime(2025, 3, 31, 10, 57, 27, 446144)}

Plot the visibility

[22]:
star.plot_staralt()
../_images/examples_observer_21_0.png
[ ]: