Utilities#

Assists measurement, data exploration, and the user experience.

For complete API details see the Full API Reference.

Also consult the Index under the apstools heading for links to the Exceptions, and Utilities described here.

Utilities by Activity#

APS Data Management#

dm_api_cat()

return the APS DM Catalog API object

dm_api_daq()

return the APS DM Data Acquisition API object

dm_api_dataset_cat()

return the APS DM Dataset Metadata Catalog API object

dm_api_ds()

return the APS DM Data Storage API object

dm_api_file()

return the APS DM File API object

dm_api_filecat()

return the APS DM Metadata Catalog Service API object

dm_api_proc()

return the APS DM Processing API object

dm_setup()

set up this session for APS Data Management

DM_WorkflowCache

track one or more APS DM workflows for bluesky plans

Finding#

findbyname()

find the ophyd object associated with the given ophyd name

findbypv()

find all ophyd objects associated with the given EPICS PV

findCatalogsInNamespace()

return a dictionary of databroker catalogs in the default namespace

Listing#

listdevice()

describe signal information from a device in a pandas DataFrame

listobjects()

show all ophyd Signal and Device objects defined as globals

listplans()

list all plans

listRunKeys()

list all keys (column names) in a scan’s stream

ListRuns

list runs from a catalog according to some options

listruns()

list runs from catalog

Reporting#

file_log_handler()

record logging output to a file

get_log_path()

return a path to ./.logs

print_RE_md()

print the RunEngine metadata in a table

setup_IPython_console_logging()

record all input and output from the IPython console

SlitGeometry

slit size and center as a named tuple

stream_log_handler()

record logging output to a stream such as the console

Other Utilities#

array_index()

return the index of the first occurrence of value in an array

cleanupText()

convert text so it can be used as a dictionary key

connect_pvlist()

given a list of EPICS PV names, return a dict of EpicsSignal objects

dynamic_import()

import the object given its import path as text

EmailNotifications

send email notifications when requested

factor_fwhm

conversion factor between FWHM and standard deviation

peak_full_width()

assess apparent FWHM by inspecting the data

plotxy()

plot y vs x from a bluesky run

select_live_plot()

get the first live plot matching a signal

select_mpl_figure()

get the matplotlib Figure window for y vs x

trim_plot_by_name()

replot with at most the last n lines, by figure name

trim_plot_lines()

replot with at most the last n lines for given x and y axes

trim_string_for_EPICS()

ensure a string does not exceed EPICS PV length

ts2iso()

convert Python timestamp (float) to ISO 8601 time in current time zone

unix()

run a UNIX command, return (stdout, stderr)

warn_if_not_aps_controls_subnet()

warn if not on APS-U controls subnet

xy_statistics()

compute statistical measures of a 1-D array using numpy

General#

call_signature_decorator()

get the names of all function parameters supplied by the caller

cleanupText()

convert text so it can be used as a dictionary key

command_list_as_table()

format a command list as a pyRestTable table object

connect_pvlist()

given a list of EPICS PV names, return a dict of EpicsSignal objects

copy_filtered_catalog()

copy filtered runs from source catalog to target catalog

db_query()

search the databroker v2 database

dictionary_table()

return a text table from a dictionary

dynamic_import()

import the object given its import path as text

EmailNotifications

send email notifications when requested

ExcelDatabaseFileBase

base class: read-only support for Excel files as databases

ExcelDatabaseFileGeneric

generic read-only handling of Excel spreadsheet-as-database

ExcelReadError

exception when reading Excel spreadsheet

findbyname()

find the ophyd object associated with the given ophyd name

findbypv()

find all ophyd objects associated with the given EPICS PV

findCatalogsInNamespace()

return a dictionary of databroker catalogs in the default namespace

full_dotted_name()

return the full dotted name of an ophyd object

get_stream_data_map()

return the names of run’s detector and motor signals

getCatalog()

return a catalog object

getDatabase()

return a bluesky database using keyword guides or default choice

getDefaultCatalog()

return the default databroker catalog

getDefaultDatabase()

find the default database (has the most recent run)

getDefaultNamespace()

get the IPython shell’s namespace dictionary

getRunData()

get the run’s data

getRunDataValue()

get value of key in run stream

getStreamValues()

get values from a previous scan stream in a databroker catalog

ipython_profile_name()

return the name of the current IPython profile

itemizer()

format a list of items

listdevice()

describe signal information from a device in a pandas DataFrame

listobjects()

show all ophyd Signal and Device objects defined as globals

listplans()

list all plans

listRunKeys()

list all keys (column names) in a scan’s stream

ListRuns

list runs from a catalog according to some options

listruns()

list runs from catalog

MMap

dictionary with keys accessible as attributes (read-only)

OverrideParameters

define parameters that can be overridden from a user configuration file

pairwise()

break a list into pairs

plotxy()

plot y vs x from a bluesky run

print_RE_md()

print the RunEngine metadata in a table

quantify_md_key_use()

print table of different key values and how many times each appears

redefine_motor_position()

set EPICS motor record’s user coordinate to a new position

render()

round floating-point numbers to significant figures

replay()

replay the document stream from one or more scans

rss_mem()

return memory used by this process

run_in_thread()

decorator: run a function in a thread

safe_ophyd_name()

make text safe to be used as an ophyd object name

select_live_plot()

get the first live plot matching a signal

select_mpl_figure()

get the matplotlib Figure window for y vs x

split_quoted_line()

split a line into words, some of which may be quoted

StoredDict

a MutableMapping which syncs its contents to storage

summarize_runs()

report bluesky run metrics from the databroker

text_encode()

encode source using the default codepoint

to_unicode_or_bust()

convert bytes to unicode

trim_plot_by_name()

replot with at most the last n lines, by figure name

trim_plot_lines()

replot with at most the last n lines for given x and y axes

trim_string_for_EPICS()

ensure a string does not exceed EPICS PV length

unix()

run a UNIX command, return (stdout, stderr)