Now that's a useful function! On 11 June 2014 14:55, <[email protected]> wrote: > Author: tlinnet > Date: Wed Jun 11 14:55:31 2014 > New Revision: 23835 > > URL: http://svn.gna.org/viewcvs/relax?rev=23835&view=rev > Log: > Replaced isnan mask with function that catches all invalid values. > > Modified: > branches/disp_spin_speed/lib/dispersion/cr72.py > > Modified: branches/disp_spin_speed/lib/dispersion/cr72.py > URL: > http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/cr72.py?rev=23835&r1=23834&r2=23835&view=diff > ============================================================================== > --- branches/disp_spin_speed/lib/dispersion/cr72.py (original) > +++ branches/disp_spin_speed/lib/dispersion/cr72.py Wed Jun 11 14:55:31 > 2014 > @@ -93,7 +93,7 @@ > > # Python module imports. > from numpy import allclose, arccosh, array, cos, cosh, isfinite, isnan, > fabs, min, max, ndarray, ones, sqrt, sum, zeros > -from numpy.ma import masked_greater_equal, masked_less, masked_where > +from numpy.ma import fix_invalid, masked_greater_equal, masked_less, > masked_where > > # Repetitive calculations (to speed up calculations). > eta_scale = 2.0**(-3.0/2.0) > @@ -219,8 +219,7 @@ > # Catch errors, taking a sum over array is the fastest way to check for > # +/- inf (infinity) and nan (not a number). > if not isfinite(sum(R2eff)): > - # Find the data mask which has nan values, and replace. > - mask = isnan(R2eff) > - R2eff[mask] = 1e100 > + # Replaces nan, inf, etc. with fill value. > + fix_invalid(R2eff, copy=False, fill_value=1e100) > > back_calc[:] = R2eff > > > _______________________________________________ > relax (http://www.nmr-relax.com) > > This is the relax-commits mailing list > [email protected] > > To unsubscribe from this list, get a password > reminder, or change your subscription options, > visit the list information page at > https://mail.gna.org/listinfo/relax-commits
_______________________________________________ relax (http://www.nmr-relax.com) This is the relax-devel mailing list [email protected] To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel

