# Sky Sources Added to Single Frame Processing

**URL:** <https://www.rubin.community/t/sky-sources-added-to-single-frame-processing/4137>\
**Category:** DM Notifications\
**Tags:** dm-dev\
**Created:** [May 7, 2020, 8:09pm UTC](https://www.rubin.community/t/sky-sources-added-to-single-frame-processing/4137 "2020-05-07T20:09:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lskelvin](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/lskelvin/32/2537_2.png) [@lskelvin](https://www.rubin.community/u/lskelvin)\
**Post date:** [May 7, 2020, 8:09pm UTC](https://www.rubin.community/t/sky-sources-added-to-single-frame-processing/4137/1 "2020-05-07T20:09:22Z")

</div>

Sky objects are pseudo-objects injected into the data processing pipeline using the [SkyObjectsTask](https://github.com/lsst/meas_algorithms/blob/master/python/lsst/meas/algorithms/skyObjects.py). Using coadded imaging, a number of randomly located sky objects per patch are placed such that their footprints do not overlap with any other detected object footprint. The maximum number of placed sky objects is currently set to 100 per patch, whilst the apparent size of each is currently set to an 8 pixel radius. These parameters are configurable using the `nSources` and `sourceRadius` configuration parameters, respectively.

Sky objects provide valuable QA data, allowing us to generate relevant sky statistics for subsequent analysis. Sky objects are generated on coadded imaging, and no equivalent has previously existed for single frame (visit-level) imaging. Following standard naming conventions, objects are detections on combined coadded imaging, whilst sources are detections at the single frame visit level.

Ticket [DM-23078](https://jira.lsstcorp.org/browse/DM-23078) now adds _sky sources_ to visit-level single frame processed imaging. Sky sources are implemented in exactly the same manner as sky objects, with up to `nSources` sky sources randomly placed for any given CCD. They may be selected (and excluded) from output catalogues using the `sky_source` flag.

An example image for Visit 1228 (HSC-I), CCD 42 is shown below. All detected sources are identified by small blue circles, whilst placed sky sources are represented by large orange circles. Note, the size of the circles are not to scale with the underlying sources. The underlying image is a calexp image, linearly scaled, and binned into 16x16 super-pixel blocks.

 ![v0001228-I](https://us1.discourse-cdn.com/flex002/uploads/rubin/original/2X/b/b5529aab07854f19466b6d93ea51346c4f13574c.png)

---

<div class="post-metadata">

**Author:** ![jbosch](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/jbosch/32/12_2.png) [@jbosch](https://www.rubin.community/u/jbosch)\
**Post date:** [July 17, 2020, 2:51pm UTC](https://www.rubin.community/t/sky-sources-added-to-single-frame-processing/4137/2 "2020-07-17T14:51:40Z")

</div>

For posterity, since I just looked this up: if you want to _avoid_ these rows in code that looks at sources, filter out rows with the `sky_source` flag field set to `True` (in `src`, `sourceTable`, and `sourceTable_visit`).

---

<div class="post-metadata">

**Author:** ![lskelvin](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/lskelvin/32/2537_2.png) [@lskelvin](https://www.rubin.community/u/lskelvin)\
**Post date:** [July 17, 2020, 7:04pm UTC](https://www.rubin.community/t/sky-sources-added-to-single-frame-processing/4137/3 "2020-07-17T19:04:57Z")

</div>

Thanks for that Jim, and just to add, you’ll also soon be able to select primary sources (i.e., sources that are not a parent undeblended source and not a sky source) by selecting only those rows where the new `detect_isPrimary` flag is set to `True` (implemented in [DM-25782](https://jira.lsstcorp.org/browse/DM-25782)).

---

<div class="post-metadata">

**Author:** ![ctslater](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/ctslater/32/28_2.png) [@ctslater](https://www.rubin.community/u/ctslater)\
**Post date:** [July 20, 2020, 5:24pm UTC](https://www.rubin.community/t/sky-sources-added-to-single-frame-processing/4137/4 "2020-07-20T17:24:25Z")

</div>

Just to double check the wording a bit, requiring `detect_isPrimary==True` is useful for excluding sky sources and sources where `deblend_nChild > 0`. `deblend_nChild==0` are the sources you want to keep, right?

---

<div class="post-metadata">

**Author:** ![lskelvin](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/lskelvin/32/2537_2.png) [@lskelvin](https://www.rubin.community/u/lskelvin)\
**Post date:** [July 20, 2020, 5:46pm UTC](https://www.rubin.community/t/sky-sources-added-to-single-frame-processing/4137/5 "2020-07-20T17:46:53Z")

</div>

Thanks for the clarification Colin, I’ve updated my comment above to make this clearer.
