# magni.afm.types.spectroscopy module¶

Module providing data container classes for .mi spectroscopy files.

The classes of this module can be used either directly or indirectly through the io module by loading an .mi spectroscopy file.

## Routine listings¶

Buffer(magni.afmtypes.BaseClass)
Data class for .mi spectroscopy buffer.
Chunk(magni.afmtypes.BaseClass)
Data class for .mi spectroscopy chunk.
Grid(magni.afmtypes.BaseClass)
Data class for .mi spectroscopy grid.
Point(magni.afmtypes.BaseClass)
Data class for .mi spectroscopy point.
Spectroscopy(magni.afm.types.File)
Data class for .mi spectroscopy.

magni.afm.io
class magni.afm.types.spectroscopy.Buffer(attrs, data)[source]

Data class of the .mi spectroscopy buffers.

Parameters: attrs (dict) – The attributes of the buffer. data (list or tuple) – The grids, points, or chunks of the buffer.
data

numpy.ndarray – The grids, points, or chunks of the buffer.

magni.utils.types.BaseClass
Superclass of the present class.

Examples

No example .mi spectroscopy file is distributed with magni.

data
class magni.afm.types.spectroscopy.Chunk(attrs, data)[source]

Data class of the .mi spectroscopy chunks.

Parameters: attrs (dict) – The attributes of the chunk. data (numpy.ndarray) – The data of the chunk.
data

numpy.ndarray – The data of the chunk.

magni.utils.types.BaseClass
Superclass of the present class.

Examples

No example .mi spectroscopy file is distributed with magni.

data
sweep

Get the sweep property of the chunk.

The sweep property is the series of the entity which was swept.

Returns: sweep (numpy.ndarray) – The sweep property.

Notes

To reduce the memory footprint of chunks, the series does not exist explicitly, until it is requested.

time

Get the time property of the chunk.

Returns: time (numpy.ndarray) – The time property.

Notes

To reduce the memory footprint of chunks, the series does not exist explicitly, until it is requested.

class magni.afm.types.spectroscopy.Grid(attrs, points)[source]

Data class of the .mi spectroscopy grids.

Parameters: attrs (dict) – The attributes of the grid. points (list or tuple) – The points of the grid.
points

tuple – The points of the grid.

magni.utils.types.BaseClass
Superclass of the present class.

Notes

The points are input and output as a 2D tuple of Point instances.

Examples

No example .mi spectroscopy file is distributed with magni.

points
class magni.afm.types.spectroscopy.Point(attrs, chunks=())[source]

Data class of the .mi spectroscopy points.

Parameters: attrs (dict) – The attributes of the point. chunks (list or tuple, optional) – The chunks of the point. (the default is (), which implies no chunks)
chunks

tuple – The chunks of the point.

magni.utils.types.BaseClass
Superclass of the present class.

Examples

No example .mi spectroscopy file is distributed with magni.

chunks
class magni.afm.types.spectroscopy.Spectroscopy(attrs, buffers)[source]

Data class of the .mi spectroscopy files.

Parameters: attrs (dict) – The attributes of the image. buffers (list or tuple) – The buffers of the image.

magni.utils.types.File