Module azcam.tools.instrument_console

Contains the base InstrumentConsole class.

Classes

class InstrumentConsole

Instrument tool for consoles. Usually implemented as the "instrument" 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 comps_off(self)

Turn off active comparisons.

def comps_on(self)

Turn on active comparisons.

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

Inherited from: ConsoleTools.delete_keyword

Delete a keyword from a header …

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, diode_id: int = 0) ‑> float

Returns measured instrument diode current.

Args

shutter_state
open (1), close (0), unchanged (2) shutter during diode read
diode_id
diode ID flag (system dependent)

Returns

current
measured curent in amps
def get_currents(self) ‑> List[float]

Return a list of all instrument currents.

def get_filter(self, filter_id: int = 0) ‑> str

Get instrument filter position.

:param filter_id: filter ID flag (use negative value for a list of all filters)

def get_filters(self, filter_id=0)

Return a list of all available/loaded filters.

def get_focus(self, focus_id: int = 0) ‑> float

Get the current focus position.

:param focus_id: focus sensor ID flag

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_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
measured mean power in Watts/cm2
def get_pressures(self) ‑> List[float]

Return a list of all instrument pressures.

def get_string(self) ‑> str

Inherited from: ConsoleTools.get_string

Returns the entire header as a formatted string …

def get_wavelength(self, wavelength_id: int = 0) ‑> float

Get instrument wavelength.

:param wavelength_id: wavelength ID flag (use negative value for a list of all wavelengths)

def initialize(self) ‑> None

Inherited from: ConsoleTools.initialize

Initialize this tool.

def read_header(self)

Inherited from: ConsoleTools.read_header

Returns the current header …

def reset(self) ‑> None

Inherited from: ConsoleTools.reset

Reset this tool.

def set_comps(self, comp_names=None)

Set comparisons which are to be turned on and off with comps_on() and comps_off(). comp_names is a single string or a list of strings to be set as active.

def set_filter(self, filter_name: str, filter_id: int = 0) ‑> Optional[str]

Set instrument filter position.

:param filter_name: filter value to set :param filter_id: filter ID flag

def set_focus(self, focus_value: float, focus_id: int = 0, focus_type: str = 'absolute') ‑> None

Set instrument focus position. The focus value may be an absolute position or a relative step if supported by hardware.

:param focus_value: focus position :param focus_id: focus sensor ID flag :param focus_type: focus type (absolute or step)

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_shutter(self, state: int = 0, shutter_id: int = 0) ‑> Optional[str]

Open or close a shutter.

Args

state
shutter state, 0 for close and 1 for open
shutter_id
Shutter ID flag
def set_wavelength(self, wavelength: float, wavelength_id: int = 0, nd: int = -1) ‑> Optional[str]

Set wavelength, optionally changing neutral density.

:param wavelength: wavelength value, may be a string such as 'clear' or 'dark' :param wavelength_id: wavelength ID flag :param nd: neutral density value to set

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.