desihub / desispec

DESI spectral pipeline
BSD 3-Clause "New" or "Revised" License
36 stars 24 forks source link

zpix and Healpix pixel #1394

Open AlexGKim opened 3 years ago

AlexGKim commented 3 years ago

My understanding is that the spectra are grouped by healpix pixels. There is no column for the HEALPix label.

The same object can have different targetid's for different PROGRAMs. These can be associated by their RA and Dec, but it seems that the Healpix is the safer and more "correct" way to do this.

sbailey commented 3 years ago

IIUC, secondary programs can opt to have a different TARGETID assigned instead of matching to the primary DESI TARGETID, but otherwise within the main DESI programs the same object gets the same TARGETID regardless of whether it was selected as a dark or bright or both target. I think the intended use case for this is something like a transient where you purposefully don't want it to be matched to the nearby host galaxy. @geordie666 can clarify any details.

However, I'm not understanding the healpix suggestion. Our default healpix grouping is nested nside=64 (~0.84 sq deg) so many TARGETIDs share the same healpix and it can't be used as a way to resolve which different TARGETIDs might actually be the same location. Please clarify.

AlexGKim commented 3 years ago

Maybe the real question is whether the same healpix pixelization is used for all fits files? If not, then you can ignore my comment. If there is a common healpix pixelization, I am suggesting that there be a column specifying which pixel it belongs to. Then one can create a global healpix grouped map out of all the programs and runs.

sbailey commented 3 years ago

@AlexGKim thanks for the clarification. The spectro pipeline uses nested nside=64 throughout a production, though some upstream files like targeting catalogs use a different nside. This info is in the healpix based coadd- and spectra- files HDU 0 keyword HPXPIXEL=64, but that is not propagated into the redshift catalogs. I've added this to issue #1384 which is tracking other missing useful metadata columns for tracing catalog entries back to original spectra.

In the meantime, hpix = desimodel.footprint.radec2pix(64, TARGET_RA, TARGET_DEC) gives you the healpixel number used throughout Everest (and in the future, Fuji+).

Caveat: although Fuji/SVDA will use nside=64 (same as Everest), it is possible that some future production will use a different nside. We won't arbitrarily change it, but we also don't promise to use nside=64 forever (e.g. if the number of files vs. filesize/memory-needed turns out to be unwieldy).

AlexGKim commented 3 years ago

The method radec2pix is indeed a solution to my issue. Thanks.