A further thank you for your comment, oko1.
$i should always be in range, as it is defined before the loop and can only be incremented if it is in an 'if' loop where $i < $calib_points. When $i == $calib_points, it will only go into the first loop. The reason for this is quite nice as it basically infers a particular set of interpolated data up to the last calibration point and beyond. Obviously, this isn't a great extrapolation, however, as this aforementioned calibration point is conveniently the last point on the spectrum, if does just the trick.
Also, printing the values of $energy_before[] to a file showed that there weren't any non NULL events. Sadly, it was down to $j later on in the code.
However, my sincere thanks for going through the code and for your comments.
Steve
In reply to Re^2: Spurious `undefined' values and conversion issues
by sf_ashley
in thread Spurious `undefined' values and conversion issues
by sf_ashley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |