desihub / specsim

Quick simulations of spectrograph response
2 stars 9 forks source link

Fast fiber acceptance #78

Closed julienguy closed 7 years ago

julienguy commented 7 years ago

Implementation of a fast fiber acceptance computation trained on galsim.

This approach permits to use all of the throughput correlations introduced by plate scale, telescope PSF, seeing , chromatic aberrations, correlated fiber positioning errors developed in specsim while minimizing the computation time and removing the galsim dependency. It is accurate at the percent level which largely sufficient.

As a example, the following image shows the variation of throughput for stars, at 4000A and 9000A, for a seeing of 1.1 arcsec. The patches are due to the correlated fiber offsets, while the radial effect is a combination of plate scale variation and chromatic aberrations. Interestingly, for a seeing of 2 arcsec, all variations due to fiber offsets are washed out and we are left with the plate scale variation. star_qso_4000a_1 1arcsec star_qso_9000a_1 1arcsec

julienguy commented 7 years ago

More work needed for the script fitgalsim (I am replacing the Monte Carlo by a fixed grid of sigma offset which requires a bit of reverse engineering). So, please wait before pushing this PR once the installation issues are solved.

dkirkby commented 7 years ago

Travis tests are all passing now.

dkirkby commented 7 years ago

Some suggestions before we merge this PR:

  1. Document the new fitgalsim script and fastfiberacceptance module in docs/fiberloss.rst. You can see the current (automatically built) version here.

  2. Add some unit tests of the new functionality. Since fitgalsim requires GalSim, it cannot be run by travis, but we could test specsim.fiberacceptance using the test.yaml config with a small output from fitgalsim saved in specsim/data/test/.

julienguy commented 7 years ago

Results based on new method to get the galsim fiber acceptance as a function of sigma and offset. I noted that adding a source axis ratio of 0.7 didn't change much the results. For me, the PR is ready to merge. fast-fiber-acceptance fiber-acceptance-vs-sigma fiber-acceptance-vs-offset

moustakas commented 7 years ago

This looks awesome but what about BGS targets, where the aperture effects are equally important?

julienguy commented 7 years ago

This discussion should go in the desisim PR :-) https://github.com/desihub/desisim/pull/261 The BGS target profile properties (half light radius, fraction of disk and bulge) have to be defined in desisim/simexp.py in routine simulate_spectra which uses the fibermap info to decide on the source profile. For the moment I used the same parameters as for LRGs, but you are welcome to tune this.

dkirkby commented 7 years ago

Everything looks good here, thanks!

Two questions:

sbailey commented 7 years ago
  • Are we (@sbailey) comfortable changing the default behavior (in desi.yaml) to "fastsim", effectively deprecating the original fiberloss-xxx.dat tables in desimodel?

Yes. This is more accurate than the previous tables without requiring heavyweight dependencies.

  • What is the minimum tag of desimodel required to use the "fastsim" mode? (i.e., containing throughput/galsim-fiber-acceptance.fits)

0.9.0