Observatory#

class pyscope.observatory.Observatory(config_path=None, **kwargs)[source]#

Bases: object

Attributes Summary

autofocus

autofocus_driver

autofocus_info

autofocus_kwargs

camera

camera_driver

camera_info

camera_kwargs

cooler_setpoint

cooler_tolerance

cover_calibrator

cover_calibrator_alt

cover_calibrator_az

cover_calibrator_driver

cover_calibrator_info

cover_calibrator_kwargs

current_focus_offset

diameter

dome

dome_driver

dome_info

dome_kwargs

elevation

filter_focus_offsets

filter_wheel

filter_wheel_driver

filter_wheel_info

filter_wheel_kwargs

filters

focal_length

focuser

focuser_driver

focuser_info

focuser_kwargs

instrument_description

instrument_name

instrument_reconfiguration_times

last_camera_shutter_status

latitude

longitude

max_dimension

maxim

min_altitude

observatory_info

observatory_location

Returns the EarthLocation object for the observatory

observatory_time

Returns the current observatory time

observing_conditions

observing_conditions_driver

observing_conditions_info

observing_conditions_kwargs

pixel_scale

Returns the pixel scale of the camera

plate_scale

Returns the plate scale of the telescope in arcsec/mm

rotator

rotator_driver

rotator_info

rotator_kwargs

rotator_max_angle

rotator_min_angle

rotator_reverse

safety_monitor

safety_monitor_driver

safety_monitor_info

safety_monitor_kwargs

settle_time

site_name

slew_rate

switch

switch_driver

switch_info

switch_kwargs

telescope

telescope_driver

telescope_info

telescope_kwargs

threads_info

wcs_driver

wcs_info

wcs_kwargs

Methods Summary

connect_all()

disconnect_all()

Disconnects from the observatory

generate_header_dict()

Generates the header information for the observatory as a dictionary

generate_header_info(filename[, frametyp, ...])

Generates the header information for the observatory

get_current_object()

Returns the current pointing of the telescope in ICRS

get_object_altaz([obj, ra, dec, unit, frame, t])

Returns the altitude and azimuth of the requested object at the requested time

get_object_slew([obj, ra, dec, unit, frame, t])

Determines the slew coordinates of the requested object at the requested time

lst([t])

Returns the local sidereal time

moon_altaz([t])

Returns the current altitude of the moon

moon_illumination([t])

Returns the current illumination of the moon

recenter([obj, ra, dec, unit, frame, ...])

Attempts to place the requested right ascension and declination at the requested pixel location on the detector.

run_autofocus([exposure, midpoint, nsteps, ...])

Runs the autofocus routine

safe_update_header(hdr, hdr_dict[, maxim, ...])

Safely updates the header information

safety_status()

Returns the status of the safety monitors

save_config(filename[, overwrite])

save_last_image(filename[, frametyp, ...])

Saves the current image

set_filter_offset_focuser([filter_index, ...])

shutdown()

Shuts down the observatory

slew_to_coordinates([obj, ra, dec, unit, ...])

Slews the telescope to a given ra and dec

start_derotation_thread([update_interval])

Begin a derotation thread for the current ra and dec

start_observing_conditions_thread([...])

Starts the observing conditions updating thread

start_safety_monitor_thread([on_fail, ...])

Starts the safety monitor updating thread

stop_derotation_thread()

Stops the derotation thread

stop_observing_conditions_thread()

Stops the observing conditions updating thread

stop_safety_monitor_thread()

Stops the safety monitor updating thread

sun_altaz([t])

Returns the altitude of the sun

switch_status()

Returns the status of the switches

take_darks(exposures, readouts, binnings[, ...])

Takes a sequence of dark frames

take_flats(filter_exposure[, ...])

Takes a sequence of flat frames

Attributes Documentation

autofocus#
autofocus_driver#
autofocus_info#
autofocus_kwargs#
camera#
camera_driver#
camera_info#
camera_kwargs#
cooler_setpoint#
cooler_tolerance#
cover_calibrator#
cover_calibrator_alt#
cover_calibrator_az#
cover_calibrator_driver#
cover_calibrator_info#
cover_calibrator_kwargs#
current_focus_offset#
diameter#
dome#
dome_driver#
dome_info#
dome_kwargs#
elevation#
filter_focus_offsets#
filter_wheel#
filter_wheel_driver#
filter_wheel_info#
filter_wheel_kwargs#
filters#
focal_length#
focuser#
focuser_driver#
focuser_info#
focuser_kwargs#
instrument_description#
instrument_name#
instrument_reconfiguration_times#
last_camera_shutter_status#
latitude#
longitude#
max_dimension#
maxim#
min_altitude#
observatory_info#
observatory_location#

Returns the EarthLocation object for the observatory

observatory_time#

Returns the current observatory time

observing_conditions#
observing_conditions_driver#
observing_conditions_info#
observing_conditions_kwargs#
pixel_scale#

Returns the pixel scale of the camera

plate_scale#

Returns the plate scale of the telescope in arcsec/mm

rotator#
rotator_driver#
rotator_info#
rotator_kwargs#
rotator_max_angle#
rotator_min_angle#
rotator_reverse#
safety_monitor#
safety_monitor_driver#
safety_monitor_info#
safety_monitor_kwargs#
settle_time#
site_name#
slew_rate#
switch#
switch_driver#
switch_info#
switch_kwargs#
telescope#
telescope_driver#
telescope_info#
telescope_kwargs#
threads_info#
wcs_driver#
wcs_info#
wcs_kwargs#

Methods Documentation

