Skip to content

Allow for negative sign in phase step

As reported by Michael:

While preparing the VC this aftrenoon I stumbled over an error/inconsistncy  in DrSpine
origin from these lines in fit_utils:
       !! ! functions is very close to a (smooth) parabola....
       dj_phase_step = centerbin%delta_J(2)%value-centerbin%delta_J(1)%value
       dipt:  do ipt=-NIPT,NIPT
          call assert(dj_phase_step>0,'get_phase_offset: phase step must be positive')
          dj = ipt*dj_phase_step/real(xprange*NIPT) + djoffset
          ssq_allpix = 0
          ssq_norpix = 0
the error occurs if   fit sam flag offset was specified in the example.
drspine --> fit sam flag offset phase_offset 0
 > fit sam flag offset phase_offset 0
fitting data role=SAMPLE flag=offset [256] 
===> fitting sample 
fitting echo data file=../nse_data/m20431.echo role=sample flag=offset [256] 
FATAL    get_phase_offset: phase step must be positive ASSERTION FAILED 
Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG IEEE_DIVIDE_BY_ZERO IEEE_DENORMAL