BGlib.be.translators.beps_ndf.BEPSndfParser

class BGlib.be.translators.beps_ndf.BEPSndfParser(file_path, wave_type=1, scout=True)[source]

Bases: object

An object of this class is given the responsibility to step through a BEPS new data format file and return parsed BEPSndfPixel objects.

This class is NOT responsible for actually parsing the byte contents within each pixel.

Each wave type is given its own Parser object since it has a file of its own

Initializes the BEPSndfParser object with following inputs:

Parameters:
  • file_path (string or unicode) – Absolute path of the .dat file

  • wave_type (int (optional. Default = 1)) – Integer value signifying type of the excitation waveform

  • scout (Boolean (optional. Default = true)) – whether or not the parser should figure out basic details such as the number of pixels, and the spatial dimensionality

Methods

get_num_pixels

Returns the total number of spatial pixels.

get_spatial_pixels

Returns the number of steps in each spatial dimension organized from fastest to slowest varying dimension

get_wave_type

Returns the excitation wave type as an integer

read_pixel

Returns a BEpixel object containing the parsed information within a pixel.

get_num_pixels()[source]

Returns the total number of spatial pixels. This includes X, Y, Z, Laser positions

Returns:

num_pix – Number of pixels in this file

Return type:

unsigned int

get_spatial_pixels()[source]

Returns the number of steps in each spatial dimension organized from fastest to slowest varying dimension

Returns:

  • __num_laser_steps__ (unsigned int) – Number of laser steps

  • __num_z_steps__ (unsigned int) – Number of height steps

  • __num_x_steps__ (unsigned int) – Number of columns

  • __num_y_steps__ (unsigned int) – Number of rows

get_wave_type()[source]

Returns the excitation wave type as an integer

Returns:

wave_type – Wave type. Positive number means chirp up, negative number is chirp down.

Return type:

int

read_pixel(bin_fft=None)[source]

Returns a BEpixel object containing the parsed information within a pixel. Moves pixel index up by one. This is where one could conceivably read the file in one pass instead of making 100,000 file I/Os.

Returns:

pixel – Object that describes the data contained within the pixel

Return type:

BEPSndfPixel