Error when reading dynalogs


I have been using pylinac for some time now for reading dynalog files. I have done wonderful things with it so far. I think you have created an important piece of software that is useful even for the ordinary clinical physicist.

But I have a problem. From time to time I get an error when reading certain dynalogs. The error I get is something like this:

File “…\pylinac\”, line 370, in init
File “…\pylinac\”, line 709, in _read_log
File “…\pylinac\”, line 742, in _read_tlog
self.subbeams, self._cursor = SubbeamManager(fcontent, self._cursor, self.header)._read()
File “…\pylinac\”, line 1931, in _read
self.sampling_interval = self._decode_binary(self._log_content, int)
ValueError: could not convert string to float: …\r\n\r\n

The last line pertains to patient_name. I discovered, after some experimentation, that if the first character of the patient_name is an upper case V, then this error will ensue. Can you confirm this?

Live long and prosper!

Thanks for the kind words!

I looked into it and fortunately it’s and easy fix! The analyzer looks to see if the log is a trajectory log first, then a dynalog. It looks at the first 5 letters. For a tlog, this should be “VOSTL”. The current method only looks to see if a “V” is somewhere in that sequence. For dynalogs, the first letter is the log version and then the patient name. For a dynalog with a patient name starting with a capital V, this would get seen as “BVinn” for a B log version with a name like “Vinnie”. The fix is to this line. Replace “V” with “VOSTL”. That’s it. Since the fix is minor and I’m pretty close to the 1.7 release I’ll roll out the official fix in that version. Let me know if you run into any further problems!

Thank you for the fix, James. It solved the problem.