Hi Troels, I've had a quick look at this bug and it is caused by some assumptions that do not hold for this data set. I've partly fixed the bug (http://article.gmane.org/gmane.science.nmr.relax.scm/22943), in that the maximum relaxation time is taken instead of the first value of 0.0. For exponential curves, it shouldn't really matter what the time is as R2eff will be correctly estimated independently of this (for sanity, it might be worth testing though). The problem lies in the return_r2eff_arrays() dispersion function. For the data set, when printing out exp_type, frq, offset, point, ei, mi, oi, di, and relax_times we see:
- R1rho 799777399.1 118.078 431.0 0 0 0 0 [0.0, 0.04, 0.1, 0.2] - R1rho 799777399.1 118.078 651.2 0 0 0 1 [0.0, 0.04, 0.1, 0.2, 0.4] RelaxError: ... In this function, have a look at how relax_times is set up. This is a list of lists with the dimensions [Ei][Mi]. But from the above printout, it is obvious that we have different relaxation times per offset and dispersion point! It is rather logical that such a case would be possible - users can measure whatever they like, and they usually come up with very strange combinations. So the solution is to extend relax_times to have the full dimensions [Ei][Mi][Oi][Di]. From memory, we have discussed this exact issue before, but nothing was done about it (I can't find that conversation in the archives though). This should not be too hard to implement in this function as well as handling the new dimensions in the dispersion target function class. I'll let you do it as it's your data set and your code that is affected. I hope it'll be easy enough to use the extended structure in your super fast lib.dispersion modules! You already have coded the [Ei][Mi] to [Ei][Si][Mi][Oi][Di] conversion in the target function class __init__() method, so a [Ei][Mi][Oi][Di] to [Ei][Si][Mi][Oi][Di] conversion should be trivial for you. Cheers, Edward On 12 August 2014 18:01, Troels E. Linnet <no-reply.invalid-addr...@gna.org> wrote: > Follow-up Comment #2, bug #22461 (project relax): > > This error can be triggered by: > > relax -s Relax_disp.test_r1rho_kjaergaard_missing_r1 --numpy-raise -d > > The error is: > ..... > File "/Users/tlinnet/software/R1_fitting/target_functions/relax_disp.py", > line 314, in __init__ > self.inv_relax_times[ei, si, mi, :] = 1.0 / relax_time > FloatingPointError: divide by zero encountered in double_scalars > > The time reported is: [[ 0.]] > This is a division error with 0.0. > > This is strange, since the print of time is: > in: specific_analyses/relax_disp/optimisation.py, line 561 > print self.relax_times : [[ 0.]] > print cdp.relax_time_list : [0.0, 0.04, 0.1, 0.14, 0.2, 0.4] > > The problem resides in: > specific_analyses/relax_disp/data.py in function 'return_r2eff_arrays()'. > > The relax times is expected to have indices [ei][mi]. > > A "print ei, mi, oi, di, relax_time" in line 4392 in data.py shows: > 0 0 0 0 0.0 > 0 0 0 0 0.04 > 0 0 0 0 0.1 > 0 0 0 0 0.2 > 0 0 0 1 0.0 > 0 0 0 1 0.04 > 0 0 0 1 0.1 > 0 0 0 1 0.2 > 0 0 0 1 0.4 > 0 0 0 2 0.0 > 0 0 0 2 0.04 > 0 0 0 2 0.1 > 0 0 0 2 0.2 > 0 0 0 2 0.4 > 0 0 0 2 0.0 > 0 0 0 2 0.04 > 0 0 0 2 0.1 > 0 0 0 2 0.2 > 0 0 0 2 0.4 > 0 0 0 2 0.0 > 0 0 0 2 0.04 > 0 0 0 2 0.1 > 0 0 0 2 0.2 > 0 0 0 2 0.4 > 0 0 0 3 0.0 > 0 0 0 3 0.04 > 0 0 0 3 0.1 > 0 0 0 3 0.2 > 0 0 0 3 0.4 > 0 0 0 4 0.0 > 0 0 0 4 0.04 > 0 0 0 4 0.1 > 0 0 0 4 0.2 > 0 0 0 4 0.4 > 0 0 0 4 0.0 > 0 0 0 4 0.04 > 0 0 0 4 0.1 > 0 0 0 4 0.2 > 0 0 0 4 0.4 > 0 0 0 4 0.0 > 0 0 0 4 0.04 > 0 0 0 4 0.1 > 0 0 0 4 0.2 > 0 0 0 4 0.4 > 0 0 0 4 0.0 > 0 0 0 4 0.04 > 0 0 0 4 0.1 > 0 0 0 4 0.2 > 0 0 0 4 0.4 > 0 0 0 4 0.0 > 0 0 0 4 0.04 > 0 0 0 4 0.1 > 0 0 0 4 0.2 > 0 0 0 4 0.4 > 0 0 0 4 0.0 > 0 0 0 4 0.04 > 0 0 0 4 0.1 > 0 0 0 4 0.2 > 0 0 0 4 0.4 > 0 0 0 5 0.0 > 0 0 0 5 0.04 > 0 0 0 5 0.1 > 0 0 0 5 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> 0 0 4 0 0.0 > 0 0 4 0 0.04 > 0 0 4 0 0.1 > 0 0 4 0 0.2 > 0 0 4 0 0.4 > 0 0 4 0 0.0 > 0 0 4 0 0.04 > 0 0 4 0 0.1 > 0 0 4 0 0.2 > 0 0 4 0 0.4 > 0 0 4 0 0.0 > 0 0 4 0 0.04 > 0 0 4 0 0.1 > 0 0 4 0 0.2 > 0 0 4 0 0.4 > 0 0 4 0 0.0 > 0 0 4 0 0.04 > 0 0 4 0 0.1 > 0 0 4 0 0.2 > 0 0 4 0 0.4 > 0 0 5 0 0.0 > 0 0 5 0 0.04 > 0 0 5 0 0.1 > 0 0 5 0 0.2 > 0 0 5 0 0.4 > 0 0 5 0 0.0 > 0 0 5 0 0.04 > 0 0 5 0 0.1 > 0 0 5 0 0.2 > 0 0 5 0 0.4 > 0 0 5 0 0.0 > 0 0 5 0 0.04 > 0 0 5 0 0.1 > 0 0 5 0 0.2 > 0 0 5 0 0.4 > 0 0 5 0 0.0 > 0 0 5 0 0.04 > 0 0 5 0 0.1 > 0 0 5 0 0.2 > 0 0 5 0 0.4 > 0 0 5 0 0.0 > 0 0 5 0 0.04 > 0 0 5 0 0.1 > 0 0 5 0 0.2 > 0 0 5 0 0.4 > 0 0 5 0 0.0 > 0 0 5 0 0.04 > 0 0 5 0 0.1 > 0 0 5 0 0.2 > 0 0 5 0 0.4 > > _______________________________________________________ > > Reply to this item at: > > <http://gna.org/bugs/?22461> > > _______________________________________________ > Message sent via/by Gna! > http://gna.org/ > > > _______________________________________________ > relax (http://www.nmr-relax.com) > > This is the relax-devel mailing list > relax-devel@gna.org > > 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 _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-devel mailing list relax-devel@gna.org 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