{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# MTZ Data Types \n", "\n", "MTZ files use column types to specify what type of crystallographic data is contained within a given column (see [MTZ specification](https://www.ccp4.ac.uk/html/mtzformat.html#column-types)). This enables columns to have arbitrary names while ensuring that the column values are interpreted correctly. \n", "\n", "In order to ensure that MTZ data types behave as expected in ``rs.DataSet`` objects, we have implemented a set of custom ``pandas`` dtypes to represent the crystallographic data found in MTZ files. This facilitates MTZ file I/O, and makes it possible to write methods that operate only on expected types of crystallographic data. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import reciprocalspaceship as rs\n", "import numpy as np\n", "from IPython.display import HTML" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "### Supported MTZ data types\n", "\n", "The following MTZ dtypes are available for `rs.DataSet` and `rs.DataSeries` objects:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| MTZ Code | \n", "Name | \n", "Class | \n", "Internal | \n", "
|---|---|---|---|
| D | \n", "AnomalousDifference | \n", "AnomalousDifferenceDtype | \n", "float32 | \n", "
| B | \n", "Batch | \n", "BatchDtype | \n", "int32 | \n", "
| K | \n", "FriedelIntensity | \n", "FriedelIntensityDtype | \n", "float32 | \n", "
| G | \n", "FriedelSFAmplitude | \n", "FriedelStructureFactorAmplitudeDtype | \n", "float32 | \n", "
| H | \n", "HKL | \n", "HKLIndexDtype | \n", "int32 | \n", "
| A | \n", "HendricksonLattman | \n", "HendricksonLattmanDtype | \n", "float32 | \n", "
| J | \n", "Intensity | \n", "IntensityDtype | \n", "float32 | \n", "
| I | \n", "MTZInt | \n", "MTZIntDtype | \n", "int32 | \n", "
| R | \n", "MTZReal | \n", "MTZRealDtype | \n", "float32 | \n", "
| Y | \n", "M/ISYM | \n", "M_IsymDtype | \n", "int32 | \n", "
| E | \n", "NormalizedSFAmplitude | \n", "NormalizedStructureFactorAmplitudeDtype | \n", "float32 | \n", "
| P | \n", "Phase | \n", "PhaseDtype | \n", "float32 | \n", "
| Q | \n", "Stddev | \n", "StandardDeviationDtype | \n", "float32 | \n", "
| M | \n", "StddevFriedelI | \n", "StandardDeviationFriedelIDtype | \n", "float32 | \n", "
| L | \n", "StddevFriedelSF | \n", "StandardDeviationFriedelSFDtype | \n", "float32 | \n", "
| F | \n", "SFAmplitude | \n", "StructureFactorAmplitudeDtype | \n", "float32 | \n", "
| W | \n", "Weight | \n", "WeightDtype | \n", "float32 | \n", "