$ gemmi mtz2cif -h
Usage:
  gemmi mtz2cif [options] MTZ_FILE [MTZ_FILE] CIF_FILE
Options:
  -h, --help             Print usage and exit.
  -V, --version          Print version and exit.
  -v, --verbose          Verbose output.
  --spec=FILE            Column and format specification.
  --print-spec           Print default spec and exit.
  -b NAME, --block=NAME  mmCIF block name: data_NAME (default: mtz).
  --id=ID                value for _entry.id (default: xxxx).
  --skip-empty[=COLS]    Skip reflections with no values. If COLS are given, eg.
                         'I(+),I(-)', only values in those columns are checked.
  --skip-negative-sigi   Skip reflections with sigma(I)<0 in unmerged data.
  --no-comments          Do not write comments in the mmCIF file.
  --no-history           Do not write MTZ history in the mmCIF file.
  --no-staraniso-tensor  Do not write _reflns.pdbx_aniso_B_tensor_*.
  --run-from=WRAPPER     Add note in _software.description.
  --wavelength=LAMBDA    Set wavelength (default: from input file).
  --validate             For two MTZ files: validate the intensities match.
  --less-ano             Skip anomalous columns (even if they are in the spec).
                         Used once, skips I(+)/I(-) if <I> and F(+)/F(-) are
                         present. Used twice, skips all anomalous columns.
  --separate             Write merged and unmerged data in separate blocks.
  --depo                 Prepare merged+unmerged mmCIF file for deposition.
  --nfree=N              Flag value used for the free set (default: auto)
  --trim=N               (for testing) output only reflections -N <= h,k,l <=N.

One or two MTZ files are taken as the input. If two files are given,
one must be merged and the other unmerged.
Alternatively, the two input files can be reflection mmCIF file and
unmerged MTZ - this adds unmerged data block to the existing mmCIF file.
XDS_ASCII.HKL file can be used instead of unmerged MTZ file (also when
converting a single file), but then the spec file is ignored.
If CIF_FILE is -, the output is printed to stdout.
If spec is -, it is read from stdin.

Lines in the spec file have format:
  [FLAG] COLUMN TYPE TAG [FORMAT]
 or
  $SPECIAL TAG
for example:
  SIGF_native * SIGF_meas_au 12.5e
  FREE I pdbx_r_free_flag 3.0f
  $counter id
FLAG (optional) is either ? or &:
  ? = ignored if no column in the MTZ file has this name.
  & = ignored if the previous line was ignored.
  Example:
      ? I    J intensity_meas
      & SIGI Q intensity_sigma
COLUMN is MTZ column label. Columns H K L are added if not specified.
  Alternative labels can be separated with | (e.g. FREE|FreeR_flag).
TYPE is used for checking the column type, unless it is '*'.
TAG does not include category name, it is only the part after _refln.
FORMAT (optional) is printf-like floating-point format:
 - one of e, f, g with optional flag, width and precision
 - flag is one of + - # _; '_' stands for ' ', for example '_.4f'
 - since all numbers in MTZ are stored as float, the integer columns use
   the same format as float. The format of _refln.status is ignored.
$SPECIAL is $counter, $dataset, $image, $. or $?, as appropriate for
  _diffrn_refln.id, _diffrn_refln.diffrn_id, image number or null (./?)
