legacysurvey / legacypipe

Image reduction pipeline for the DESI Legacy Imaging Surveys, using the Tractor framework
BSD 3-Clause "New" or "Revised" License
37 stars 22 forks source link

AIRMASS inaccurate in MzLS file headers and ccd-annotated files #400

Closed djschlegel closed 4 years ago

djschlegel commented 5 years ago

The AIRMASS values in the MzLS files aren’t particularly accurate. 10% of the files have them wrong by more than 0.05. They were less wrong during the first year of the survey, then more wrong after that (see attached plot vs. time).

An extreme example is this file (raw, CP): mosaic/MZLS_Raw/20170613/k4m_170614_043001_ori.fits.fz mosaic/MZLS_CP/CP20170613/k4m_170614_043001_ooi_zd_v1.fits.fz where the header lists AIRMASS=2.676, but the correct value would be 1.053.

I don’t think this matters very much. These airmass values aren’t used in the photometric calibrations (either the PS1 calibrations, or ubercal because Eddie recomputes the correct airmass). But it is used for the CCD_CUTS for deciding if exposures were shallower-than-expected.

Screen Shot 2019-06-06 at 2 34 25 PM
fvaldes commented 5 years ago

The MOSIAC3 KTM uses the post readout telemetry packet for everything (because many things are not known before the readout) except for

RA, DEC, TCPHA, ZD, UTDATE, UT, MSEPEDF, FOCUS

Obviously hindsight tells us AIRMASS should have been in this list.

djschlegel commented 4 years ago

This scatter persists in the AIRMASS listed in the annotated-ccd files (copied over from the CP headers) and truth, with a standard deviation of ~0.05 and outliers that are just way wrong. I'd suggest we just recompute AIRMASS for all of the mosaic exposures in the annotated-ccd file using MJD_OBS + 0.5*EXPTIME/24/3600 as the timestamp. I've made a file with corrected airmass to which compare, using as the KPNO coordinates latitude = 31.9633, longitude = 360. - 111.600 : /global/project/projectdirs/desi/users/djschleg/dr9/ccds-annotated-mosaic-dr9-fixairmass.fits

djschlegel commented 4 years ago

Another detail: For the mosaic exposures, the timestamps in those headers are: DATE-OBS= '2018-02-12T03:12:11.0' / Date of observation start (UTC)
MJD-OBS = 58161.13346065 / MJD of observation start
MJDSTART= 58161.133486467 / MJD of observation start
MJDEND = 58161.135011267 / MJD of observation end

From what I could figure, MJDSTART may be closest to the shutter-open time. DATE-OBS and MJD-OBS have equivalent values in different formats, and are prior to that timestamp by 1.5-2 sec. MJDEND is approximately the shutter-closed time plus the readout time (~30 sec).

moustakas commented 4 years ago

We should just recompute every airmass value for MzLS, as suggested by @djschlegel.

moustakas commented 4 years ago

Code to recompute airmass was implemented in #470, so closing. @mlandriau will need to regenerate all the zeropoint files to incorporate this change into DR9.

djschlegel commented 4 years ago

Let's get these correct values into the ccd files. They're really pretty terribly wrong!