desihub / specex

DESI spectrograph PSF fitting
BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

Timeout #34

Closed julienguy closed 3 years ago

julienguy commented 3 years ago

Add a timeout option to specex_desi_main (and the program desi_psf_fit).

If set, the main function will throw a std::runtime_error exception if the fit exceeds this value. The value is defined in seconds.

Example

desi_psf_fit -a /project/projectdirs/desi/spectro/redux/jguy/preproc/20201114/00062809/preproc-r0-00062809.fits --in-psf /project/projectdirs/desi/spectro/redux/jguy/exposures/20201114/00062809/fit-psf-r0-00062809.fits --first-bundle 0 --last-bundle 0 --out-psf psf-r0-0.fits --timeout 5

...

ERROR timeout, fit exceeds 5 seconds
terminate called after throwing an instance of 'std::runtime_error'
  what():  Timeout
Aborted (core dumped)