projects/barrel/
brl_binvert.pro
Routines
top source brl_binvert
result = brl_binvert(start, f)
INPUT: start is an initial estimate of bin value(s) f is a temperature/detector dependent constant KEYWORD: none OUTPUT: returns an object of the same type and dimension as start; object contains energy value(s) METHOD: two iterations of Newton-Raphson to solve a transcendental equation. A tricky part is the argument for alog() can be negative, due to electronics offsets (say bin 5 is 0 keV). Since only brl_makeedges() calls, we assume some properties of argument start. If start is a scalar, then we're working on the 511keV line, so we won't have start <= 0. For slo, we can have several early start values negative. Force these to be NaN, and proceed with calculations, then force these to ascending negative values on return. An accurate approach is to use complex numbers and discard the imaginary part of the result. This gives correct negative energy results for bin edges, but doubles computational effort. It's not worth it. NOTES: brl_binvert() should be used only by brl_makeedges() REVISION HISTORY: 14Sep2013: first version 17Sep2013: added workaround for negative energy
Parameters
- start
- f
File attributes
Modification date: | Tue Oct 21 13:53:32 2014 |
Lines: | 14 |