wojdyr / xylib

library for reading files with x-y data from powder diffraction, spectroscopy, or other experimental methods
GNU Lesser General Public License v2.1
61 stars 18 forks source link

Canberra CNF file n_channels max should be 32768, not 16384 #20

Closed chris-stallard1 closed 3 years ago

chris-stallard1 commented 4 years ago

xylib/canberra_cnf.cpp, line 227:

if (n_channels < 256 || n_channels > 16384)
        throw FormatError("Unexpected number of channels" + S(n_channels));

See 2020-08-03-Bsrm1224-5-1-318.08mg-gp1.zip for an example of a CNF file with 32768 channels.

wojdyr commented 4 years ago

I don't remember if there was a reason for putting 16384 there. Would this CNF file be read correctly if || n_channels > 16384 was removed?

chris-stallard1 commented 3 years ago

Sorry to come back to this after so long, but the file is read correctly if || n_channels > 16384 is removed.