Module azcam.tools.exposure

Contains the base Exposure class.

Classes

class Exposure (tool_id='exposure', description=None)

The base exposure tool. Usually implemented as the "exposure" tool. Only required attributes and stub methods are defined here. Additional methods and attributes are added as needed in exposure-specific classes which should inherit this class.

Args

tool_id
name used to reference the tool (controller, display, …)
description
description of this tool

Ancestors

Subclasses

Instance variables

var description

Inherited from: Tools.description

descriptive tool name

var enabled

Inherited from: Tools.enabled

1 when tool is enabled

var initialized

Inherited from: Tools.initialized

1 when tool has been initialized

var is_reset

Inherited from: Tools.is_reset

1 when tool has been reset

var tool_id

Inherited from: Tools.tool_id

name used to reference the tool ("controller", "display", …)

var verbosity

Inherited from: Tools.verbosity

verbosity for debug, >0 is more verbose

Methods

def abort(self)

Abort an exposure in progress. Really sets a flag which is read in expose().

def begin(self, exposure_time=-1, imagetype='', title='')

Initiates the first part of an exposure, through image flushing. exposure_time is in seconds. imagetype is one of zero, object, flat, dark, ramp, …

def check_comparison_imagetype(self, imagetype='')

Returns 1 if imagetype is a comparision, 0 if not. If imagetype is not specified, checks the current type.

def check_image_ready(self)

Returns True (1) if exposure image is ready and then toggles the flag off so that image is not detected multiple times. Used only for clients which need to know when an image is ready. An image is ready when written to disk if SaveFile is true, or when valid if SaveFile is false.

def define_keywords(self)

Inherited from: ObjectHeaderMethods.define_keywords

Defines and resets keywords.

def delete_keyword(self, keyword: str)

Inherited from: ObjectHeaderMethods.delete_keyword

Delete a keyword.

Args

keyword
keyword
def end(self)

Completes an exposure by writing file and displaying image.

def expose(self, exposure_time=-1, imagetype='', title='')

Make a complete exposure. exposure_time is the exposure time in seconds imagetype is the type of exposure ('zero', 'object', 'flat', …) title is the image title.

