You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently specsim has some edge effects such that the output spectra are not valid over the full wavelength range requested, requiring the user to pad their requested range and then trim back. It isn't completely straightforward for the user to know how much to pad or what the valid range is. It would be better if specsim could internally do this padding and trimming such that the user just gets back a fully valid spectrum over the requested wavelength grid.
Note: this isn't just an issue of walking off the edge of a CCD. In that case specsim should return flux=ivar=0 for those wavelengths.
Some example user-side code that might be helpful when doing this internally, and would be considerably simplified on the user side when this is done:
#- resolution matrix is pre-calculated but doesn't cover all wavelengths
#- HACK HACK HACK: pull out piece that is actually used
j = qsim.instrument.cameraBands.index(channel)
R = qsim.cameras[j].sparseKernel
goodwave = np.where(np.sum(R.toarray(), axis=0) > 0)[0]
Rdata = R[goodwave][:,goodwave].todia().data #- [goodwave, goodwave] doesn't work
# ...
results = qsim.simulate(sourceType=opts.objtype.lower(), sourceSpectrum=inspec,
airmass = opts.airmass, expTime = desiparams['exptime'], downsampling=1)
# ...
results.obsflux[goodwave]
results.ivar[goodwave]
# Note: np.where(results.ivar != 0)[0] != goodwave; I don't know what the difference is
The text was updated successfully, but these errors were encountered:
Is this issue about the wavelength coverage of each camera's resolution matrix (sparseKernel) or of the output spectrum? I am not sure what you mean by:
...output spectra are not valid over the full wavelength range requested...
Currently specsim has some edge effects such that the output spectra are not valid over the full wavelength range requested, requiring the user to pad their requested range and then trim back. It isn't completely straightforward for the user to know how much to pad or what the valid range is. It would be better if specsim could internally do this padding and trimming such that the user just gets back a fully valid spectrum over the requested wavelength grid.
Note: this isn't just an issue of walking off the edge of a CCD. In that case specsim should return flux=ivar=0 for those wavelengths.
Some example user-side code that might be helpful when doing this internally, and would be considerably simplified on the user side when this is done:
The text was updated successfully, but these errors were encountered: