Hi, tlambert!
I’m getting the following error when running a simulation with COSEM fluorophores using the default settings:
ValueError: dimensions () must have the same length as the number of data dimensions, ndim=1
It happens inside _simple_psf.py at
bins = np.linspace(w_min, w_max, num_bins + 1)
when spectral_bins_per_emission_channel = 1 (the default).
From the stack trace it looks like w_min / w_max are xarray.DataArray scalars (from COSEM spectra), so np.linspace gets intercepted by xarray’s __array_wrap__, which then fails on dimension handling.
My guess is that this path was written assuming plain numpy floats, but COSEM uses xarray for spectra. Possibly w_min / w_max just need to be converted to float before calling linspace, or num_bins=1 should directly use the spectral centroid instead of [w_min, w_max].
Does that sound right?
Thanks!

Hi, tlambert!
I’m getting the following error when running a simulation with COSEM fluorophores using the default settings:
It happens inside
_simple_psf.pyatwhen
spectral_bins_per_emission_channel = 1(the default).From the stack trace it looks like
w_min/w_maxarexarray.DataArrayscalars (from COSEM spectra), sonp.linspacegets intercepted by xarray’s__array_wrap__, which then fails on dimension handling.My guess is that this path was written assuming plain numpy floats, but COSEM uses xarray for spectra. Possibly
w_min/w_maxjust need to be converted to float before callinglinspace, ornum_bins=1should directly use the spectral centroid instead of[w_min, w_max].Does that sound right?
Thanks!