def expose1(self, exposure_time: float = -1, image_type: str = '', image_title: 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 finish(self)

Allow custom operations at end of exposure.

def finished(self)
def flush(self, Cycles=1)

Flush/clear detector. Cycles is the number of times to flush the detector.

def get_exposureflag(self)
def get_exposuretime(self)

Return current exposure time in seconds.

def get_exposuretime_remaining(self)

Return remaining exposure time (in seconds).

def get_extname(self, filetype)

Inherited from: Filename.get_extname

Return the file extension string for a file type.

def get_filename(self)

Inherited from: Filename.get_filename

Return current filename as a single string. This is the filename for the next exposure to be taken …

def get_focalplane(self)

Returns the current focal plane configuration.

def get_format(self)

Return the current detector format parameters.

def get_image_title(self)

Get the current image title. Allows for AutoTitle.

def get_image_type(self)

Get current image type for an exposure. imagetype is system defines, and typically includes: zero, object, dark, flat.

def get_image_types(self)

Return a list of valid imagetypes. Gets imagetypes and comparisons.

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

Inherited from: ObjectHeaderMethods.get_keyword

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

Args

keyword
name of keyword

def get_keywords(self) ‑> list

Inherited from: ObjectHeaderMethods.get_keywords

Return a list of all keyword names.

Returns

keywords
list of all keywords
def get_pixels_remaining(self)

Return number of remaining pixels to be read (counts down).

def get_roi(self, roi_num=0)

Returns a list of the ROI parameters for the roi_num specified. Currently only one ROI (0) is supported. Returned list format is (first_col,last_col,first_row,last_row,col_bin,row_bin).

def get_status(self)

Return a variety of system status data in one dictionary.

def get_test_image(self)

Returns TestImage flag.

def guide(self, number_exposures=1)

Make a complete guider exposure sequence. NumberExposures is the number of exposures to make, -1 loop forever

def guide1(self, number_exposures=1)

Make a complete guider exposure with an immediate return. NumberExposures is the number of exposures to make, -1 loop forever

def increment_filenumber(self)

Inherited from: Filename.increment_filenumber

Increment the filename sequence number if AutoIncrementSequenceNumber is True and not a test image.

def initialize(self)

Initialize exposure.

def integrate(self)

Integration.

def parshift(self, number_rows: int)

Shift sensor by number_rows.

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

def pause(self)

Pause an exposure in progress (integration only). Really sets a flag which is read in expose().

def read_header(self) ‑> list

Inherited from: ObjectHeaderMethods.read_header

Reads and returns current header data.

Returns

list of header lines
[Header[]]: Each element Header[i] contains the sublist (keyword, value, …
def read_header_file(self, filename)

Read header template file.

def readout(self)

Exposure readout.

def record_current_times(self)

Record the current times and data info in the header.

def reset(self)

Reset exposure tool.

def resume(self)

Resume a paused exposure. Really sets a flag which is read in expose().

def roi_reset(self)

Resets detector ROI values to full frame, current binning.

def sequence(self, number_exposures=1, flush_array_flag=-1, delay=-1)

Take an exposure sequence. Uses pre-set exposure time, image type and image title. NumberExposures is the number of exposures to make. FlushArrayFlag defines 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 Delay => delay between exposures in seconds -1 => no change

def sequence1(self, number_exposures=1, flush_array_flag=-1, delay=-1)

Take an exposure sequence. Uses pre-set image type and image title. number_exposures is the number of exposures to make. flush_array_flag defines 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 Delay => delay between exposures in seconds -1 => no change

def set_auto_title(self, flag=-1)

Set the AutoTitle flag so that image title matches lowercase imagetype.

def set_data_order(self, dataOrder)

Sets data order

def set_detgap(self, det_gap)

Set the detector gaps in pixels.

def set_detnum(self, det_number)

Set the detector numbers.

def set_detpars(self, sensor_data)

Set detector parameters from sensor data dictionary.

def set_detpos(self, det_position)

Set the detector positions.

def set_exposuretime(self, exposure_time)

Set current exposure time in seconds.

def set_extension_position(self, XY)

Set the extension position of each amplifier. XY is [[X,Y]] in index numbers, starting at [1,1].

def set_extname(self, ext_name)

Set image extension names.

def set_extnum(self, ext_number)

Set image extension numbers.

def set_filename(self, filename: str)

Inherited from: Filename.set_filename

Set the filename components based on a simple filename …

def set_focalplane(self, numdet_x=-1, numdet_y=-1, numamps_x=-1, numamps_y=-1, amp_config='')

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=-1, ns_predark=-1, ns_underscan=-1, ns_overscan=-1, np_total=-1, np_predark=-1, np_underscan=-1, np_overscan=-1, np_frametransfer=-1)

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_title(self, title='')

Set the image title. Allows for AutoTitle.

def set_image_type(self, imagetype='zero')

Set image type for an exposure. imagetype is system defines, and typically includes: zero, object, dark, flat.

def set_jpg_order(self, Indices)

Set JPG image positions.

def set_keyword(self, keyword: str, value: Any, comment: str = 'none', typestring: str = 'none')

Inherited from: ObjectHeaderMethods.set_keyword

Set a keyword value, comment, and type.

Args

keyword
keyword
value
value of keyword
comment
comment string
typestring
one of …
def set_ref_pixel(self, XY)

Set the reference pixel. XY is [X,Y] in pixels.

def set_roi(self, first_col=-1, last_col=-1, first_row=-1, last_row=-1, col_bin=-1, row_bin=-1, roi_num=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)

Open or close a shutter.

:param state: :param shutter_id: Shutter ID flag

  • 0 => controller default shutter.
  • 1 => instrument default shutter.
def set_tdi_delay(self, flag)

Set TDI line delay On or Off. flag==True sets delay to self.tdi_delay. flag==Flase sets line delay to normal value, self.par_delay.

def set_temp_files(self)

Update TempImageFile and TempDisplayFile file names based on CommandServer port.

def set_test_image(self, flag)

Sets TestImage flag is True, clears if False.

def start(self)

Allow custom operations at start of exposure.

def start_readout(self)

Start immediate readout of an exposing image. Returns immediately, not waiting for readout to finish. Really sets a flag which is read in expose().

def test(self, exposure_time=0.0, shutter=0)

Make a test exposure. exposure_time is the exposure time in seconds shutter is 0 for closed and 1 for open title is the image title.

def update_header(self)

Inherited from: ObjectHeaderMethods.update_header

Update the header, reading current data. Deletes all keywords if the object is not enabled.

def update_headers(self)

Update all headers, reading current data.