Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Premature termination in delta compression decode #6

Open
dollarbin opened this issue Oct 7, 2022 · 0 comments
Open

Premature termination in delta compression decode #6

dollarbin opened this issue Oct 7, 2022 · 0 comments

Comments

@dollarbin
Copy link

if bitshift(buffer(1), 12, 'int16') == 0

Thank you for this code, I can't express how much time this has saved me in not dealing with Chemstation software directly. I'm noticing a small bug when decoding HPLC files (file ID 130). If buffer(1) is a factor of 16, the last four bits are all zero ending the decode and truncating the data. The program only checks the last 4 bits--is there a reason why it doesn't look at the entire int16 number it loads into buffer(1)? I don't have access to every type of .ch file but I can only find one case out of tens of thousands of files where the last two bytes aren't zero, an obviously corrupt file.

I checked 23913 ".ch" files from several different types of detectors (DAD, FLD and RID) and it seems to occur in some RID1A.ch and DAD1A.ch files, 541 out of 12093 times for RID1A and 109 out of 5620 times for DAD1A.

I changed the line to
if buffer(1) == 0
and it seems to work, but I don't know if this would break compatibility with some other file types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant