def rescale(var, dt):
    """
    Rescale variable to fit dt, based on quantities library
    :param var: Variable to rescale
    :param dt: Time steps
    :return: Rescaled integer
    """
    return (var.rescale(dt.units) / dt).magnitude.astype(int).item()