nabu crashes when flatfield=1 but no flats/darks
Regression:
Traceback (most recent call last):
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/bin/nabu", line 8, in <module>
sys.exit(main())
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/lib/python3.10/site-packages/nabu/app/reconstruct.py", line 111, in main
R = get_reconstructor(args)
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/lib/python3.10/site-packages/nabu/app/reconstruct.py", line 86, in get_reconstructor
proc = ProcessConfig(conf_dict=conf_dict, create_logger=logfile)
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/lib/python3.10/site-packages/nabu/pipeline/processconfig.py", line 61, in __init__
self._update_dataset_info_with_user_config()
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/lib/python3.10/site-packages/nabu/pipeline/fullfield/processconfig.py", line 77, in _update_dataset_info_with_user_config
update_dataset_info_flats_darks(
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/lib/python3.10/site-packages/nabu/resources/nxflatfield.py", line 212, in update_dataset_info_flats_darks
_compute_and_save_reduced_frames()
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/lib/python3.10/site-packages/nabu/resources/nxflatfield.py", line 165, in _compute_and_save_reduced_frames
dataset_info.flats = dataset_info.get_reduced_flats()
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/lib/python3.10/site-packages/nabu/resources/dataset_analyzer.py", line 403, in get_reduced_flats
dkrf_reader = NXDarksFlats(
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/lib/python3.10/site-packages/nabu/io/reader.py", line 747, in __init__
self.darks_reader = NXTomoReader(filename, image_key=2, **nxtomoreader_kwargs)
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/lib/python3.10/site-packages/nabu/io/reader.py", line 629, in __init__
self._set_image_key(image_key)
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/lib/python3.10/site-packages/nabu/io/reader.py", line 660, in _set_image_key
self._image_key_slices = indices_to_slices(idx)
File "/nobackup/scratch/paleo/py310_ubuntu22_amd/lib/python3.10/site-packages/nabu/utils.py", line 93, in indices_to_slices
return [slice(indices[0], indices[-1] + 1)]
IndexError: index 0 is out of bounds for axis 0 with size 0