Dynamic Loading for daily Reductions
Daily Database Loading Requirements
The
tiles-dailyfile should have some indications of which tiles need to be added, updated or deleted, i.e.INSERT,UPDATE,DELETE. Hopefully deletes will be rare.The tiles-daily file is only appended-to, old entries are not necessarily updated. See desihub/desispec#2251 for more details.
There are many other potential issues with the desi_tsnr_afterburner script. The issue linked above has details.
Load redshifts from redrock files in
tiles/cumulative, rather than from thezcatalogsummary files. HEALPix redshifts are not and probably never will be generated in daily reductions.Compute target and photometry data based on the objects being loaded rather than reading all at once. See further discussion below.
For further discussion see #13.
Possible Load Scenario
For individual tiles
Read
tiles-daily, find changes. Updatedaily.tile.Find corresponding exposures. Update
daily.exposure,daily.frame.Find any new fiberassign files and obtain the list of new potentials (because potentials include observed targets).
Obtain the targeting and tractor data for new potentials. Update
daily.photometryanddaily.target. Take care to check for existing entries.Make sure to perform the equivalent of the
targetphotstage, i.e. fill in photometric data from targeting data.Update
daily.fiberassign,daily.potential.Read corresponding
tiles/cumulativeredshift files. Updatedaily.ztile.
For initial load
Load the exposures and tiles files.
Compute “monolithic” redshift catalogs. These are needed as input to photometry.
Create “monolithic” photometry and target catalogs.
The load procedure then resembles loading a static specprod, just without healpix redshifts.
Update the “primary” columns and any q3c indexes.
Automated Extraction of Targeting and Photometry
targetphot_onetile()in mpi-photometry appears to work for both targeted and potential objects.tractorphot_onebrick()is similar.Both are thin wrappers on
desispec.io.photo.gather_(tractor|target)phot().But the
gatherfunctions don’t necessarily addDESINAMEor fixNaNvalues forPMRAorPMDEC. Make sure inputs and outputs match.In the database,
desinameis attached to the redshift tables, not the photometry or target tables. So it should be added at that stage, presumably.
Other Notes
Plan for how to support fuji+guadalupe combined analysis. May need to look into cross-schema views, or daughter tables that inherit from both schemas.
Anticipate loading afterburners and VACs into the database.
How do q3c indexes work with dynamic loading?