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

**URL:** <https://www.rubin.community/t/how-is-the-diasource-snr-computed-and-is-the-field-documentation-incorrect/11151>\
**Category:** Support\
**Created:** [October 24, 2025, 5:01pm UTC](https://www.rubin.community/t/how-is-the-diasource-snr-computed-and-is-the-field-documentation-incorrect/11151 "2025-10-24T17:01:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![deppep](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/deppep/32/3217_2.png) [@deppep](https://www.rubin.community/u/deppep)\
**Post date:** [October 24, 2025, 5:01pm UTC](https://www.rubin.community/t/how-is-the-diasource-snr-computed-and-is-the-field-documentation-incorrect/11151/1 "2025-10-24T17:01:12Z")

</div>

Hello,

The [DP1 schema for the DiaSource table](https://sdm-schemas.lsst.io/dp1.html#DiaSource) 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.

```python
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()

```

 ![image](https://us1.discourse-cdn.com/flex002/uploads/rubin/original/2X/9/9099e0b54f0d627477c70518e290c53270084f31.png)

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

---

<div class="post-metadata">

**Author:** ![ebellm](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/ebellm/32/771_2.png) [@ebellm](https://www.rubin.community/u/ebellm)\
**Post date:** [October 24, 2025, 5:21pm UTC](https://www.rubin.community/t/how-is-the-diasource-snr-computed-and-is-the-field-documentation-incorrect/11151/2 "2025-10-24T17:21:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MelissaGraham](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/melissagraham/32/2549_2.png) [@MelissaGraham](https://www.rubin.community/u/MelissaGraham)\
**Post date:** [October 28, 2025, 5:13pm UTC](https://www.rubin.community/t/how-is-the-diasource-snr-computed-and-is-the-field-documentation-incorrect/11151/3 "2025-10-28T17:13:01Z")

</div>

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.
