def add_reference_frame_arg(parser):
    """
    Add a reference frame argument.

    Reference frame is the frame to compute the parameter against.

    Depending on the client logic the reference frame might have different
    meanings.

    Is defined by ``-r`` and ``--ref-frame``.

    Defaults to ``0``.

    Parameters
    ----------
    parser : `argparse.ArgumentParser <https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser>`_
        The argument parser to which add the refence-frame argument.
    """
    parser.add_argument('-r', '--ref-frame', help=
        'The frame in the trajectory that serves as reference to compute against.Defaults to 0.'
        , default=0, type=int)