connect_all()[source]#
disconnect_all()[source]#

Disconnects from the observatory

generate_header_dict()[source]#

Generates the header information for the observatory as a dictionary

Returns:
dict

The header information

generate_header_info(filename, frametyp=None, custom_header=None, history=None, maxim=False, allowed_overwrite=[])[source]#

Generates the header information for the observatory

get_current_object()[source]#

Returns the current pointing of the telescope in ICRS

get_object_altaz(obj=None, ra=None, dec=None, unit=('hr', 'deg'), frame='icrs', t=None)[source]#

Returns the altitude and azimuth of the requested object at the requested time

get_object_slew(obj=None, ra=None, dec=None, unit=('hr', 'deg'), frame='icrs', t=None)[source]#

Determines the slew coordinates of the requested object at the requested time

lst(t=None)[source]#

Returns the local sidereal time

moon_altaz(t=None)[source]#

Returns the current altitude of the moon

moon_illumination(t=None)[source]#

Returns the current illumination of the moon

recenter(obj=None, ra=None, dec=None, unit=('hr', 'deg'), frame='icrs', target_x_pixel=None, target_y_pixel=None, initial_offset_dec=0, check_and_refine=True, max_attempts=5, tolerance=3, exposure=10, readout=0, save_images=False, save_path='./', sync_mount=False, settle_time=5, do_initial_slew=True)[source]#

Attempts to place the requested right ascension and declination at the requested pixel location on the detector.

Parameters:
objstr or SkyCoord, optional

The name of the target or a SkyCoord object of the target. If a string, a query will be made to the SIMBAD database to get the coordinates. If a SkyCoord object, the coordinates will be used directly. If None, the ra and dec parameters must be specified.

raLongitude-like, optional

The ICRS J2000 right ascension of the target that will initialize a SkyCoord object. This will override the ra value in the object parameter.

decLatitude-like, optional

The ICRS J2000 declination of the target that will initialize a SkyCoord object. This will override the dec value in the object parameter.

unittuple, optional

The units of the ra and dec parameters. Default is (‘hr’, ‘deg’).

framestr, optional

The coordinate frame of the ra and dec parameters. Default is ‘icrs’.

target_x_pixelfloat, optional

The desired x pixel location of the target.

target_y_pixelfloat, optional

The desired y pixel location of the target.

initial_offset_decfloat, optional

The initial offset of declination in arcseconds to use for the slew. Default is 0. Ignored if do_initial_slew is False.

check_and_refinebool, optional

Whether or not to check the offset and refine the slew. Default is True.

max_attemptsint, optional

The maximum number of attempts to make to center the target. Default is 5. Ignored if check_and_refine is False.

tolerancefloat, optional

The tolerance in pixels to consider the target centered. Default is 3. Ignored if check_and_refine is False.

exposurefloat, optional

The exposure time in seconds to use for the centering images. Default is 10.

readoutint, optional

The readout mode to use for the centering images. Default is 0.

save_imagesbool, optional

Whether or not to save the centering images. Default is False.

save_pathstr, optional

The path to save the centering images to. Default is the current directory. Ignored if save_images is False.

sync_mountbool, optional

Whether or not to sync the mount after the target is centered. Default is False. Note that if the target pixel location is not the center of the detector, the mount will be synced to this offset for all future slews.

settle_timefloat, optional

The time in seconds to wait after the slew before checking the offset. Default is 5.

do_initial_slewbool, optional

Whether or not to do the initial slew to the target. Default is True. If False, the current telescope position will be used as the starting point for the centering routine.

Returns:
successbool

True if the target was successfully centered, False otherwise.

run_autofocus(exposure=3, midpoint=0, nsteps=5, step_size=500, use_current_pointing=False)[source]#

Runs the autofocus routine

safe_update_header(hdr, hdr_dict, maxim=False, allowed_overwrite=[])[source]#

Safely updates the header information

safety_status()[source]#

Returns the status of the safety monitors

save_config(filename, overwrite=False)[source]#
save_last_image(filename, frametyp=None, do_wcs=False, do_fwhm=False, overwrite=False, custom_header=None, history=None, allowed_overwrite=[], **kwargs)[source]#

Saves the current image

set_filter_offset_focuser(filter_index=None, filter_name=None)[source]#
shutdown()[source]#

Shuts down the observatory

slew_to_coordinates(obj=None, ra=None, dec=None, unit=('hr', 'deg'), frame='icrs', control_dome=False, control_rotator=False, home_first=False, wait_for_slew=True, track=True)[source]#

Slews the telescope to a given ra and dec

start_derotation_thread(update_interval=0.1)[source]#

Begin a derotation thread for the current ra and dec

start_observing_conditions_thread(update_interval=60)[source]#

Starts the observing conditions updating thread

start_safety_monitor_thread(on_fail=None, update_interval=60)[source]#

Starts the safety monitor updating thread

stop_derotation_thread()[source]#

Stops the derotation thread

stop_observing_conditions_thread()[source]#

Stops the observing conditions updating thread

stop_safety_monitor_thread()[source]#

Stops the safety monitor updating thread

sun_altaz(t=None)[source]#

Returns the altitude of the sun

switch_status()[source]#

Returns the status of the switches

take_darks(exposures, readouts, binnings, repeat=10, save_path=None, new_folder=None)[source]#

Takes a sequence of dark frames

take_flats(filter_exposure, filter_brightness=None, readouts=None, binnings=['1x1'], repeat=10, save_path=None, new_folder=None, home_telescope=False, final_telescope_position='no change')[source]#

Takes a sequence of flat frames