How is the DiaSource snr computed and is the field documentation incorrect?

Hello,

The DP1 schema for the DiaSource table describes the snr field as the “ratio of apFlux/apFluxErr”.
However, this quantity appears to be sensibly different. Actually, the snr is more similiar to the ratio of psfFlux/psfFluxErr, yet not identical still. Here’s a MRE, which results in the plot just below.

from lsst.rsp import get_tap_service
import matplotlib.pyplot as plt

service = get_tap_service("tap")
results = service.search("SELECT * FROM dp1.DiaSource WHERE visit=2024120900334")
df = results.to_table().to_pandas()

plt.plot([0, df["snr"].max()], [0, df["snr"].max()], ls="dashed", c="lightgrey", zorder=-1, label="identity")
plt.scatter(df["snr"], df["psfFlux"] / df["psfFluxErr"], label="psfFlux", s=5)
plt.scatter(df["snr"], df["apFlux"] / df["apFluxErr"], label="apFlux", s=5)
plt.xlabel("snr"); plt.ylabel("flux-err ratio"); 
plt.legend()
plt.show()

How is the SNR computed in the DiaSource table? Is the description of the snr field wrong?
Thank you.

Hi @deppep, good catch–the description in the schema is incorrect. The snr field is the signal-to-noise ratio at which this source was detected in the difference image. The snr of detection will generally be similar to but not identical to the snr derived from aperture or PSF measurements.

1 Like

An internal ticket for Rubin staff to update the description has gone in, and I’ve marked Eric’s response as the solution to this topic. Thanks for discovering and posting this issue, @deppep.