# Adjusting the size of SafeClip masks

**URL:** <https://www.rubin.community/t/adjusting-the-size-of-safeclip-masks/4601>\
**Category:** Support\
**Created:** [December 14, 2020, 8:39pm UTC](https://www.rubin.community/t/adjusting-the-size-of-safeclip-masks/4601 "2020-12-14T20:39:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ih64](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/ih64/32/528_2.png) [@ih64](https://www.rubin.community/u/ih64)\
**Post date:** [December 14, 2020, 8:39pm UTC](https://www.rubin.community/t/adjusting-the-size-of-safeclip-masks/4601/1 "2020-12-14T20:39:30Z")

</div>

Hello all,

We are investigating satellite streak masking, and we would like to tune the width of masks on detected satellite streaks. It looks to be sufficient the way it is set up currently for HSC data, but we are curious about it and would like to tune the masks. It looks like the place to go is the SafeClipAssembleCoadd. Is there a way to access the size of the masks through the SafeClipAssembleCoaddConfig? The parameters I see there are primarily for overlapping sources.

Thank you!

---

<div class="post-metadata">

**Author:** ![price](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/price/32/488_2.png) [@price](https://www.rubin.community/u/price)\
**Post date:** [December 14, 2020, 9:48pm UTC](https://www.rubin.community/t/adjusting-the-size-of-safeclip-masks/4601/2 "2020-12-14T21:48:52Z")

</div>

Try `clipDetection.nSigmaToGrow`.

---

<div class="post-metadata">

**Author:** ![ih64](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/ih64/32/528_2.png) [@ih64](https://www.rubin.community/u/ih64)\
**Post date:** [December 14, 2020, 10:25pm UTC](https://www.rubin.community/t/adjusting-the-size-of-safeclip-masks/4601/3 "2020-12-14T22:25:32Z")

</div>

can do, thank you Paul!

---

<div class="post-metadata">

**Author:** ![ih64](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/ih64/32/528_2.png) [@ih64](https://www.rubin.community/u/ih64)\
**Post date:** [December 16, 2020, 10:37pm UTC](https://www.rubin.community/t/adjusting-the-size-of-safeclip-masks/4601/4 "2020-12-16T22:37:26Z")

</div>

Hi Paul,

Thanks for your reply. I had mixed results using `clipDetection.nSigmaToGrow`. It looks like it is working for the centers of bright sources, but not for the satellite streak. I remade a coadd setting `clipDetection.nSigmaToGrow`. = 1 (the default is 2). the top image is a zoom in of the result. I turned off all the mask planes except for `clipped` and `detected`. The mask for the satellite is the green line at the top of the figure. I also remade the coadd setting `clipDetection.nSigmaToGrow`. = 5, bottom image. The green line grew very moderately, where as the clipped regions in the centers of bright objects have grown as expected. I can’t think of a reason it would work one way for the bright objects and another for the satellite streak.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/rubin/original/2X/9/955bee8756ea59718defd2d78c289bb1d7ecbbfd.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/rubin/original/2X/9/932bf99538021c16ec53af27e85456fcc0647497.jpeg)

---

<div class="post-metadata">

**Author:** ![price](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/price/32/488_2.png) [@price](https://www.rubin.community/u/price)\
**Post date:** [December 18, 2020, 2:08pm UTC](https://www.rubin.community/t/adjusting-the-size-of-safeclip-masks/4601/5 "2020-12-18T14:08:39Z")

</div>

Not sure. Maybe the streak detection code is handling the streak. Is the `STREAK` mask plane set?

---

<div class="post-metadata">

**Author:** ![ih64](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/ih64/32/528_2.png) [@ih64](https://www.rubin.community/u/ih64)\
**Post date:** [December 18, 2020, 9:22pm UTC](https://www.rubin.community/t/adjusting-the-size-of-safeclip-masks/4601/6 "2020-12-18T21:22:39Z")

</div>

Hi Paul,

It doesn’t look like the `STREAK` mask plane is set. I dumped out all the mask plane names and bits and I get:  
BAD 0  
BRIGHT\_OBJECT 9  
CLIPPED 10  
CR 3  
CROSSTALK 11  
DETECTED 5  
DETECTED\_NEGATIVE 6  
EDGE 4  
INEXACT\_PSF 12  
INTRP 2  
NOT\_DEBLENDED 13  
NO\_DATA 8  
REJECTED 14  
SAT 1  
SENSOR\_EDGE 15  
SUSPECT 7  
UNMASKEDNAN 16

I will take a closer look at the `SafeClipAssembleCoaddTask` to see if there are any clues there
