def __get_data_at_step(file, mtm_dat, var):
    """

    Find the data step that corresponds to an BPM image file and get the
    corresponding data (key `var`) from an MTM data file.

    Parameters
    ----------
    file: str
        The path to a BMP image file. The file name given by the PCS instrument
        may not be changed, otherwise the step extraction may fail.
    mtm_dat: dict
        Instrument output data loaded from npz database file.
    var: str
        A key in the npz database.

    Returns
    -------
    dat: ndarray
        An array containing a single data point (float, int)

    """
    if '_ZERO.bmp' in file:
        step = 1
    else:
        step = int(file.split('_')[-1].replace('.bmp', ''))
    step_idx = mtm_dat['step_start'][step - 1]
    dat = mtm_dat[var][step_idx]
    return dat
