HAL Reference#
Actor#
- class hal.actor.actor.ActorHelpers(actor)[source]#
Bases:
objectState helpers.
- Parameters
actor (HALActor) –
- class hal.actor.actor.HALActor(*args, **kwargs)[source]#
Bases:
clu.legacy.actor.LegacyActorHAL actor.
Macros#
- class hal.macros.macro.Macro(name=None)[source]#
Bases:
objectA base macro class that offers concurrency and cancellation.
- Parameters
name (str) –
- output_stage_status(command=None, level='d')[source]#
Outputs the stage status to the actor.
- Parameters
command (Optional[HALCommandType]) –
level (str) –
- reset(command, reset_stages=None, force=False, **opts)[source]#
Resets stage status.
reset_stagesis a list of stages to be executed when callingrun. Ifreset_stagesis a list of string andforce=False, the reset stages are rearranged according to the original__STAGES__order, including concurrent stages. If the list ofreset_stagesincludes tuples representing stages that must be run concurrently, orforce=True, then the stages are run as input.optsparameters will be used to override the macro configuration options only until the next reset.
- async send_command(target, command_string, raise_on_fail=True, **kwargs)[source]#
Sends a command to an actor. Raises
MacroErrorif it fails.
- property actor#
Returns the command actor.
- property helpers#
Returns the actor helpers.
- property running#
Is the macro running?
- class hal.macros.apogee_dome_flat.APOGEEDomeFlatMacro(name=None)[source]#
Bases:
hal.macros.macro.MacroTake an APOGEE dome flat after an exposure.
- Parameters
name (Optional[str]) –
- class hal.macros.expose.ExposeMacro(name=None)[source]#
Bases:
hal.macros.macro.MacroTakes a science exposure with APOGEE and/or BOSS.
- Parameters
name (str) –
- class hal.macros.goto_field.GotoFieldMacro(name=None)[source]#
Bases:
hal.macros.macro.MacroGo to field macro.
- Parameters
name (Optional[str]) –
Helpers#
- class hal.helpers.apogee.APOGEEHelper(actor)[source]#
Bases:
hal.helpers.HALHelperAPOGEE instrument helper.
- Parameters
actor (HALActor) –
- async expose(command, exp_time, exp_type='dark', dither_position=None)[source]#
Exposes APOGEE.
- Parameters
- async expose_dither_pair(command, exp_time, dither_sequence=None, exp_type='object')[source]#
Takes an APOGEE dither set.
- Parameters
command (HALCommandType) – The command used to interact with the APOGEE actor.
exp_time (float) – The exposure time for each exposure in the dither sequence.
exp_type (str) – The exposure type. Valid values are
object,dark, andflat.dither_sequence (str | None) – The dither sequence. If
Nonethe first dither will be taken at the current position and the mechanism will be switched after it. Alternatively, a string"AB","BA", etc.
- get_dither_position()[source]#
Returns the dither position or
Noneif unknown.- Return type
str | None
- async set_dither_position(command, position, force=False)[source]#
Sets the dither mechanism to the commanded position.
- Parameters
command (clu.command.Command) –
position (str) –
force (bool) –
- async shutter(command, open=True, shutter='apogee', force=False)[source]#
Opens/closes the shutter.
- Parameters
command (clu.command.Command) – The command instance to use to command the shutter.
open (bool) – If
True, opens the shutter, otherwise closes it.shutter (str) – The shutter to query. Can be
apogee,calbox, orfpi.force (bool) – If
True, sends the command to the shutter even if it reports to already be in that position.
- Returns
shutter_command – The command sent to the shutter after been awaited for completion or
Noneif the shutter is already at that position.
- class hal.helpers.boss.BOSSHelper(actor)[source]#
Bases:
hal.helpers.HALHelperControl for BOSS spectrograph.
- Parameters
actor (HALActor) –
- async expose(command, exp_time=0.0, exp_type='science', readout=True, read_async=False)[source]#
Exposes BOSS. If
readout=False, does not read the exposure.- Parameters
command (clu.command.Command) –
exp_time (float) –
exp_type (str) –
readout (bool) –
read_async (bool) –
- async readout(command)[source]#
Reads a pending readout.
- Parameters
command (clu.command.Command) –
- property readout_pending#
True if an exposure readout is pending.
- class hal.helpers.ffs.FFSHelper(actor)[source]#
Bases:
hal.helpers.HALHelperCommand and keeps track of the Flat-Field Screens status.
- Parameters
actor (HALActor) –
- async close(command)[source]#
Close all the petals.
- Parameters
command (clu.command.Command) –
- async open(command)[source]#
Open all the petals.
- Parameters
command (clu.command.Command) –
- class hal.helpers.lamps.LampsHelper(actor)[source]#
Bases:
hal.helpers.HALHelperControl for lamps.
- Parameters
actor (HALActor) –
- async all_off(command, force=False)[source]#
Turn off all the lamps.
- Parameters
command (clu.command.Command) –
force (bool) –
- list_status()[source]#
Returns a dictionary with the state of the lamps.
For each lamp the first value in the returned tuple is whether the lamp has been commanded on. The second value is whether the lamps is actually on. The third value is how long since it changed states. The final value indicates whether the lamp has warmed up.
- class hal.helpers.tcc.TCCHelper(actor)[source]#
Bases:
hal.helpers.HALHelperHelper for the TCC.
- Parameters
actor (HALActor) –
- axes_are_clear(axes=('az', 'alt', 'rot'))[source]#
Checks that no bits are set in any axis status field.
- Return type
- async axis_init(command)[source]#
Executes TCC axis init or fails.
- Parameters
command (clu.command.Command) –
- Return type
- async axis_stop(command, axis='')[source]#
Issues an axis stop to the TCC.
- Parameters
command (clu.command.Command) –
axis (str) –
- Return type
- below_alt_limit()[source]#
Check if we are below the alt=18 limit that prevents init/motion in az.
- Return type
- check_stop_in(axes=('az', 'alt', 'rot'))[source]#
Returns
Trueif any stop bit is set in the<axis>StatTCC keywords.The [az,alt,rot]Stat[3] bits show the exact status: http://www.apo.nmsu.edu/Telescopes/HardwareControllers/AxisControllers.html#25mStatusBits
- Return type
- async do_slew(command, coords=None, track_command=None, keep_offsets=False, offset=False, rotwrap=None)[source]#
Correctly handle a slew command, given what parse_args had received.
- Parameters
command – The actor command used to send child commands to the TCC.
coords (dict[str, float] | None) – The coordinates where to slew. It must be a dictionary with keys
ra, dec, rotoralt, az, rot.track_command (str | None) – A raw TCC
trackcommand (without thetcctarget) to send. In this case other arguments likekeep_offsetsorrotwrapare ignored.keep_offsets (bool) – Whether to keep the existing offsets.
rotwrap (str | None) – The type of
/RotWrapto use.offset (bool) – If defined, the coordinates will be treated as an offset and not absolute positions.
- Return type
- get_bad_axis_bits(axes=('az', 'alt', 'rot'), mask=None)[source]#
Return the bad status bits for the requested axes.
- async mcp_semaphore_ok(command)[source]#
Returns the semaphore if the semaphore is owned by the TCC or nobody.
- Parameters
command (clu.command.Command) –
- class hal.helpers.scripts.Scripts(actor: 'HALActor', path: 'pathlib.Path')[source]#
Bases:
object- Parameters
actor (HALActor) –
path (pathlib.Path) –
- Return type
None