Module azcam.tools.exposure_console

Contains the base ExposureConsole class.

Classes

class ExposureConsole

Exposure tool for consoles. Usually implemented as the "exposure" tool.

Args

name : str
name of this tool.

Ancestors

Instance variables

var verbosity

Inherited from: ConsoleTools.verbosity

verbosity for debug, > 0 is more verbose

Methods

def abort(self) ‑> None

Sets the global exposure abort flag and tries to abort a remote server exposure.

def begin(self, exposure_time: float = -1, image_type: str = '', image_title: str = '') ‑> Optional[str]

Initiates the first part of an exposure, through image flushing. This is an advanced function.

:param exposure_time: the exposure time in seconds :param image_type: type of exposure ('zero', 'object', 'flat', …) :param image_title: image title, usually surrounded by double quotes

def delete_keyword(self, keyword: str) ‑> Optional[str]

Inherited from: ConsoleTools.delete_keyword

Delete a keyword from a header …

def end(self) ‑> None

Completes an exposure by writing file and displaying image. This is an advanced function.

def expose(self, exposure_time: float = -1, image_type: str = '', image_title: str = '') ‑> Optional[str]

Make a complete exposure. If arguments are not specified, then previous exposure_time and imagetype values are used.

:param exposure_time: the exposure time in seconds :param image_type: type of exposure ('zero', 'object', 'flat', …) :param image_title: image title, usually surrounded by double quotes

def expose1(self, exposure_time: float = -1, image_type: str = '', image_title: str = '') ‑> Optional[str]

Make a complete exposure with immediate return to caller.

:param exposure_time: the exposure time in seconds :param image_type: type of exposure ('zero', 'object', 'flat', …) :param image_title: image title, usually surrounded by double quotes

def flush(self, cycles: int = 1) ‑> Optional[str]

Flush/clear detector.

:param cycles: number of times to flush the detector.

def get_exposureflag(self)
def get_exposuretime(self) ‑> Union[str, float]

Return current exposure time in seconds.

def get_exposuretime_remaining(self) ‑> Union[str, float]

Return current exposure time in seconds.

def get_filename(self) ‑> str

Return the current exposure image filename. :returns: imaeg filename

def get_focalplane(self) ‑> List

Returns the current focal plane configuration.

def get_format(self) ‑> List

Return the current detector format parameters.

def get_image_title(self) ‑> str

Get the current image title.

def get_image_types(self) ‑> List[str]

Return a list of valid image types.

def get_keyword(self, keyword: str) ‑> str

Inherited from: ConsoleTools.get_keyword

Return a keyword value, its comment string, and type. Comment always returned in double quotes, even if empty …

def get_keywords(self) ‑> list

Inherited from: ConsoleTools.get_keywords

Return a list of all keyword names …

def get_pixels_remaining(self) ‑> Union[str, int]

Return current number of pixels remaing in readout.

def get_roi(self) ‑> List

Return detector ROI.

def get_status(self)

Return JSON dictionary of a variety of system status data in one dictionary.

def get_string(self) ‑> str

Inherited from: ConsoleTools.get_string

Returns the entire header as a formatted string …

def guide(self, number_exposures: int = 1) ‑> Optional[str]

Make a complete guider exposure sequence.

:param number_exposures: number of exposures to make, -1 loop forever

def guide1(self, number_exposures: int = 1) ‑> Optional[str]

guide() with immediate return.

:param number_exposures: number of exposures to make, -1 loop forever

def initialize(self) ‑> None

Initialize exposure. Usually implemented as the "exposure" tool.

def integrate(self) ‑> None

Integrate exposure. This is an advanced function.

def parshift(self, number_rows: int) ‑> Optional[str]

Shift detector by number_rows.

:param number_rows: number of rows to shift (positive is toward readout, negative is away)

def pause_exposure(self) ‑> Optional[str]

Pause an exposure in progress (integration only).

def read_header(self)

Inherited from: ConsoleTools.read_header

Returns the current header …

def readout(self) ‑> None

Readout the exposure. This is an advanced function.

def reset(self) ‑> None

Reset exposure.

def resume_exposure(self) ‑> Optional[str]

Resume a paused exposure.

def roi_reset(self) ‑> Optional[str]

Resets detector ROI values to full frame, current binning.

