def _coerce_itype(itype):
    """Changes string itype to int"""
    if itype in [None, 1, 2, 3, 4]:
        pass
    elif itype.lower() == 'timeseries':
        itype = 1
    elif itype.lower() == 'borehole1d':
        itype = 2
    elif itype.lower() == 'cpt':
        itype = 3
    elif itype.lower() == 'borehole3d':
        itype = 4
    else:
        raise ValueError('Invalid IPF itype')
    return itype
