# How to compute PSF Image/kernel Image without background noise

**URL:** <https://www.rubin.community/t/how-to-compute-psf-image-kernel-image-without-background-noise/1713>\
**Category:** Data Management\
**Tags:** psf, cfht, stack\
**Created:** [March 13, 2017, 1:51pm UTC](https://www.rubin.community/t/how-to-compute-psf-image-kernel-image-without-background-noise/1713 "2017-03-13T13:51:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daraexus](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/daraexus/32/827_2.png) [@Daraexus](https://www.rubin.community/u/Daraexus)\
**Post date:** [March 13, 2017, 1:51pm UTC](https://www.rubin.community/t/how-to-compute-psf-image-kernel-image-without-background-noise/1713/1 "2017-03-13T13:51:24Z")

</div>

Hi

I’m trying to compute the local PSF of a calexp in order to perform a quick-and-dirty injection of transients. However, whenever I try to use the methods computeKernelImage() and computeImage(), I obtain the shape of the PSF with background noise. Is there a way to remove the noise from the image?

This is the typical result I get from using the methods. I’m working on CFHT calexps.

 ![](https://us1.discourse-cdn.com/flex002/uploads/rubin/original/1X/625e0a9108d89ed9b36ca4de08e77313a7538876.png)

---

<div class="post-metadata">

**Author:** ![RHL](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/rhl/32/25_2.png) [@RHL](https://www.rubin.community/u/RHL)\
**Post date:** [March 13, 2017, 5:27pm UTC](https://www.rubin.community/t/how-to-compute-psf-image-kernel-image-without-background-noise/1713/2 "2017-03-13T17:27:04Z")

</div>

I don’t understand what you’re looking for. That’s a pixel-based PSF model, and there is no way to remove the noise. Are you looking for a model fit – it’ll have noise too, but you may not notice!

@jbosch has some code somewhere to do a shapelet fit to the PSF model (we use it in the cmodel code); would that help?

---

<div class="post-metadata">

**Author:** ![Daraexus](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/daraexus/32/827_2.png) [@Daraexus](https://www.rubin.community/u/Daraexus)\
**Post date:** [March 13, 2017, 5:46pm UTC](https://www.rubin.community/t/how-to-compute-psf-image-kernel-image-without-background-noise/1713/3 "2017-03-13T17:46:38Z")

</div>

That could help. I decided to use the Quadrupole parameters to create a gaussian approximation based on the psf parameters… but that could also help as well.
