Counting Beam Hold-offs in Trajectory Logs

Greetings,

Trying out pylinac for our clinic, I realized I didn’t get the expected values for numbers of beam hold-offs with trajectory Logs. The num_beamholds functions in the DlogAxisData and TlogAxisData classes are exactly the same. This function looks for differences of 1, which is OK for Dynalogs, where beam hold-off state usually takes values of 0 or 1, but in Trajectory logs, values of 1 only happen when dose servo is turned off; values instead usually vary between 0 and 2. I changed the following line

num_holds = int(np.sum(diffmatrix == 1))

to

num_holds = int(np.sum(diffmatrix >= 0))

in the num_beamholds functions in both DlogAxisData and TlogAxisData classes to consider all tyes of beam hold-offs, and I seem to be getting expected results.

I was wondering if this was working as intended and I am trying to find hold-offs pylinac is not meant to find, or if this was small oversight in the analyzer.

I am very excited to try the other modules, they look very promising!

Thank you,
Anthony

Sorry, changed code should read: num_holds = int(np.sum(diffmatrix > 0))

Anthony,
Indeed, it would seem to be a bug. A holdoff should be counted if there was any change of beam hold state, not just a difference of 1. Thanks for reporting this! I filed an issue on Github and will push changes to a new version soon.

Glad pylinac is working for you! Let me know if you find anything else or have suggestions!

James