desihub / desisurvey

Code for desi survey planning and implementation
BSD 3-Clause "New" or "Revised" License
2 stars 7 forks source link

Include sky in desisurvey.etc #129

Closed schlafly closed 3 years ago

schlafly commented 3 years ago

This PR moves sky computations into the ETC in preparation for a more detailed sky model. Corresponding changes are necessary to desihub/desisurvey in order to work with this.

The present version only passes the current exposure time scalings for DARK/GRAY/BRIGHT into the sky, so that the survey sims are unchanged, despite the nominal times no longer being scaled by moon up factors.

This PR also implements a change where scheduler.next_tile looks for tiles whose hour angles will match the optimizations at the midpoints of the observations, rather than the beginnings of the observations. This will make a difference ~now for operations on the mountain.

This will break the surveysim tests, since this and the corresponding surveysim PRs depend on one another. I can't remember how we solve that?

dkirkby commented 3 years ago

How are you handling logging for code that runs under ICS? I don't think that is compatible with desiutil.log.

You probably know what I am going to say about the changelog...

schlafly commented 3 years ago

I'll update the changelog. Presently desiutil.log messages end up on some ICS terminal somewhere and are never really seen by anyone. It would be good to improve that, and I'd appreciate advice. But let's not make that part of this PR.

dkirkby commented 3 years ago

Agreed. This is what I use in desietc for ICS-compatible logging:

try:
    import DOSlib.logger as logging
except ImportError:
    # Fallback when we are not running as a DOS application.
    import logging
schlafly commented 3 years ago

Thanks. Do you think I should put something like that in every desisurvey module? Even doing that we would still lose log messages from, e.g., desimodel, which we might like. I could imagine putting something like this in desiutil.log, though it's ugly.

dkirkby commented 3 years ago

There are only a few desietc modules that generate log messages and might be used in ICS, and I don't use any of the offline DESI packages, so I didn't have that problem. It sounds like a solution within desiutil.log would end up the cleanest for NTS.