Changeset 4699 for trunk


Ignore:
Timestamp:
Jan 2, 2021 11:46:35 AM (2 years ago)
Author:
toby
Message:

improve refinement warnings

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath_new.py

    r4693 r4699  
    274274                Amatlam = Amat*(1.+np.eye(Amat.shape[0])*lam)
    275275                Ainv,nz = pinv(Amatlam,xtol)    #do Moore-Penrose inversion (via SVD)
    276                 if nz > 0: G2fil.G2Print('Note: there are {} new SVD Zeros after drop',
     276                if nz > 0: G2fil.G2Print('Note: there are {} new SVD Zeros after drop'.format(nz),
    277277                                             mode='warn')
    278278            Xvec = np.inner(Ainv,Yvec)/Adiag      #solve for LS terms
  • trunk/GSASIIstrMain.py

    r4693 r4699  
    6060    if len(psing):
    6161        if msg: msg += '\n'
    62         msg += '{} Parameters dropped due to singularities:'.format(len(psing))
     62        m = '{} Parameters dropped due to singularities:'.format(len(psing))
     63        msg += m
     64        G2fil.G2Print(m, mode='warn')
     65        m = ''
    6366        for i,val in enumerate(psing):
    6467            if i == 0:
    65                 msg += '\n\t{}'.format(varyList[val])
     68                msg += '\n{}'.format(varyList[val])
     69                m = '  {}'.format(varyList[val])
    6670            else:
    67                 msg += ', {}'.format(varyList[val])
    68         G2fil.G2Print(msg, mode='warn')
     71                if len(m) > 70:
     72                    G2fil.G2Print(m, mode='warn')
     73                    m = '  '
     74                else:
     75                    m += ', '
     76                m += '{}'.format(varyList[val])
     77                if i == 10:
     78                    msg += ', {}... see console for full list'.format(varyList[val])
     79                elif i > 10:
     80                    pass
     81                else:
     82                    msg += ', {}'.format(varyList[val])
     83        if m: G2fil.G2Print(m, mode='warn')
    6984    #report on highly correlated variables
    7085    Hcorr = result[2].get('Hcorr',[])
    7186    if len(Hcorr) > 0:
    7287        if msg: msg += '\n'
    73         msg += 'Note highly correlated parameters:'
     88        m = 'Note highly correlated parameters:'
     89        G2fil.G2Print(m, mode='warn')
     90        msg += m
    7491    elif SVD0 > 0:
    7592        if msg: msg += '\n'
    76         msg += 'Check covariance matrix for parameter correlation'
    77     for v1,v2,corr in Hcorr:
     93        m = 'Check covariance matrix for parameter correlation'
     94        G2fil.G2Print(m, mode='warn')
     95        msg += m
     96    for i,(v1,v2,corr) in enumerate(Hcorr):
    7897        if corr > .95:
    7998            stars = '**'
    8099        else:
    81100            stars = '   '
    82         msg += '\n {} {} and {} (@{:.2f}%)'.format(
     101        m = ' {} {} and {} (@{:.2f}%)'.format(
    83102            stars,varyList[v1],varyList[v2],100.*corr)
     103        G2fil.G2Print(m, mode='warn')
     104        if i == 5:
     105            msg += '\n' + m
     106            msg += '\n   ... check console for more'
     107        elif i < 5:
     108            msg += '\n' + m
    84109    if msg:
    85110        if 'msg' not in Rvals: Rvals['msg'] = ''
Note: See TracChangeset for help on using the changeset viewer.