def FindSolFile(shot=0, t=0, Dt=None, Mesh='Rough1', Deg=2, Deriv='D2N2', Sep=True, Pos=True, OutPath='/afs/ipp-garching.mpg.de/home/d/didiv/Python/tofu/src/Outputs_AUG/'):
    """ Identify the good Sol2D saved file in a given folder (OutPath), based on key ToFu criteria

    When trying to load a Sol2D object (i.e.: solution of a tomographic inversion), it may be handy to provide the key parameters (shot, time, mesh name, degree of basis functions, regularisation functional) instead of copy-pasting the full file name.
    This function identifies, within the relevant repository (OutPath), the files matching the provided criteria.
    This function only works of the automatically generated default SaveName was preserved for the Sol2D objects.

    Parameters
    ----------
    shot :      int
        A shot number
    t :         None / int / float
        A time value that must be contained in the time interval of the Sol2D file, must be provided if Dt is None
    Dt :        None / iterable
        A time interval that the Sol2D file has to match, must be provided if t is None
    Mesh :      str
        The name of the mesh that was used to compute the inversion
    Deg :       int
        The of the b-splines (LBF2D object) that were used to discretize the solution
    Deriv :     str
        The flag indicating the regularization functional that was used for the inversion
    Sep :       bool
        The flag value that was used for indicating whether the boundary constraint at the separatrix should be considered
    Pos :       bool
        The flag value that was used for indicating whether the positivity constraint was considered
    Outpath :   str
        The absolute path of the repository where to look

    Returns
    -------
    out :       None / str
        The matching file name, if any

    """
    assert None in [t,Dt] and not (t is None and Dt is None), "Arg t or Dt must be None, but not both !"
    LF = [ff for ff in os.listdir(OutPath) if 'TFI_Sol2D_AUG_SXR' in ff]
    LF = [ff for ff in LF if all([ss in ff for ss in ['_'+str(shot)+'_', '_'+Mesh+'_D'+str(Deg), '_Deriv'+Deriv+'_Sep'+str(Sep)+'_Pos'+str(Pos)]])]
    if len(LF)==0:
        print("No matching Sol2D file in ", OutPath)
        out = None
    LDTstr = [ff[ff.index('_Dt')+3:ff.index('s_')] for ff in LF]
    LDTstr = [(ss[:7],ss[8:]) for ss in LDTstr]
    if t is None:
        LF = [LF[ii] for ii in range(0,len(LF)) if LDTstr[ii][0]+'-'+LDTstr[ii][1]=='{0:07.4f}-{1:07.4f}'.format(Dt[0],Dt[1])]
    elif Dt is None:
        LF = [LF[ii] for ii in range(0,len(LF)) if t>=float(LDTstr[ii][0]) and t<=float(LDTstr[ii][1])]
    if len(LF)==0:
        print("No matching Sol2D file in ", OutPath)
        out = None
    elif len(LF)>1:
        print("Several matching Sol2D files in ", OutPath)
        print(LF)
        out = None
    else:
        out = LF[0]
    return out