hexrd.wppf.spectrum module
- class hexrd.wppf.spectrum.Spectrum(x=None, y=None, name='')[source]
Bases:
object
>> @AUTHOR: Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov >> @DATE: 05/18/2020 SS 1.0 original >> @DETAILS: spectrum class holds the a pair of x,y data, in this case, would be
2theta-intensity values
- property data
- property data_array
- dump_hdf5(file, name)[source]
>> @AUTHOR: Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov >> @DATE: 01/15/2021 SS 1.0 original >> @DETAILS: dump the class to a hdf5 file. the file argument could either be a
string or a h5.File instance. If it is a filename, then HDF5 file is created, a Spectrum group is created and data is written out. Else data written to Spectrum group in existing file object
- >> @PARAMS file file name string or h5py.File object
name name ID of the spectrum e.g. experimental or simulated or background
- extend_to(x_value, y_value)[source]
Extends the current Spectrum to a specific x_value by filling it with the y_value. Does not modify inplace but returns a new filled Spectrum :param x_value: Point to which extend the Spectrum should be smaller than the lowest x-value in the Spectrum or vice versa :param y_value: number to fill the Spectrum with :return: extended Spectrum
- nan_to_zero()[source]
set the nan in spectrum to zero sometimes integrated spectrum in data can have some nans, so need to catch those
- property original_data
- property scaling
- property x
- property y