desi_zcatalog patch missing sv1 FLUX_IVAR_W1/W2 #1717
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Candidate for including in final fuji redshift catalogs, if we can get review by Monday
~noon Pacific Time; I think this is simple enough to be viable for that (despite the long PR description...)
This PR fixes the missing sv1 FLUX_IVAR_W1/W2 values in the stacked zcatalog files (but not in the fibermap through redrock files; too late for Fuji). These values are missing in fiberassign tiles designed prior to 20201212.
desi_zcatalog --patch-missing-ivar-w12 ...
identifies the rows with missingFLUX_IVAR_W1/W2
values, looks up the original values in the sv1 targeting files (i.e. what would have been propagated if that column had been included by fiberassign at the time), and patches the zcatalog columns before writing out the files.Originally I thought I would use external catalogs curated by @stephjuneau, @Ragadeepika-Pucha, and/or @moustakas (e.g. PR #1716), but the scope of that work is growing beyond simple quick review due to the messiness of secondary targets, and also has the chicken-and-the-egg problem of using the zcatalog files to identify which TARGETIDs to curate, while I want to patch the zcatalog files while making them in the first place. By limiting the scope of this PR to just sv1 FLUX_IVAR_W1/W2, the target lookup problem becomes much simpler.
Impacted catalogs in fuji/zcatalog (see code snippet below):
zpix-sv1-[dark,bright].fits
ztile-sv1-[dark,bright]-*.fits
ztile-[1x_depth,4x_depth,lowspeed].fits
zpix-cmx-other.fits
ztile-cmx-other-*.fits
Thankfully it did not impact sv1-other or sv1-backup tiles, or anything post-sv1, thus simplifying the target lookup.
The code looks in
$DESI_TARGET/catalogs/dr9/*/targets/sv1/resolve/*/sv1targets-*-hp-{hpix}.fits
where the first*
in the glob is a desitarget version number (different tiles were designed with different desitarget) and the second*
is for dark vs. bright. It's a small enough number of files that I didn't try to optimize which to read. If a TARGETID appears in more than one file that's fine, since they all derive from dr9 tractor photometry and have the same FLUX_IVAR_W1/W2 values (i.e. although the desitarget version could impact whether the target was selected, it doesn't impact what the WISE photometry is).Test files
Example output files are in /global/cfs/cdirs/desi/users/sjbailey/dev/fuji/zcat; exact commands below:
*-sv1-bright*.fits
*-sv1-dark*.fits
ztile-1x_depth.fits
ztile-cmx-other-cumulative.fits
Full disclosure: I haven't fully checked these myself, so I would appreciate an independent check with fresh eyes on this, e.g. by comparing to original targets yourself, or to one of the catalogs from @stephjuneau / @Ragadeepika-Pucha / @moustakas . Mentioning other candidate reviewers @geordie666 @schlafly @djschlegel @dstndstn @araichoor @akremin .
Code for identifying catalogs with missing FLUX_IVAR_W1/W2
Commands run for test files