SimExLite.DiffractionData.DiffractionData

class SimExLite.DiffractionData.DiffractionData(key, data_dict=None, filename=None, file_format_class=None, file_format_kwargs=None)[source]

Diffraction data mapper

__init__(key, data_dict=None, filename=None, file_format_class=None, file_format_kwargs=None)[source]
Parameters:
  • key – The key to identify the Data Object.

  • expected_data – A placeholder dict for expected data. The keys of this dict are expected to be found during the execution of get_data(). The value for each key can be None.

  • data_dict – The dict to map by this DataClass. It has to be None if a file mapping was already set, defaults to None.

  • filename – The filename of the file to map by this DataClass. It has to be None if a dict mapping was already set, defaults to None.

  • file_format_class (class, optional) – The FormatClass to map the file by this DataClass, It has to be None if a dict mapping was already set, defaults to None

  • file_format_kwargs – The kwargs needed to map the file, defaults to None.

Methods

__init__(key[, data_dict, filename, ...])

param key:

The key to identify the Data Object.

add_Gaussian_noise(mu, sigs_popt)

Add Gaussian noise to one diffraction pattern

add_beam_stop(stop_rad)

Add a beamstop in pixel radius (float) to the diffraction patterns.

apply_geom_mask(geom)

Apply the mask from a detector geom to the data, detector gaps will be filled with -1.

from_dict(data_dict, key)

Create the data class by a python dictionary.

from_file(filename, format_class, key, **kwargs)

Create a Data Object mapping a file.

get_data(**kwargs)

Return the data in a dictionary

list_formats()

Print supported formats

multiply(val[, chunk_size])

Multiply a number to the diffraction patterns.

poissonize()

Poissonize the data array in this data class

set_array_data_type(data_type)

The the data numpy array dtype

set_dict(data_dict)

Set a mapping dict for this DataClass.

set_file(filename, format_class, **kwargs)

Set a mapping file for this DataClass.

supported_formats()

write(filename, format_class[, key])

Write the data mapped by the Data Object into a file and return a Data Object mapping the file.

Attributes

data_dict

The data_dict of the class instance for calculator usage

expected_data

The expected_data of the class instance for calculator usage

file_format_class

The FormatClass to map the file by this DataClass

file_format_kwargs

The kwargs needed to map the file

filename

The filename of the file to map by this DataClass.

key

The key of the class instance for calculator usage

mapping_content

Returns an overview of the keys of the mapped dict or the filename of the mapped file

mapping_type

If this data class is a file mapping or python dict mapping.