drs4.ctrl.self module#

drs4.ctrl.self.run(*commands: str, chassis: Literal[1, 2], ctrl_addr: str | None = None, ctrl_user: str | None = None, timeout: float | None = None, workdir: PathLike[str] | str = PATH_CMD_DIR) CompletedProcess[str][source]#
drs4.ctrl.self.run(*commands: str, chassis: None = None, ctrl_addr: str | None = None, ctrl_user: str | None = None, timeout: float | None = None, workdir: PathLike[str] | str = PATH_CMD_DIR) tuple[CompletedProcess[str], CompletedProcess[str]]

Run commands in DRS4.

Parameters:
  • commands – Strings of the commands.

  • chassis – Chassis number of DRS4 (1|2). If not specified, the commands will be run in both chasses.

  • ctrl_addr – IP address of DRS4. If not specified, environment variable DRS4_CHASSIS[1|2]_CTRL_ADDR will be used.

  • ctrl_user – User name of DRS4. If not specified, environment variable DRS4_CHASSIS[1|2]_CTRL_USER will be used.

  • timeout – Timeout of the connection and the running in seconds.

  • workdir – Working directory where commands will be run.

Returns:

Completed process object(s) of the run(s).

Examples

To set the spectral integration time of DRS4 chassis 1:

run("./set_intg_time.py --In 1 --It 1", chassis=1)

To set the spectral integration time of DRS4 chassis 1 and 2:

run("./set_intg_time.py --In 1 --It 1")
drs4.ctrl.self.send(file: PathLike[str] | str, to: PathLike[str] | str, /, *, chassis: Literal[1, 2], ctrl_addr: str | None = None, ctrl_user: str | None = None, timeout: float | None = None) CompletedProcess[str][source]#
drs4.ctrl.self.send(file: PathLike[str] | str, to: PathLike[str] | str, /, *, chassis: None = None, ctrl_addr: str | None = None, ctrl_user: str | None = None, timeout: float | None = None) tuple[CompletedProcess[str], CompletedProcess[str]]

Send a file to DRS4.

Parameters:
  • file – Path of the file to be sent.

  • to – Path of the destination in DRS4.

  • chassis – Chassis number of DRS4 (1|2). If not specified, the file will be sent to both chasses.

  • ctrl_addr – IP address of DRS4. If not specified, environment variable DRS4_CHASSIS[1|2]_CTRL_ADDR will be used.

  • ctrl_user – User name of DRS4. If not specified, environment variable DRS4_CHASSIS[1|2]_CTRL_USER will be used.

  • timeout – Timeout of the connection and the sending in seconds.

Returns:

Completed process object(s) of the sending(s).