mcstasscript.data.data.McStasDataBinned

mcstasscript.data.data.McStasDataBinned

class mcstasscript.data.data.McStasDataBinned(metadata, intensity, error, ncount, **kwargs)

Class for holding full McStas dataset with data, metadata and plotting preferences

metadata

Holds the metadata for the dataset

Type

McStasMetaData instance

name

Name of component, extracted from metadata

Type

str

Intensity

Intensity data [neutrons/s] in 1d or 2d numpy array, dimension in metadata

Type

numpy array

Error

Error data [neutrons/s] in 1d or 2d numpy array, same dimensions as Intensity

Type

numpy array

Ncount

Number of rays in bin, 1d or 2d numpy array, same dimensions as Intensity

Type

numpy array

plot_options

Holds the plotting preferences for the dataset

Type

McStasPlotOptions instance

set_xlabel : string

sets xlabel of data for plotting

set_ylabel : string

sets ylabel of data for plotting

set_title : string

sets title of data for plotting

set_options : keyword arguments

sets plot options, keywords passed to McStasPlotOptions method

__init__(metadata, intensity, error, ncount, **kwargs)

Initialize a new McStas dataset, 4 positional arguments, pass xaxis as kwarg if 1d data

Parameters
  • metadata (McStasMetaData instance) – Holds the metadata for the dataset

  • intensity (numpy array) – Intensity data [neutrons/s] in 1d or 2d numpy array, dimension in metadata

  • error (numpy array) – Error data [neutrons/s] in 1d or 2d numpy array, same dimensions as Intensity

  • ncount (numpy array) – Number of rays in bin, 1d or 2d numpy array, same dimensions as Intensity

  • kwargs (keyword arguments) – xaxis is required for 1d data

Methods

__init__(metadata, intensity, error, ncount, ...)

Initialize a new McStas dataset, 4 positional arguments, pass xaxis as kwarg if 1d data

get_data_location()

set_data_location(data_location)

set_plot_options(**kwargs)

set_title(string)

set_xlabel(string)

set_ylabel(string)