Skip to content

Commit 4ed08c1

Browse files
committed
Allow first channel number of PHD format to be 0.
See sandialabs/cambio#8
1 parent efa43cd commit 4ed08c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SpecFile_phd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ bool SpecFile::load_from_phd( std::istream &input )
182182
if( fields.size() == 1 ) //you need at least two rows for phd format
183183
throw runtime_error( "Unexpected spectrum data line-size" );
184184

185-
if( (floorf(fields[0]) != fields[0]) || (fields[0] < 1.0f) || IsNan(fields[0]) || IsInf(fields[0]) )
186-
throw runtime_error( "First col of spectrum data must be integer >= 1" );
185+
if( (floorf(fields[0]) != fields[0]) || (fields[0] < 0.0f) || IsNan(fields[0]) || IsInf(fields[0]) )
186+
throw runtime_error( "First col of spectrum data must be integer >= 0" );
187187

188188
const size_t start_channel = static_cast<size_t>( fields[0] );
189189

0 commit comments

Comments
 (0)