h5analysis.MathData.Object3dAddSubtract

class h5analysis.MathData.Object3dAddSubtract

Bases: Load3d

Apply addition/subtraction on loader objects

Methods

add(obj, line, scan)

Loader objects to be added

background_2d(config, file, x_stream, ...)

Subtracts the defined data from all loaded data

background_3d(config, file, ind_stream, ...)

Subtracts the defined data from all loaded data

evaluate([filename, label_x, label_y, label_z])

Evaluate the request

export(filename[, split_files])

Export and write data to specified file.

exportWidgetStep()

Helper function for exporter widget.

exporter()

Interactive exporter widget.

get_data()

Make data available in memory as exported to file.

load()

This method is not defined

movie(filename[, framerate, aspect, xlim, ...])

Export Stack image as movie

plot([title, xlabel, ylabel, zlabel, ...])

Plot all data assosciated with class instance/object.

subtract(obj, line, scan)

Loader objects to be subtracted

add(obj, line, scan)

Loader objects to be added

Parameters:
  • obj (object) – Loader object

  • line (int) – load, add, subtract line of object (indexing with 0)

  • scan (int) – number of the scan to be accessed

background_2d(config, file, x_stream, detector, *args, **kwargs)

Subtracts the defined data from all loaded data

Parameters:
  • config (dict) – h5 configuration

  • file (string) – file name

  • x_stream (string) – h5 key or alias of 1d stream

  • detector (string) – alias of the MCA detector

  • *args (int) – scans

  • **kwargs

    norm: boolean

    normalizes to [0,1]

    xoffset: list

    fitting offset (x-stream)

    xcoffset: float

    constant offset (x-stream)

    yoffset: list

    fitting offset (y-stream)

    ycoffset: float

    constant offset (y-stream)

    grid_x: list

    grid data evenly with [start,stop,delta]

    savgol: tuple

    (window length, polynomial order, derivative)

    binsize: int

    puts data in bins of specified size

    legend_items: dict

    dict[scan number] = description for legend

    binsize_x: int

    puts data in bins of specified size in the horizontal direction

    binsize: int

    puts data in bins of specified size in the vertical direction

background_3d(config, file, ind_stream, stack, *args, tempclass=None, **kwargs)

Subtracts the defined data from all loaded data

Parameters:
  • config (dict) – h5 configuration

  • file (string) – filename

  • ind_stream (string) – independent stream, corresponding to stack’s first dim

  • stack (string) – alias of an image STACK

  • args (int) – scan number

  • kwargs

    xoffset: list of tuples

    fitted offset (x-stream)

    xcoffset: float

    constant offset (x-stream)

    yoffset: list of tuples

    fitted offset (y-stream)

    ycoffset: float

    constant offset (y-stream)

    grid_x: list

    grid equally spaced in x with [start, stop, delta]

    grid_y: list

    grid equally spaced in y with [start, stop, delta]

    norm_by: string

    norm MCA by defined h5 key or SCA alias

    binsize_x: int

    puts data in bins of specified size in the horizontal direction

    binsize: int

    puts data in bins of specified size in the vertical direction

evaluate(filename=None, label_x=None, label_y=None, label_z=None)

Evaluate the request

Parameters:

kwargs

filename: str

Name of the data file

label_x: str

Label on horizontal axis

label_y: str

Label on vertical axis

label_z: str

Label for count axis

export(filename, split_files=False)

Export and write data to specified file.

Parameters:
  • filename (string)

  • split_files (Boolean) – Sets whether scans are exported appended to one file (False), or separately (True)

exportWidgetStep()

Helper function for exporter widget.

exporter()

Interactive exporter widget.

get_data()

Make data available in memory as exported to file.

Returns:

  • f (string.IO object) – Motor and Detector Scales. Pandas Data Series. 1) Rewind memory with f.seek(0) 2) Load with pandas.read_csv(f,skiprows=3)

  • g (string.IO object) – Actual gridded detector image. 1) Rewind memory with g.seek(0) 2) Load with numpy.genfromtxt(g,skip_header=4)

  • raw_data (list) – List of lists with series data, series header, and matrix_data

load()

This method is not defined

movie(filename, framerate=20, aspect=1, xlim=None, ylim=None, filetype='gif', **kwargs)

Export Stack image as movie

Parameters:
  • filename (string)

  • framerate (int) – number of frames per second

  • aspect (float) – aspect ratio

  • xlim (None, tuple)

  • ylim (None, tuple)

  • filetype (string) – Use: “gif” or “mp4”

  • kwargs – all matplotlib figure key-word arguments

plot(title=None, xlabel=None, ylabel=None, zlabel=None, plot_height=600, plot_width=600, vmin=None, vmax=None, colormap='linear', norm=False, xprec=None, yprec=None, **kwargs)

Plot all data assosciated with class instance/object.

Parameters:
  • title (string, optional)

  • xlabel (string, optional)

  • ylabel (string, optional)

  • zlabel (string, optional)

  • plot_height (int, optional)

  • plot_width (int, optional)

  • vmin (float, optional)

  • vmax (float, optional)

  • colormap (string) – Use: “linear” or “log”

  • norm (boolean) – Normalizes to the maximum z-value across all images in the stack

  • xprec (int, optional) – Specifies the forced floating point X precision of the hover tool

  • yprec (int, optional) – Specifies the forced floating point Y precision of the hover tool

  • kwargs – all bokeh figure key-word arguments

subtract(obj, line, scan)

Loader objects to be subtracted

Parameters:
  • obj (object) – Loader object

  • line (int) – load, add, subtract line of object (indexing with 0)

  • scan (int) – number of the scan to be accessed