desihub / specsim

Quick simulations of spectrograph response
2 stars 9 forks source link

Support parallel simulation of multiple sources #6

Open dkirkby opened 9 years ago

dkirkby commented 9 years ago

Use the power of numpy advanced indexing and broadcasting to allow an arbitrary array of input sources to be simulated in parallel, with minimal changes to the code. This is presumably useful for simulating the observation of an entire field of targets, and eliminates the overhead of looping over each target. The existing mode of simulating a single 1D input SED should still work without any change to user code.

dkirkby commented 7 years ago

Most of the necessary functionality is already included in #53 but we still need an API for the DESI simulation to batch simulate a whole focal plane. The input args would be:

where nwlen1 ~ 11 and nwlen2 ~ 10K specify the wavelength grids used to tabulate fiberloss and input SEDs, respectively.

Additional parameters such as the seeing should be updated via the config, as before.

With this API, the fiberloss arrays can either be provided externally, or else calculated on the fly using the existing fiberloss.GalsimFiberlossCalulator class.