merge_similar_lines(table, *, z_pix_threshold=5)¶
Merge and flag possibily duplicated lines.
Some ORIGIN tables associate several identical lines at different positions to the same object (same ID). Lines are considered as duplicated if they are withing the given threshold in the spectral (z) axis.
We mark the duplicated lines as merged into the line of highest flux and we flag the object as having duplicated lines in the table, as the information may not be reliable.
- table: astropy.table.Table
A table of lines from ORIGIN. The table must contain the columns: ID, z, num_line, and purity.
- z_pix_threshold: int
Pixel threshold on the spectral axis. When two lines are nearer than this threshold, they are considered as the same line. Note that the association percolates and may associated lines further than the threshold.
Table with the same rows and with the supplementary merged_in and line_merged_flag columns.