from radis.test.tools.test_slit import linear_dispersion
dispersion = lambda w: linear_dispersion(w, 756, phi=-6.91, m=1, gr=297.42) # Reciprocal linear dispersion of the Acton 750i
s_los.apply_slit("slit_function.txt", slit_dispersion=dispersion)
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
/tmp/ipykernel_735/2481538297.py in <module>
1 from radis.test.tools.test_slit import linear_dispersion
2 dispersion = lambda w: linear_dispersion(w, 756, phi=-6.91, m=1, gr=297.42) # Reciprocal linear dispersion of the Acton 750i
----> 3 s_los.apply_slit("slit_function.txt", slit_dispersion=dispersion)
/srv/conda/envs/notebook/lib/python3.8/site-packages/radis/spectrum/spectrum.py in apply_slit(self, slit_function, unit, shape, center_wavespace, norm_by, mode, plot_slit, store, slit_dispersion, slit_dispersion_threshold, auto_recenter_crop, verbose, inplace, *args, **kwargs)
2729 self._q["wavespace"], w_conv
2730 ):
-> 2731 raise AssertionError(
2732 "Wavespace of convolved arrays is different, cannot store it in the same Spectrum. You can use Spectrum.apply_slit(inplace=False) to return a new spectrum with only the convolved arrays"
2733 )
AssertionError: Wavespace of convolved arrays is different, cannot store it in the same Spectrum. You can use Spectrum.apply_slit(inplace=False) to return a new spectrum with only the convolved arrays
It is worth mentioning that same AssertiveError message pops up when this cell, also uses apply_slit(), is being run:
s.apply_slit("slit_function.txt", slit_dispersion=dispersion)
s.plot(wunit='nm')
s_los.plot(wunit='nm', nfig='same')
#import matplotlib.pyplot as plt
#plt.xlim((4165, 4180))