.. # split from OESystemFunctions.rst:2291

.. include:: ../substitutions

.. oe:namespace:: OESystem

.. meta::
   :keywords: OEReadMTZ

..  _OESystem_OEReadMTZ:

.. oe:function:: OEReadMTZ

   .. oe:language:: c++ java csharp

      .. oe:api::

         bool OEReadMTZ(const std::string& filename,
                        OESystem::OESkewGrid& sgrid, unsigned int maptype)

   .. oe:language:: python

      .. oe:api:: python

         OEReadMTZ(filename: str, sgrid: OESkewGrid, maptype: int) -> bool

   Read an MTZ (crystallographic reflection format) into an OpenEye skew grid.
   MTZ grids require that the proper column names be known to extract the
   appropriate reflection data.  This form of :oe:func:`OESystem::OEReadMTZ` automatically
   chooses appropriate columns from the MTZ file to generate the requested
   map type.  :oe:func:`OESystem::OEReadMTZ` understands common refinement packages including REFMAC5,
   BUSTER and PHENIX.  If the columns cannot be found or if the map cannot
   be generated :oe:func:`OESystem::OEReadMTZ` returns false.

   The following map types can be generated using predefined operations on the MTZ
   column data:

   ================================================= =========================================
   MapType                                           Description
   ================================================= =========================================
   :oe:const:`OESystem::OEMTZMapType::Fo`            Observed Reflections
   ------------------------------------------------- -----------------------------------------
   :oe:const:`OESystem::OEMTZMapType::Fc`            Map generated from calculated model
   ------------------------------------------------- -----------------------------------------
   :oe:const:`OESystem::OEMTZMapType::TwoFoFc`       2Fo - Fc
   ------------------------------------------------- -----------------------------------------
   :oe:const:`OESystem::OEMTZMapType::ThreeFoTwoFc`  3Fo - Fc
   ------------------------------------------------- -----------------------------------------
   :oe:const:`OESystem::OEMTZMapType::FiveFoThreeFc` 5Fo - 3Fc
   ------------------------------------------------- -----------------------------------------
   :oe:const:`OESystem::OEMTZMapType::TwoFoFcSigmaA` 2Fo - Fc Sigma-A weighted
   ------------------------------------------------- -----------------------------------------
   :oe:const:`OESystem::OEMTZMapType::FoFcSigmaA`    Fo - Fc Sigma-A weighted
   ------------------------------------------------- -----------------------------------------
   :oe:const:`OESystem::OEMTZMapType::FoSquared`     Fo*Fo
   ------------------------------------------------- -----------------------------------------
   :oe:const:`OESystem::OEMTZMapType::FoFom`         Fo * figure of merit
   ------------------------------------------------- -----------------------------------------
   :oe:const:`OESystem::OEMTZMapType::Fwt`           2mFo - DFc (normally)
   ------------------------------------------------- -----------------------------------------
   :oe:const:`OESystem::OEMTZMapType::Fdelwt`        mFo - DFc (normally)
   ------------------------------------------------- -----------------------------------------
   :oe:const:`OESystem::OEMTZMapType::None`          No reflections (used as a status flag)
   ================================================= =========================================

