API Architecture

This page describes the objects used to access Nion Swift and how they relate to one another.

For a basic introduction to scripting, see Scripting Guide.

For detailed API reference, see API Reference or click on the classes described below.

API Object

The API is accessed through an API class.

API

The API object gives access to the other objects.

Data Model

The Nion Swift data model is comprised of several objects which are persistent and stored to disk.

Library

The library holds a collection of data and a description of how that data fits together.

DataItem

An item saved to a file on disk that contains a data array, calibrations, metadata, display information, operations, and more.

Graphic

A graphic overlay object.

DataGroup

A group of data items, ordered, and defined by the user.

Auxiliary Classes

The API uses several auxiliary data types.

Data Array

A low level NumPy ndarray.

Metadata

Information about a Data Array, in the form of a dict. Includes calibration, regions, displays, and other data such as title and caption. Metadata is structured data and we recommend that you contact Nion for guidance on how to use metadata.

Calibration

A calibration for a single dimension with offset, scale, and units. See create_calibration().

DataAndMetadata

A read only object representing the combination of a Data Array and Metadata. See create_data_and_metadata().

User Interface

The Nion Swift user interface classes represent what the user sees in the Nion Swift application. It is distinct from the individual elements that make up the low level details of the user interface.

Application

The root object representing the Application. Contains a collection of document controllers and the library.

DocumentWindow

An object representing a window with display panels.

DisplayPanel

A display panel within a window. Maybe contain a data item or a browser of data items or other things.

Instrument Control and Data Collection

There are a few classes which allow you to control instruments and collect data.

HardwareSource

An object that generates data.

Instrument

An object that controls hardware.

RecordTask

An object representing a Record data task.

ViewTask

An object representing a live data View.

User Interface Elements

There are many low level object which allow you to construct a user interface.

Note

TODO: Describe user interface objects