.. include:: /_substitutions.rst

.. _cli-cnm-post:

CNM post-processing CLI: ``lmodea-k-cnm``
=========================================

``lmodea-k-cnm`` reads existing ``lmodea.h5`` and ``dynmat.h5`` files and
computes alternative CNM amplitudes, including de-overlapped
Konkoli-Cremer-style amplitudes for overlapping internal coordinates. This is a
post-processing step for data generated by ``lmodea-k --cnm``.

Usage
-----

::

   lmodea-k-cnm [options]

Options
-------

``--lmodea-h5`` (default: ``lmodea.h5``)
  Path to the ``lmodea-k`` output file.

``--dynmat-h5`` (default: ``dynmat.h5``)
  Path to the standard dynamical-matrix input file.

``-o`` / ``--output``
  Output HDF5 file. If omitted, the command updates ``lmodea.h5`` according to
  the selected write mode.

``--method`` (default: ``normalize_sum``)
  De-overlapping method. Supported values are ``normalize_sum``,
  ``orthogonalise``, ``project``, and ``none``.

``--in-place``
  Modify ``lmodea.h5`` in place.

``-v`` / ``--verbose``
  Print more detailed progress information.

Output datasets
---------------

The command writes CNM post-processing datasets to the selected output file,
including:

- ``CNM/amplitudes_deoverlapped``
- ``CNM/amplitudes_normalised``
- ``CNM/dominant_coord``
- ``CNM/max_amplitude``
- ``CNM/character_cumsum``
- ``CNM/coords_for_90_percent``
- ``local_modes/sym_keys``

Examples
--------

::

   lmodea-k-cnm --in-place
   lmodea-k-cnm -o cnm_output.h5 --method orthogonalise
