Skip to content

Commit 209258c

Browse files
authored
Merge pull request #237 from aglowacki/master
Extra check for loading netcdf
2 parents 21928fc + 3c8aaca commit 209258c

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/io/file/netcdf_io.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ size_t NetCDF_IO<T_real>::_load_spectra(E_load_type ltype,
240240
size_t inc_size = header_size + (spectra_size * MAX_NUM_SUPPORTED_DETECOTRS_PER_COL);
241241
for(size_t m1 = 0; m1 < cols_before_inc; m1++)
242242
{
243+
if (col_idx >= spec_line->size())
244+
{
245+
return col_idx;
246+
}
243247
size_t l = header_size + (m1 * inc_size);
244248
if (ltype == E_load_type::LINE)
245249
{

src/workflow/xrf/spectra_file_source.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,13 @@ bool Spectra_File_Source<T_real>::load_netcdf_line(std::string dirpath,
114114
template<typename T_real>
115115
data_struct::Stream_Block<T_real>* Spectra_File_Source<T_real>::_alloc_stream_block(int detector, size_t row, size_t col, size_t height, size_t width, size_t spectra_size)
116116
{
117+
/*
117118
if (_max_num_stream_blocks == -1 && _analysis_job != nullptr)
118119
{
119120
_max_num_stream_blocks = _analysis_job->mem_limit / (spectra_size * sizeof(T_real));
120121
logI << "Max stream blocks: " << _max_num_stream_blocks << "\n";
121122
}
123+
*/
122124
return new data_struct::Stream_Block<T_real>(detector, row, col, height, width);
123125
}
124126

0 commit comments

Comments
 (0)