ess.nmx.mtz_io.nmx_mtz_dataframe_to_scipp_dataarray#
- ess.nmx.mtz_io.nmx_mtz_dataframe_to_scipp_dataarray(nmx_mtz_df)[source]#
Converts the processed mtz dataframe to a scipp dataarray.
The intensity, with column name
DEFAULT_INTENSITY_COLUMN_NAME
becomes the data and the standard uncertainty of intensity, with column nameDEFAULT_SIGMA_INTENSITY_COLUMN_NAME
becomes the variances of the data.- Parameters:
nmx_mtz_df (
mtz_io.NMXMtzDataFrame
(pandas.core.frame.DataFrame
)) – The merged and processed mtz dataframe.- Returns:
mtz_io.NMXMtzDataArray
(scipp.DataArray
) – The scipp dataarray with the intensity and variances. TheI
column becomes the data and the squaredSIGI
column becomes the variances. Therefore they are not in the coordinates.Following coordinates are modified:
hkl
: The miller indices as a string.It is modified to have a string dtype since is no dtype that can represent this in scipp.
hkl_asu
: The asymmetric unit of miller indices as a string.This coordinate will be used to derive estimated scale factors. It is modified to have a string dtype as the same reason as why
hkl
coordinate is modified.
Zero or negative intensities are removed from the dataarray. It can happen due to the post-processing of the data, e.g. background subtraction.