Module azcam.tools.instrument

Contains the base Instrument class.

Classes

class Instrument (tool_id='instrument', description=None)

The base instrument tool. Usually implemented as the "instrument" tool.

Args

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

Ancestors

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 comps_delay(self, delay_time=0)

Delays for delay_time for comparison lamp warmup. May internally set delay based on comp selection.

Args

delay_time
delay in seconds
def comps_off(self)

Turn off active comparisons.

def comps_on(self)

Turn on active comparisons.

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 exposure_finish(self)

Optional tempcon.call after exposure finishes.

def exposure_start(self)

Optional call before exposure starts.

def get_all_comps(self)

Return all valid comparison names. Useful for clients to determine which type of comparison exposures are supported.

def get_comps(self)

Return a list of the active comparison lamps.

def get_current(self, shutter_state: int = 1, current_id: int = 0) ‑> float

Read instrument current, usually from an electrometer.

Args

current_id
current source ID
shutter_state
shutter state during read

Returns

current
measured current in amps
def get_currents(self)

Return a list of all instrument currents.

def get_filter(self, filter_id=0)

Return the current/loaded filter, typically the filter in the beam.

Args

filter_id
filter mechanism ID
def get_filters(self, filter_id=0)

Return a list of all available/loaded filters.

Args

filter_id
filter mechanism ID
def get_focus(self, focus_id=0)

Return the current instrument focus position. focus_id is the focus mechanism ID.

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_power(self, wavelength: float, power_id: int = 0) ‑> float

Returns power meter reading.

Args

wavelength
wavelength for power meter
power_id
power ID flag

Returns

mean_power
mean power in Watts/cm2
def get_pressure(self, pressure_id=0)

Read an instrument pressure.

def get_pressures(self)

Return a list of all instrument pressures.

def get_wavelength(self, wavelength_id: int = 0)

Returns the current wavelength.

Args

wavelength_id
wavelength mechanism ID
def get_wavelengths(self, wavelength_id: int = 0)

Returns a list of valid wavelengths. Used for filter and LED based systems.

Args

wavelength_id
wavelength mechanism ID
def initialize(self) ‑> None

Inherited from: Tools.initialize

Initialize the tool.

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 reset(self) ‑> None

Inherited from: Tools.reset

Reset the tool.

def set_comps(self, comp_names: List[str] = None)

Set comparisons to be turned on and off with comps_on() and comps_off().

Args

comp_names
list of string (or a single string) of comparison names
def set_filter(self, filter_name, filter_id=0)

Set the current/loaded filter, typically the filter in the beam.

Args

filter_name
filter name to set. Could be a number or filter name.
filter_id
filter mechanism ID
def set_focus(self, focus_position, focus_id=0, focus_type='absolute')

Move (or step) the instrument focus. focus_position is the focus position or step size. focus_id is the focus mechanism ID. focus_type is "absolute" or "step".

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_pressure(self, pressure, pressure_id=0)

Sets an instrument pressure.

def set_shutter(self, state, shutter_id=0)

Open or close the instrument shutter. state is 1 for open and 0 for close. shutter_id is the shutter mechanism ID.

def set_wavelength(self, wavelength: Any, wavelength_id: int = 0)

Set the current wavelength, typically for a filter or grating.

Args

wavelength
wavelength value to set. Could be a number or filter name.
wavelength_id
wavelength mechanism ID
def update_header(self)

Inherited from: ObjectHeaderMethods.update_header

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