Observatory#
- class pyscope.observatory.Observatory(config_path=None, **kwargs)[source]#
Bases:
objectAttributes Summary
Returns the EarthLocation object for the observatory
Returns the current observatory time
Returns the pixel scale of the camera
Returns the plate scale of the telescope in arcsec/mm
Methods Summary
Disconnects from the observatory
dither_mount([radius, center_pos, seed])Dithers the telescope randomly within a region of a given radius around a center position.
Generates the header information for the observatory as a dictionary
generate_header_info(filename[, frametyp, ...])Generates the header information for the observatory
Returns the current pointing of the telescope in ICRS
get_object_altaz([obj, ra, dec, unit, frame, t])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
repositioning([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
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
Starts the observing conditions updating thread
start_safety_monitor_thread([on_fail, ...])Starts the safety monitor updating thread
Stops the derotation thread
Stops the observing conditions updating thread
Stops the safety monitor updating thread
sun_altaz([t])Returns the altitude of the sun
Returns the status of the switches
take_darks([exposures, gain, readouts, ...])Takes a sequence of dark frames
take_flats(filters, filter_exposures[, ...])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_reconfig_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#
Methods Documentation
- dither_mount(radius=1, center_pos=None, seed=None)[source]#
Dithers the telescope randomly within a region of a given radius around a center position.
- Parameters:
- radius
float, optional (default = 1) The radius in arcseconds to dither the telescope.
- center_pos
SkyCoord, optional The center position to dither around. If None, the current pointing of the mount will be used.
- seed
int, optional The seed to use for the random number generator. If None, the seed will be randomly generated.
- radius
- Returns:
- None
- 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_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
- repositioning(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, binning=2, save_images=False, save_path='./', settle_time=5, do_initial_slew=True, solver='astrometry_net_wcs')[source]#
Attempts to place the requested right ascension and declination at the requested pixel location on the detector.
- Parameters:
- obj
strorSkyCoord, optional The name of the target or a
SkyCoordobject of the target. If a string, a query will be made to the SIMBAD database to get the coordinates. If aSkyCoordobject, the coordinates will be used directly. IfNone, the ra and dec parameters must be specified.- ra
Longitude-like, optional The ICRS J2000 right ascension of the target that will initialize a
SkyCoordobject. This will override the ra value in the object parameter.- dec
Latitude-like, optional The ICRS J2000 declination of the target that will initialize a
SkyCoordobject. This will override the dec value in the object parameter.- unit
tuple, optional The units of the ra and dec parameters. Default is (‘hr’, ‘deg’).
- frame
str, optional The coordinate frame of the ra and dec parameters. Default is ‘icrs’.
- target_x_pixel
float, optional The desired x pixel location of the target.
- target_y_pixel
float, optional The desired y pixel location of the target.
- initial_offset_dec
float, 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_refine
bool, optional Whether or not to check the offset and refine the slew. Default is True.
- max_attempts
int, optional The maximum number of attempts to make to center the target. Default is 5. Ignored if check_and_refine is False.
- tolerance
float, optional The tolerance in pixels to consider the target centered. Default is 3. Ignored if check_and_refine is
False.- exposure
float, optional The exposure time in seconds to use for the centering images. Default is 10.
- readout
int, optional The readout mode to use for the centering images. Default is 0.
- save_images
bool, optional Whether or not to save the centering images. Default is
False.- save_path
str, optional The path to save the centering images to. Default is the current directory. Ignored if save_images is
False.- settle_time
float, optional The time in seconds to wait after the slew before checking the offset. Default is 5.
- do_initial_slew
bool, optional Whether or not to do the initial slew to the target. Default is
True. IfFalse, the current telescope position will be used as the starting point for the centering routine.
- obj
- Returns:
- run_autofocus(exposure=3, midpoint=0, nsteps=5, step_size=500, use_current_pointing=False, save_images=False, save_path=None, binning=2)[source]#
Runs the autofocus routine
- safe_update_header(hdr, hdr_dict, maxim=False, allowed_overwrite=[])[source]#
Safely updates the header information
- save_last_image(filename, frametyp=None, overwrite=False, custom_header=None, history=None, allowed_overwrite=[])[source]#
Saves the current image
- 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
- take_darks(exposures=[1], gain=None, readouts=[None], binnings=[None], repeat=1, save_path='./', frametyp='Dark')[source]#
Takes a sequence of dark frames
- take_flats(filters, filter_exposures, filter_brightness=None, target_counts=None, gain=None, readouts=[None], binnings=[None], repeat=1, save_path='./', home_telescope=False, check_cooler=True, tracking=True, dither_radius=0, final_telescope_position='no change')[source]#
Takes a sequence of flat frames