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

Implement lunar model #9

Closed
dkirkby opened this issue Oct 16, 2015 · 13 comments
Closed

Implement lunar model #9

dkirkby opened this issue Oct 16, 2015 · 13 comments
Assignees
Milestone

Comments

@dkirkby
Copy link
Member

dkirkby commented Oct 16, 2015

The IDL quicksim already has an implementation of Krisciunas & Schaefer (1991) in desimodel/pro/lunarmodel.pro. This issue is to implement the same functionality here as an intermediate (and more urgent) step towards #2.

@dkirkby
Copy link
Member Author

dkirkby commented Feb 21, 2016

@crockosi @sbailey I am working on this now (finally!)

My plan is to:

  • Use the same high-resolution KPNO extinction table for the moon as we use for sources (Duplicate KPNO extinction tables desimodel#8)
  • Update the solar spectrum from Wehrli 1985 to ASTM E-490-00 from 2000. (Although your code describes sky/solarspec.txt as 2000 ASTM, the values are actually from Wehril according to this spreadsheet).
  • Calculate the V-band extinction coefficient directly from the input extinction table and solar spectrum, instead of treating it like a separate parameter. Hopefully this gives the same answer for KPNO but would be useful to allow other extinction tables to be simulated.
  • Add the lunar scattering surface brightness to the dark sky tabulated in spectra/spec-sky.dat.

Any feedback is welcome.

@dkirkby
Copy link
Member Author

dkirkby commented Feb 21, 2016

On the last point above, I implemented the V-band extinction coefficient calculation as:

kV = V* - V

where V is the Bessell V-band magnitude of the un-extincted solar spectrum and V* is calculated with the solar spectrum multiplied by (i.e., airmass 1):

10 ** (-k(lambda) / 2.5)

Using the KPNO zenith extinction table, I calculate kV = 0.1515, compared with the value 0.162 that is hardcoded in lunarmodel.pro. I am calculating kV correctly? Should I worry about the 7% discrepancy between these values?

@dkirkby
Copy link
Member Author

dkirkby commented Feb 22, 2016

I am mostly done with this now. Does this plot of scattered moon V-band surface brightness look reasonable?

lunar

This is for a moon phase of 25% (zero is full) at zenith angle 70 deg. I used kV=0.162 to match the IDL code.

@moustakas
Copy link
Member

What an awesome plot!

@dkirkby
Copy link
Member Author

dkirkby commented Feb 23, 2016

Awesome, but wrong :-( After fixing a little bug, it looks quite different:

lunar

@dkirkby
Copy link
Member Author

dkirkby commented Feb 23, 2016

This plot shows the dark sky (green), scattered moon (blue) and extinction coef (red) for a 25% moon at a zenith angle of 70 deg (same as the plot above):

sky

I am planning to add the green and blue surface brightness values in the simulation, which assumes that our KPNO "dark sky" spectrum has no scattered moonlight. However, I put the moon below the horizon in the default config, so that only the green curve is used (i.e., no change from the current simulations).

@crockosi
Copy link

This is even more awesome! I spot-checked it using the old IDL version of
the code and I get numbers that as as close as I can read off that
colorbar. So this looks great.

Thanks, David. I'll run a bunch of my other tests once this is merged.

--Connie

On Mon, Feb 22, 2016 at 5:32 PM, dkirkby notifications@github.com wrote:

Awesome, but wrong :-( After fixing a little bug, it looks quite different:

[image: lunar]
https://cloud.githubusercontent.com/assets/185007/13238743/132602ce-d98a-11e5-82d4-dd84b257948f.png


Reply to this email directly or view it on GitHub
#9 (comment).

@sbailey
Copy link
Contributor

sbailey commented Feb 23, 2016

Thanks for adding this. I defer to Connie for validating the results, but she sounds happy.

Could you add a code snippet showing how to use this for simulating a series of spectra under different lunar conditions? In particular, if I create an Atmosphere giving it a Moon object, can I then directly call moon.update() to alter how the moon appears to the Atmosphere? Or do I create a new Atmosphere with that updated moon before simulating more spectra?

Please add a docstring for Atmosphere.set_condition(). I think that gets a name from the constructor surface_brightness_dict, but the chain wasn't obvious without reading code. I think these do provide flexible development/testing alternatives to the Moon model, so I think it is worth keeping these two methods for similar functionality.

@dkirkby
Copy link
Member Author

dkirkby commented Feb 24, 2016

@sbailey I made the changes you suggested. In particular, there is now an example of changing moon parameters on the fly in the docs:

http://specsim.readthedocs.org/en/ks_moon/config.html#atmosphere

I also added moon parameters to the quickspecsim command-line script:

% quickspecsim -h
...
  --moon-phase P        moon phase between 0 (full) and 1 (new) (default:
                        None)
  --moon-zenith Z       zenith angle of the moon in degrees (>90 is below the
                        horizon) (default: None)
  --moon-separation S   opening angle between moon and this observation in
                        degrees (default: None)

@djschlegel
Copy link

When one has both moon and clouds, the sky brightness can increase by quite a bit more.
Attached is a plot of the sky brightness with our last night observing with the Mayall on Feb 19.
We were observing 50 deg from a 94% full moon for most of the night, with the moon setting
before the last exposures. Note the (z-band) sky brightness could increase by 1.5 mag from
clouds. The continuum sky brightness would be increasing even more than that.
How should that be incorporated in the models?

screen shot 2016-02-23 at 5 30 19 pm

@dkirkby
Copy link
Member Author

dkirkby commented Feb 24, 2016

For comparison, the moon-only specsim predictions for those conditions are 18.8 mag/arcsec2 in z-band with the moon below the horizon (compared with ~19.0 in your graph, if you used the same units), but the typical increase at 50 deg from a 94% full moon is only ~0.8 mag/arcsec2.

In the limit of single scattering, only the cloud along the boresight should matter. If that's a reasonable approximation, then perhaps thin cloud could be included in the KS1991 model as an additive correction to the extinction.

@moustakas
Copy link
Member

Not sure if this should be a new or separate issue, but @djschlegel has posted some relevant data on the sky brightness as a function of moon angle and moon phase from the SDSS that specsim's model could be compared against. The relevant thread was sent to desi-bgs@ and is archived here:
https://desi.lbl.gov/trac/tracmailman/browser/private/desi-bgs/2016-April/000371.html

This issue is also relevant to the bright-time simulations open issue desihub/desisim#72

@dkirkby
Copy link
Member Author

dkirkby commented Apr 4, 2016

Thanks for flagging this John. I will take a look and then create a new issue.

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

No branches or pull requests

5 participants