Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new bright time exposure factor #126

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

changhoonhahn
Copy link

I've updated the bright time exposure factor calculation based on SV1 observations. The new exposure factor etc.bright_exposure_factor is calculated using a regression sky brightness model fit to SV1, CMX, and BOSS sky brightness observations. The exposure factor accounts for read noise and assumes a new reference BGS sky (nominal dark sky scaled to r=21.07 + moon/solar spectrum scaled to r=20.07). Below are specific changes to the modules

py/desisurvey/ephem.py

  • sun_ra and sun_dec added to ephem table so that they can be used to calculate twilight contribution to the bright time exposure factor

py/desisurvey/etc.py

  • bright_exposure_factor function calculates the bright time exposure factor based on airmass, moon illumination, moon separation, moon altitude, sun separation, and sun altitude. The exposure factor is how much the bright time exposure has to be scaled to match the SNR of the reference BGS sky (see notebook for new ref. sky). The calculation includes read noise contributions.
  • bright_Isky5000_notwilight_regression function calculates the sky surface brightness without twilight contributions at 5000A using a regression model. This sky model was fit using SV1, CMX, and BOSS observations
  • bright_Isky5000_twilight_regression function calculates the twilight sky contribution at 5000A using a regression model. The twilight contribution was fit using BOSS twilight observations with sun alt > -18.

py/desisurvey/scheduler.py

  • Scheduler.init_night: now initializes moon Alt, Az, sun RA, Dec, Alt, Az in addition moon RA and Dec.
  • Scheduler.next_tile: for BRIGHT program etc.bright_exposure_factor in included in the exposure factor calculation.

py/desisurvey/util.py

  • removed import astropy._erfa.core since it wasn't used and caused import errors.

@schlafly
Copy link
Contributor

Thanks Chang. Some comments:

  • Could we use this for dark and gray time as well, or does it really only work in bright time? It would be better if we didn't have to special case bright time... the sky still has light during gray and dark time. And if we're going to put in a real sky model (which we should, and you've done!), we should use it everywhere.
  • Similarly, it looks like we could use something like bright_exposure_factor for all programs, though presumably in the other programs due to the longer exposure times the read noise is always subdominant?
  • I think the airmass exposure factor should still be included? I think of that as addressing atmospheric extinction and worse seeing at low altitudes, which isn't in your bright_factor?
  • I still would like to see the sky model make its way into surveysim/nightops.py and from there into the ETC, but let's not make that block this PR. e.g., around here: https://github.com/desihub/surveysim/blob/master/py/surveysim/nightops.py#L171

@changhoonhahn
Copy link
Author

  • The sky model in the pull request is fit using primarily gray and bright time sky observations so it can be used for gray time, but shouldn't be used for dark. Since the sky observations are available, I can definitely refit the sky model with dark time observations as well so we can use it for all of the programs.
  • Yes, the read noise would matter less. With that said, I don't think calculation with the read noise only comes in here so it doesn't take significantly longer to compute.
  • I convinced myself I shouldn't include it since the bright exposure factor is based on sky brightnesses at different airmasses, but I think you're right.

@schlafly
Copy link
Contributor

Great, yeah, I imagine the dark / gray time is the easier part of the model. Let's get that in this PR if it sounds feasible?

I agree that the read noise comes in only there. My comment was more to say that that same bright_exposure_factor could be used outside of bright time without doing damage.

And then it would be great to see the results from a surveysim run with these changes; i.e., when the dark / gray / bright surveys get finished.

@changhoonhahn
Copy link
Author

@schlafly Could you check over this pull request again?

Below are the latest changes:

  • I've modified the snr2frac accumulation to use effective sky so that it includes the read noise.
  • I've updated the sky model with the latest fits to SV3 data.
  • sky_level works with surveysim.nightops to calculate the sky level for the get_weather function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants