ScriptQueue Related#
Follow the script queue commands at the summit to gather the data.
- rubin_nights.scriptqueue.get_all_tracebacks(t_start, t_end, efd_client)[source]#
Find tracebacks all logevent_logMessages.
This finds all tracebacks, for all CSCs and thus both telescopes.
- Parameters:
t_start (
Time) – The time to start searching for script events.t_end (
Time) – The time at which to end searching for script events.efd_client (
InfluxQueryClient) – EfdClient to query the efd.
- Returns:
tracebacks – DataFrame containing tracebacks.
- Return type:
pd.DataFrame
- rubin_nights.scriptqueue.get_consolidated_messages(t_start, t_end, endpoints, fetch_errors=True, all_tracebacks=False)[source]#
Get consolidated messages from EFD ScriptQueue, errorCodes, CCCamera, exposure and narrative logs.
- Parameters:
t_start (
Time) – Time of the start of the messages.t_end (
Time) – Time of the end of the messages.endpoints (
dict) – Endpoints is a dictionary of client connections to the EFD and the ConsDb, such as returned byrubin_nights.connections.get_clients. Must have clients for theefd,obsenv,narrative_logandexposure_log.fetch_errors (
bool, default:True) – Fetch error messages from all available CSCs.all_tracebacks (
bool, default:False) – Flag as to whether to query for all tracebacks from systems other than lsst.sal.Script.logevent_logMessages (which is always included).
- Return type:
tuple[DataFrame,list[str]]- Returns:
efd_and_messages (
pd.DataFrame) – A Dataframe of relevant logging and EFD messages.cols (
list[str]) – The short-list of columns for display in the table.
- rubin_nights.scriptqueue.get_error_codes(t_start, t_end, efd_client)[source]#
Get all messages from logevent_errorCode topics.
- Parameters:
t_start (
Time) – The time to start searching for script events.t_end (
Time) – The time at which to end searching for script events.efd_client (
InfluxQueryClient) – EfdClient to query the efd.
- Returns:
error_messages
- Return type:
pd.DataFrame
- rubin_nights.scriptqueue.get_exposure_info(t_start, t_end, efd_client, exposure_log_client)[source]#
Get exposure information from lsst.sal.CCCamera.logevent_endOfImageTelemetry and join it with exposure log information.
- Parameters:
t_start (
Time) – The time to start searching for script events.t_end (
Time) – The time at which to end searching for script events.efd_client (
InfluxQueryClient) – EfdClient to query the efd.exposure_log_client (
ExposureLogClient) – ExposureLogClient to query for exposure logs.
- Returns:
narrative_and_errors
- Return type:
pd.DataFrame
- rubin_nights.scriptqueue.get_narrative_and_errors(t_start, t_end, efd_client, narrative_log_client, fetch_errors=True, all_tracebacks=True)[source]#
Get narrative log and error code messages.
- Parameters:
t_start (
Time) – The time to start searching for script events.t_end (
Time) – The time at which to end searching for script events.efd_client (
InfluxQueryClient) – EfdClient to query the efd.narrative_log_client (
NarrativeLogClient) – Narrative log query client.fetch_errors (
bool, default:True) – Fetch error messages and codes from CSCs with an error code topic.all_tracebacks (
bool, default:True) – Flag as to whether to query for all tracebacks from systems other than lsst.sal.Script.logevent_logMessages (included previously with scriptqueue outputs).
- Returns:
narrative_and_errors
- Return type:
pd.DataFrame
- rubin_nights.scriptqueue.get_scheduler_configs(t_start, t_end, efd_client, obsenv_client, queue_index=None)[source]#
Return information needed to recreate FBS configuration.
This requires checking the EFD (
lsst.sal.Scheduler.logevent_dependenciesVersions) to find the version of rubin_scheduler and dependencies, and the EFD (lsst.sal.Scheduler.logevent_configurationApplied) to find the specific FBS configuration file in use.Searches both the time within t_start to t_end, as well as the last configuration applied before this time period.
Defining queue_index will search dependencies and configurations for that queue only.
- Parameters:
t_start (
Time) – The time of the start of the period.t_end (
Time) – The time at the end of the period.efd_client (
InfluxQueryClient) – An EFD client pointed to the standard EFD database.obsenv_client (
InfluxQueryClient) – A sync EFD client pointed to the obsenv database.queue_index (
int|list[int] |None, default:None) – The salIndex of a specific queue (1=Simonyi, 2=Auxtel, 3=OCS). If None, queries Simonyi and Auxtel to ensure we get these configs.
- Returns:
sched_config – A dataframe carrying the configuration information. Some columns are compacted into single strings, so the entire dataframe can fit into a limited set of columns.
- Return type:
pd.DataFrame
- rubin_nights.scriptqueue.get_script_state(t_start, t_end, queue_index, efd_client)[source]#
Get script status from lsst.sal.ScriptQueue.logevent_script topic.
- Parameters:
t_start (
Time) – The time to start searching for script events.t_end (
Time) – The time at which to end searching for script events.queue_index (
int|None) – The SalIndex (1/2/3 or None for all queues) to check for script state.efd_client (
InfluxQueryClient) – Sync EfdClient to query the efd.
- Returns:
script_state – DataFrame containing timing information and states.
- Return type:
pd.DataFrame
Note
The scriptqueue is explicit here, in the salIndex. From here, these can be tied to the running of individual scripts, within a single restart of the scriptqueue only.
- rubin_nights.scriptqueue.get_script_status(t_start, t_end, efd_client)[source]#
Given a start and end time, appropriately query each ScriptQueue to find script descriptions, configurations and status.
This is an appropriate function to call if you just want to retrieve a description of the ongoing telescope commands, without additional logs or configuration information.
- Parameters:
t_start (
Time) – The time to start searching for script events.t_end (
Time) – The time at which to end searching for script events.efd_client (
InfluxQueryClient) – EfdClient to query the efd.
- Returns:
script_status – DataFrame containing script description, configuration, timing information and states.
- Return type:
pd.DataFrame
Note
The (timestamp) index of the returned dataframe is chosen from the timestamps recorded for the script. In order to best place the script message inline with other events such as acquired images, the time used is the
timestampRunStartif available,timestampConfigureEndnext, and then falls back totimestampConfigureStartortimestampProcessStartif those are also not available.
- rubin_nights.scriptqueue.get_script_stream(t_start, t_end, efd_client)[source]#
Get script description and configuration from lsst.sal.Script.logevent_description and lsst.sal.Script.command_configure topics.
- Parameters:
t_start (
Time) – The time to start searching for script events.t_end (
Time) – The time at which to end searching for script events.efd_client (
InfluxQueryClient) – Sunc EfdClient to query the efd.
- Returns:
script_stream – DataFrame containing script description and configuration.
- Return type:
pd.DataFrame
Note
Note that these do not explicitly carry the scriptqueue salindex information. The “salIndex” in these topics is the script_salIndex.
- rubin_nights.scriptqueue.get_scriptqueue_tracebacks(t_start, t_end, efd_client)[source]#
Find tracebacks in lsst.sal.Script.logevent_logMessage.
- Parameters:
t_start (
Time) – The time to start searching for script events.t_end (
Time) – The time at which to end searching for script events.efd_client (
InfluxQueryClient) – EfdClient to query the efd.
- Returns:
tracebacks – DataFrame containing tracebacks.
- Return type:
pd.DataFrame
- rubin_nights.scriptqueue_formatting.format_html(efd_and_messages, cols, time_order, show_category_index=None)[source]#
Format large report generated by scriptqueue.get_consolidated_messages into a color-coded, yaml-formatted HTML table.
- Parameters:
efd_and_messages (
DataFrame) – The output of scriptqueue.get_consolidated_messages, generally. Could be any dataframe matching the general expected format.cols (
list) – The columns to show from efd_and_messages. Generally will be the columns returned as the second return value from scriptqueue.get_consolidated_messages.time_order (
str) – Show messages innewest firstor not.show_category_index (
list[int] |None, default:None) – Which category_indexes to show in the formatted html.
- Returns:
html – An HTML table with the formatted scriptqueue + messages values.
- Return type:
str