Code reference

class bmlab.file.BrillouinFile(path)[source]

Load a HDF file with Brillouin microscopy data.

Parameters

path (str) – path of the file to load

Raises

OSError – when trying to open non-existing or bad file

get_repetition(repetition_key)[source]

Get a repetition from the data file based on given key.

Parameters

repetition_key (str) – key to identify the repetition in the Brillouin group

Returns

out – the repetition

Return type

Repetition

repetition_count()[source]

Get the number of repetitions in the data file.

Returns

out – Number of repetitions in the data file

Return type

int

repetition_keys()[source]

Returns list of keys for the various repetitions in the file.

Returns

out

Return type

list of str

class bmlab.file.Repetition(repetition_group)[source]

Creates a repetition from the corresponding group of a HDF file.

Parameters

repetition_group (HDF group) – The HDF group representing a Repetition. Consists of payload, calibration and background.

class bmlab.file.Payload(payload_group)[source]

Creates a payload representation from the corresponding group of a HDF file.

Parameters

payload_group (HDF group) – The payload of a repetition, basically a set of images

get_image(image_key)[source]

Returns the image from the payload for given key.

Parameters

image_key (str) – Key for the image.

Returns

out – Array representing the image.

Return type

numpy.ndarray

image_keys()[source]

Returns the keys of the images stored in the payload.

Returns

out – Keys of images in payload.

Return type

list of str

class bmlab.file.Calibration(calibration_group)[source]

Creates a calibration representation from the corresponding group of a HDF file.

Parameters

calibration_group (HDF group) – Calibration data of a repetition from an HDF file.

Module for interacting with files containing Brillouin microscopy data.

NOTE: Ideally, the users of bmlab should not have to know about the file format in which the data are stored. So, if possible, do not expose HDF objects to the outside (like BMicro).

exception bmlab.file.BadFileException[source]