desihub / specsim

Quick simulations of spectrograph response
2 stars 10 forks source link

Random dither offsets applied to fibers should be constant as a function of wavelength #108

Open schlafly opened 4 years ago

schlafly commented 4 years ago

Currently specsim applies a random fiber offset when simulating spectra. This offset is configurable in https://github.com/desihub/specsim/blob/b70290705989cb6d9f0b68b83585550af994cf2b/specsim/data/config/desi.yaml#L189 At the moment, this random fiber offset is applied independently at each wavelength. get_focal_plane_optics loops over wavelength, calling get_centroid_offset, eventually calling https://github.com/desihub/specsim/blob/b70290705989cb6d9f0b68b83585550af994cf2b/specsim/instrument.py#L730 and applying a different random offset to each wavelength.

I didn't immediately see a clean API change to fix this. Perhaps get_focal_plane_optics should call get_centroid_offsets out of the loop, and then offset_function should be taught how to broadcast over the wavelength axis. But at the moment I thought I'd just file an issue.

Not clear to me that this has practical impact---it seems to me like the fraction of flux will go something like (offset/FWHM)^2, so roughly 0.25% multiplicative noise at each wavelength?