sp_validation.assembly.photopipe_merge

Give every shape object its PhotoPipe row: the PhotoPipe extension of the v2 collection.

The inputs are the collection’s shapes, COLLECTION/shapes (sp_validation.assembly.object_id), and the column extract written by scripts/assembly/extract_photopipe.py. The output, COLLECTION/photopipe/photopipe, is a HATS catalogue with one row for each shape row, holding _healpix_29, OBJECT_ID, the shape coordinates and every PhotoPipe column, with its provenance beside it in COLLECTION/photopipe. It is the data of the collection’s photopipe extension, joined to the shapes on OBJECT_ID; a PhotoPipe rerun replaces it and leaves the shapes alone. Each pixel file holds the rows of the shape file in the same order, so a reader finds a row at the same position (sp_validation.tables.JoinedFile) instead of joining on the key: an optimisation of the write, not a contract the reader relies on.

PhotoPipe columns are null where PHOTOPIPE_STATUS is not MATCHED. SeqNr becomes PHOTOPIPE_SEQNR, and a PhotoPipe column whose name the shapes already use takes the prefix PHOTOPIPE_ (MAG_AUTO, MAGERR_AUTO, FLUX_RADIUS), so the two catalogues’ column names are disjoint apart from the keys.

Both catalogues number objects with Stephen Gwyn’s DR6 IDs, so the join is exact on (tile, NUMBER = SeqNr). Position plays no part in it: MATCH_SEP_ARCSEC records the separation of each joined pair, and per-tile counts of pairs beyond SANITY_RADIUS_ARCSEC expose a tile whose IDs disagree.

KEYS = ['_healpix_29', 'OBJECT_ID', 'XWIN_WORLD', 'YWIN_WORLD']

the keys, in hats-import’s order.

Type:

The shape columns the extension carries

DICTIONARY_FRACTION = 0.01

A float column with at most this fraction of distinct values is stored as a dictionary (magnitude sentinels, gridded redshifts), any other as split bytes.

tile_name(tile_id)[source]

Return the tile string of a shape catalogue’s numeric TILE_ID.

load_extract(extract)[source]

Index the extract by tile: shard path, row group and provenance.

_photopipe_schema(index)[source]
_separation_arcsec(ra, dec, other_ra, other_dec)[source]
_encodings(table)[source]

Return the pq.write_table encodings of a pixel table: delta for the integer keys, split bytes for float columns with many distinct values, a dictionary for everything else.

merge_pixel(shape_path, output_path, index, schema)[source]

Write the matched table of one pixel and return per-tile match counts.

_write_hats_metadata(shapes, catalogue, schema, nrows)[source]
_commit()[source]
_write_provenance(output, shapes, extract, index, counts)[source]
_merge_worker(arguments)[source]
merge(collection, extract, workers=1)[source]

Write COLLECTION/photopipe: the catalogue photopipe and its provenance.