Skip to content

Commit

Permalink
Add a max exposure time config variable depending on conditions. Pres…
Browse files Browse the repository at this point in the history
…ently only NTS respects this; not passed to surveysim.
  • Loading branch information
schlafly committed Feb 2, 2021
1 parent 22611d8 commit ad38823
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions py/desisurvey/NTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,16 @@ def next_tile(self, conditions=None, exposure=None, constraints=None,
s2n = 50.0 * texp_remaining/texp_tot
exptime = texp_remaining
maxtime = self.ETC.MAX_EXPTIME
maxtimecond = getattr(self.config, 'maximum_time_in_conditions',
None)
if maxtimecond is not None:
maxtimecond = getattr(maxtimecond, sched_program, None)
if maxtimecond is not None:
maxtimecond = maxtimecond().to(u.day).value
if maxtimecond is None:
maxtimecond = np.inf
maxtime = np.min([maxtime, maxtimecond])

days_to_seconds = 60*60*24
fivemin = 5/60/24 # 5 minutes... pretty arbitrary.
if ((mjd <= self.scheduler.night_ephem['dusk']-fivemin) or
Expand Down

0 comments on commit ad38823

Please sign in to comment.