Skip to content

Exposure Class

azcam.server.tools.exposure.Exposure

Bases: Tools, Filename, ObjectHeaderMethods

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.

abort()

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

begin(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, ...

check_comparison_imagetype(imagetype='')

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

check_image_ready()

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.

end()

Completes an exposure by writing file and displaying image.

expose(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.

expose1(exposure_time=-1, image_type='', image_title='')

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

finish()

Allow custom operations at end of exposure.

flush(Cycles=1)

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

get_exposuretime()

Return current exposure time in seconds.

get_exposuretime_remaining()

Return remaining exposure time (in seconds).

get_focalplane()

Returns the current focal plane configuration.

get_format()

Return the current detector format parameters.

get_image_title()

Get the current image title. Allows for AutoTitle.

get_image_type()

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

get_image_types()

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

get_pixels_remaining()

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

get_roi(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).

get_status()

Return a variety of system status data in one dictionary.

get_test_image()

Returns TestImage flag.

guide(number_exposures=1)

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

guide1(number_exposures=1)

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

initialize()

Initialize exposure.

integrate()

Integration.

parshift(number_rows)

Shift sensor by number_rows.

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

pause()

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

read_header_file(filename)

Read header template file.

readout()

Exposure readout.

record_current_times()

Record the current times and data info in the header.

reset()

Reset exposure tool.

resume()

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

roi_reset()

Resets detector ROI values to full frame, current binning.

sequence(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

sequence1(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

set_auto_title(flag=-1)

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

set_data_order(dataOrder)

Sets data order

set_detgap(det_gap)

Set the detector gaps in pixels.

set_detnum(det_number)

Set the detector numbers.

set_detpars(sensor_data)

Set detector parameters from sensor data dictionary.

set_detpos(det_position)

Set the detector positions.

set_exposuretime(exposure_time)

Set current exposure time in seconds.

set_extension_position(XY)

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

set_extname(ext_name)

Set image extension names.

set_extnum(ext_number)

Set image extension numbers.

set_focalplane(numdet_x=-1, numdet_y=-1, numamps_x=-1, numamps_y=-1, amp_cfg=[0])

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_cfg defines each amplifier's orientation (ex: [1,2,2,3]). 0 - normal 1 - flip x 2 - flip y 3 - flip x and y

set_format(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.

set_image_title(title='')

Set the image title. Allows for AutoTitle.

set_image_type(imagetype='zero')

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

set_jpg_order(Indices)

Set JPG image positions.

set_ref_pixel(XY)

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

set_roi(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.

set_shutter(state=0, shutter_id=0)

Open or close a shutter.

:param state: :param shutter_id: Shutter ID flag

  • 0 => controller default shutter.
  • 1 => instrument default shutter.

set_tdi_delay(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.

set_temp_files()

Update TempImageFile and TempDisplayFile file names based on CommandServer port.

set_test_image(flag)

Sets TestImage flag is True, clears if False.

start()

Allow custom operations at start of exposure.

start_readout()

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

test(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.

update_headers()

Update all headers, reading current data.