instrument.callbacks

Add Python modules here that receive and handle information from other Bluesky controls.

nexus_data_file_writer

Write scan(s) to a NeXus/HDF5 file.

spec_data_file_writer

custom callbacks

Write scan(s) to a NeXus/HDF5 file.

class instrument.callbacks.nexus_data_file_writer.MyNXWriter(*args, **kwargs)[source]

Bases: NXWriter

Patch to get sample title from metadata, if available.

get_sample_title()[source]

Get the title from the metadata or modify the default.

default title: S{scan_id}-{plan_name}-{short_uid}

instrument.callbacks.nexus_data_file_writer.nxwriter = <instrument.callbacks.nexus_data_file_writer.MyNXWriter object>

The NeXus file writer object.

custom callbacks

newSpecFile(title[, scan_id, RE])

User choice of the SPEC file name.

spec_comment(comment[, doc])

Make it easy for user to add comments to the data file.

specwriter

The SPEC file writer object.

instrument.callbacks.spec_data_file_writer.motor_start_preprocessor(plan)[source]

Record motor positions at start of each run.

instrument.callbacks.spec_data_file_writer.newSpecFile(title, scan_id=None, RE=None)[source]

User choice of the SPEC file name.

Cleans up title, prepends month and day and appends file extension. If RE is passed, then resets RE.md["scan_id"] = scan_id.

If the SPEC file already exists, then scan_id is ignored and RE.md["scan_id"] is set to the last scan number in the file.

instrument.callbacks.spec_data_file_writer.spec_comment(comment, doc=None)[source]

Make it easy for user to add comments to the data file.

instrument.callbacks.spec_data_file_writer.specwriter = <apstools.callbacks.spec_file_writer.SpecWriterCallback2 object>

The SPEC file writer object.