RawFile

class aare.RawFile(fname, chunk_size=1)

Bases: RawFile

property bitdepth
bytes_per_frame(*args, **kwargs)

Overloaded function.

  1. bytes_per_frame(self: aare._aare.RawFile) -> int

  2. bytes_per_frame(self: aare._aare.RawFile, arg0: typing.SupportsInt | typing.SupportsIndex) -> int

    Bytes per frame for the given ROI.

property bytes_per_pixel
cols(*args, **kwargs)

Overloaded function.

  1. cols(self: aare._aare.RawFile) -> int

  2. cols(self: aare._aare.RawFile, arg0: typing.SupportsInt | typing.SupportsIndex) -> int

    Cols for the given ROI.

property detector_type
frame_number(self: aare._aare.RawFile, arg0: SupportsInt | SupportsIndex) int
property geometry
property master

Return the master file.

Returns:

Master file.

Return type:

RawMasterFile

property n_modules
property n_modules_in_roi
property num_rois
pixels_per_frame(*args, **kwargs)

Overloaded function.

  1. pixels_per_frame(self: aare._aare.RawFile) -> int

  2. pixels_per_frame(self: aare._aare.RawFile, arg0: typing.SupportsInt | typing.SupportsIndex) -> int

    Pixels per frame for the given ROI.

read() tuple

Read the entire file. Seeks to the beginning of the file before reading.

Returns:

header, data

Return type:

tuple

read_frame(self: aare._aare.RawFile) tuple[numpy.typing.NDArray[aare::DetectorHeader], numpy.ndarray]
read_n(self: aare._aare.RawFile, arg0: SupportsInt | SupportsIndex) tuple[numpy.typing.NDArray[aare::DetectorHeader], numpy.ndarray]

Read n frames from the file.

read_n_with_roi(self: aare._aare.RawFile, num_frames: SupportsInt | SupportsIndex, *, roi_index: SupportsInt | SupportsIndex) tuple[numpy.typing.NDArray[aare::DetectorHeader], numpy.ndarray]

Read n frames for a specific ROI

Parameters:
  • num_frames (int) – Number of frames to read.

  • roi_index (int) – Index of the ROI to read.

Return type:

three dimensional numpy.ndarray.

read_roi(self: aare._aare.RawFile, roi_index: SupportsInt | SupportsIndex) tuple[numpy.typing.NDArray[aare::DetectorHeader], numpy.ndarray]

Read one ROI from the current frame.

Parameters:

roi_index (int) – Index of the ROI to read.

Notes

The method advances the frame number, so reading ROIs one after the other won’t work.

Return type:

tuple (header, image)

read_rois(self: aare._aare.RawFile) tuple[list[numpy.typing.NDArray[aare::DetectorHeader]], list[numpy.ndarray]]

Read all ROIs for specific frame.

Parameters:
  • frame_number (int) – Frame number to read.

  • roi_index (Optional[int]) – Index of the ROI to read. If not provided, all ROIs are read.

Returns:

One array per ROI.

Return type:

list of numpy.ndarray

rows(*args, **kwargs)

Overloaded function.

  1. rows(self: aare._aare.RawFile) -> int

  2. rows(self: aare._aare.RawFile, arg0: typing.SupportsInt | typing.SupportsIndex) -> int

    Rows for the given ROI.

property scan_parameters

Return the scan parameters.

Returns:

Scan parameters.

Return type:

ScanParameters

seek(self: aare._aare.RawFile, arg0: SupportsInt | SupportsIndex) None

Seek to a frame index in file.

tell(self: aare._aare.RawFile) int

Return the current frame number.

property total_frames