Open moustakas opened 2 years ago
This ticket is a bit of a rabbit hole and I'm inclined to close it. The crash actually occurs in specsim
when the atmospheric extinction is interpolated onto the input wavelength grid--
https://github.com/desihub/specsim/blob/master/specsim/config.py#L488
However, the extinction grid only extends to 9999.9 A
while the wavelength grid in the example in this ticket extends to 10000.0 A
and so an extrapolation exception is raised. In its defense, specsim
does have some options to allow for extrapolated interpolation, but it looks like some of the options in scipy
may have changed since the code was written.
Unfortunately, choosing a shorter maximum wavelength results in a different crash that I'm not inspired to pursue:
from desisim.simexp import simulate_spectra
from desisim.templates import ELG
flux, wave, meta, obj = ELG(maxwave=9990).make_templates(1, seed=1)
sim1 = simulate_spectra(wave, flux)
INFO:io.py:971:read_basis_templates: Reading /Users/ioannis/work/desi/spectro/templates/basis_templates/v3.2/elg_templates_v2.2.fits
INFO:iers.py:82:freeze_iers: Freezing IERS table used by astropy time, coordinates.
DEBUG:simexp.py:418:simulate_spectra: loading specsim desi config desi
DEBUG:simexp.py:422:simulate_spectra: creating specsim desi simulator
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/ioannis/code/desihub/desisim/py/desisim/simexp.py", line 423, in simulate_spectra
desi = desisim.specsim.get_simulator(config, num_fibers=nspec,
File "/Users/ioannis/code/desihub/desisim/py/desisim/specsim.py", line 52, in get_simulator
qsim = specsim.simulator.Simulator(config, num_fibers,
File "/Users/ioannis/code/desihub/specsim/specsim/simulator.py", line 75, in __init__
self.instrument = specsim.instrument.initialize(config, camera_output)
File "/Users/ioannis/code/desihub/specsim/specsim/instrument.py", line 622, in initialize
initialized_cameras.append(specsim.camera.Camera(
File "/Users/ioannis/code/desihub/specsim/specsim/camera.py", line 145, in __init__
raise RuntimeError(
RuntimeError: Wavelength grid min does not cover b-camera response.
For the record, this ticket came up as I was trying to understand https://github.com/desihub/desisim/issues/563.