def sequence(self, number_exposures: int = 1, flush_array: int = -1, delay=-1) ‑> Optional[str]

Take an exposure sequence.

:param number_exposures: number of exposures to make :param flush_array: flag defining detector flushing

  • -1 => current value defined by exposure.exposure_sequence_flush [default]
  • 0 => flush for each exposure
  • 1 => flush after first exposure only
  • 2 => no flush

:param delay: delay between exposures in seconds (-1 => no change)

def sequence1(self, number_exposures: int = 1, flush_array: int = -1, delay=-1) ‑> Optional[str]

Take an exposure sequence with immediate return.

:param number_exposures: number of exposures to make. :param flush_array: flag defining detector flushing

  • -1 => current value defined by exposure.exposure_sequence_flush [default]
  • 0 => flush for each exposure
  • 1 => flush after first exposure only
  • 2 => no flush

:param delay: delay between exposures in seconds (-1 => no change)

def set_exposuretime(self, exposure_time: float) ‑> Optional[str]

Set current exposure time in seconds.

:param exposure_time: exposure time in seconds.

def set_focalplane(self, numdet_x: int = -1, numdet_y: int = -1, numamps_x: int = -1, numamps_y: int = -1, amp_config: str = '') ‑> None

Sets focal plane configuration for subsequent exposures. Use after set_format(). Must call set_roi() after using this command and before starting exposure. This command replaces SetConfiguration. Default focalplane values are set here. numdet_x defines number of detectors in Column direction. numdet_y defines number of detectors in Row direction. numamps_x defines number of amplifiers in Column direction. numamps_y defines number of amplifiers in Row direction. amp_config defines each amplifier's orientation (ex: '1223'). 0 - normal 1 - flip x 2 - flip y 3 - flip x and y

def set_format(self, ns_total: int = -1, ns_predark: int = -1, ns_underscan: int = -1, ns_overscan: int = -1, np_total: int = -1, np_predark: int = -1, np_underscan: int = -1, np_overscan: int = -1, np_frametransfer: int = -1) ‑> None

Set the detector format for subsequent exposures. Must call set_roi() after using this command and before starting exposure. ns_total is the number of visible columns. ns_predark is the number of physical dark underscan columns. ns_underscan is the desired number of desired dark underscan columns. ns_overscan is the number of dark overscan columns. np_total is the number of visible rows. np_predark is the number of physical dark underscan rows. np_underscan is the number of desired dark underscan rows. np_overscan is the number of desired dark overscan rows. np_frametransfer is the rows to frame transfer shift.

def set_image_filename(self, filename: str) ‑> Optional[str]

Set the filename of the exposure image. Always use forward slashes. Not fully functional.

:param filename: image filename

def set_image_title(self, title: str) ‑> Optional[str]

Set the image title.

def set_keyword(self, keyword: str, value: str, comment: str = 'none', typestring: str = 'none') ‑> Optional[str]

Inherited from: ConsoleTools.set_keyword

Set a keyword value, comment, and type.

Args

keyword
keyword
value
value of keyword
comment
comment string
typestring
one of …
def set_roi(self, first_col: int = -1, last_col: int = -1, first_row: int = -1, last_row: int = -1, col_bin: int = -1, row_bin: int = -1, roi_number: int = 0)

Sets the ROI values for subsequent exposures. Currently only one ROI (0) is supported. These values are for the entire focal plane, not just one detector.

def set_shutter(self, state: int = 0, shutter_id: int = 0) ‑> Optional[str]

Open or close a shutter.

:param state: :param shutter_id: Shutter ID flag

  • 0 => controller shutter.
  • 1 => instrument shutter.
def start_readout(self)

Start immediate readout of an exposing image. Returns immediately, not waiting for readout to finish.

def test(self, exposure_time: float = -1, shutter_state: int = 0) ‑> Optional[str]
def tests(self, number_exposures: int = 1, exposure_time: float = 1.0, image_type: str = 'zero') ‑> Optional[str]

Make test exposures, which overwrite previous test images.

:param number_exposures: number of exposures to take :param exposure_time: exposure time in seconds :param image_type: image type

def update_header(self)

Inherited from: ConsoleTools.update_header

Update the header of a tool. This command usually reads hardware to get the lastest keyword values.