Repository navigation
Conversation
b3567db to
261bb0f
Compare
rhiannonlynne
left a comment
There was a problem hiding this comment.
ugh, realized I had some comments that have been stuck forever in pending.
I also realize this is still a draft.
Also, I suppose I don't remember the details here anymore (X-1) vs (X) vs (1-X)..
| # The extinction coefficient is independent of exptime. | ||
| zp_at_X1 = predicted_zeropoint(band, airmass=1.0, exptime=1.0) | ||
| zp_at_X2 = predicted_zeropoint(band, airmass=2.0, exptime=1.0) | ||
| k_predicted = zp_at_X1 - zp_at_X2 # positive extinction coefficient |
There was a problem hiding this comment.
Instead of this, we should just make the extinction coefficients available from the same phot_utils module as predicted_zeropoint.
There was a problem hiding this comment.
It's not the same k value as in predicted_zeropoint, although the absolute value should be the same.
| k_predicted = zp_at_X1 - zp_at_X2 # positive extinction coefficient | ||
|
|
||
| # The fitted zeropoint is the intercept at airmass=0. | ||
| zp_at_X0 = zp_at_X1 + k_predicted |
There was a problem hiding this comment.
Since the fit is to k * (1 - X) ... why do you want the zero point at X=0?
There was a problem hiding this comment.
The fit I am doing is to k*X, not k*(1-x): the independent variable is assigned to airmass, not 1-airmass (here). This is a more useful fit: the zero point set at airmass=0 is independent of anything the atmosphere does, and should be very stable, while if it is at airmass=1, it depends on the atmosphere.
So, for the purpose of understanding whether only the things that should be changing really are, separating the influence of the atmosphere from the influence of the instrument is what we want, so we want the zp to be top of the atmosphere.
Because the X=0 zp is expected to be very stable and probably traceable to events like cleaning the mirrors, there is a second variant of the fit that only fits k, and does not allow the zp to move. If we use zp1, though, it varies with k, and setting the instrumental portion to a constant is not possible without converting it back to zp0.
Note that the zp at airmass=0 form is more traditional as well. Aside from the LSST tech notes, the zp at X=1 form is only used by Pan-STARRS that I can find. Everything else I've been able to find (SDSS, DES, and reference books like Birney's Observational Astronomy, Hiltner's Astronomical Techniques, and Budding's An Introduction to Astronomical Photometry) uses the zp at X=0 form for Bouguer's Law (which is what the variation of m0 with airmass is called, a name I hadn't known before this literature search).
341435c to
16b6bcd
Compare
|
To do:
Plot them all together, look at 'cloud' values over each of the nights to consider: |
b9ec75e to
6c8c6f3
Compare
6c8c6f3 to
fca3940
Compare
Two stackers are added to maf here, intended to be applied to visit sequences from consdb queries rather than opsim output.
The first uses sklearn robust linear fitting tools to fit for photometric extinction and zero point given the the zero_point_median, band, and airmass columns from consdb.
The next uses the results of this and zero_point_median to estimate the extinction from clouds, falling back on rubin_sim.phot_utils.predicted_zeropoint if there was no good fit. It supports an optional offset, so you can (and I probably will) feed in rubin_nights.reference_values.ZEROPOINT_OFFSETS_LSSTCAM, which if I understand what's going on will replicate what rubin_sim_addons does.
This was developed with a mixture of hand-coding and claude code assistance using the experimental support of claude code at the USDF.