mail[bug #22032] Minimisation explodes when using Grid_INC=None


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Troels E. Linnet on May 11, 2014 - 21:42:
Follow-up Comment #4, bug #22032 (project relax):

Acccording to these guys:
http://stackoverflow.com/questions/6736590/fast-check-for-nan-in-numpy

The fastest way to check for numpy errors is a sum of the list.
That can then be checked for isfinite() or isnan()

    # Skip the error search.
    etapos = etapos_part / cpmg_frqs
    etaneg = etaneg_part / cpmg_frqs
    fact = Dpos * cosh(etapos) - Dneg * cos(etaneg)

    if isfinite(sum(fact)):
        R2eff =  r20_kex - cpmg_frqs * arccosh(fact)
        for i in range(num_points):
            back_calc[i] = R2eff[i]
    else:
        R2eff = array([10**7]*num_points)
        for i in range(num_points):
            back_calc[i] = R2eff[i]


http://docs.scipy.org/doc/numpy/reference/generated/numpy.isfinite.html

http://docs.scipy.org/doc/numpy/reference/generated/numpy.isnan.html

http://docs.scipy.org/doc/numpy/reference/generated/numpy.isinf.html

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?22032>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/




Related Messages


Powered by MHonArc, Updated Mon May 12 10:40:11 2014