<p>Also the PetroFit grid is not a PSF grid like the ones provided by STScI. The PetroFit grid is something completely different. It is a lookup table that maps direct measurements like the size of galaxy and its concentration to theoretical parameters such as Sersic index or a better value for <a href="https://petrofit.readthedocs.io/en/latest/introduction.html#Petrosian-Total-Flux-Radius-and-Epsilon" rel="nofollow noreferrer">Petrosian epsilon</a>. This kind of look up table or grid is called the correction grid. The PSF is used in generating the grid because if you want to map real data to theoretical parameters, you need to account for the PSF. As of today, PetroFit takes only one PSF per grid. One could generate individual correction grids for each of the 9 STScI PSFs but that is most probably over kill. I hope this makes sense.</p>

CC BY-SA 4.0
2023-08-27T03:19:26.243Z
2023-08-27T03:19:26.243Z
Skyline
<p>I really don't know PSFEx, so I can't help you there, though I'll note that its &quot;PSF&quot; format seems to be a rather peculiar one mainly designed for use with other SExtractor software, so I wouldn't take it as representative of PSFs in general.</p>
<p>But I have used HST PSFs a fair amount, so: the PSF file format you're referring to is simply a stack of separate PSF images. A PSF is a 2D function, which can be a simple or complex analytical function (e.g., a sum of one or more 2D Gaussians) or -- very often -- a square (2D) image. In the case of the HST WFC3 PSFs you are referring to, the PSF as prepared by STScI is a 25x25-pixel image. Since the actual PSF can vary as a function of position within the camera, people at STScI have prepared individual PSF images for nine sub-regions of the imager (upper-left, upper-middle, upper-right, etc.) and stacked these together into a single 3D FITS file for simplicity of distribution.</p>
<p>Normally, if you want to analyze a particular object in your image, you would extract the individual PSF image corresponding to the subsection of your image that the object is in, and use that PSF image for the analysis.</p>
<p>So, no, you shouldn't sum up the indvidual PSF images along the third axis -- unless what you want is a mean PSF suitable for the entire image (which will be less accurate than the individual subsection PSFs).</p>
<p>It is standard to normalize a PSF so that its individual pixel values all sum to a total of 1, though the convolution software may do this for you. (And for some purposes such as radio astronomy, the PSFs should <em>not</em> be normalized.)</p>

CC BY-SA 4.0
2023-07-12T15:53:43.317Z
2023-07-12T15:53:43.317Z
Peter Erwin
<p>Check the documentation at <a href="https://www.stsci.edu/hst/instrumentation/wfc3/data-analysis/psf" rel="nofollow noreferrer">https://www.stsci.edu/hst/instrumentation/wfc3/data-analysis/psf</a>. According to the description on the page, it could be multiple things: the different focus positions, spatial variations accross the sensor, different sensors.</p>

CC BY-SA 4.0
2023-07-11T17:18:27.023Z
I see. Do you have any insight on PSFEx? Reading the docs (https://psfex.readthedocs.io/_/downloads/en/latest/pdf/) it tells me the first dimension corresponds to basis vectors but not much more. Also, is my understanding correct, with regards to normalization?
cassandra
CC BY-SA 4.0
2023-07-11T15:41:18.167Z
2023-07-11T15:41:18.167Z
Grimaldi
<p>I understand that PSFs are models for spreading of light. When I visit Hubble website (<a href="https://www.stsci.edu/hst/instrumentation/wfc3/data-analysis/psf" rel="nofollow noreferrer">https://www.stsci.edu/hst/instrumentation/wfc3/data-analysis/psf</a>) there is PSF model for me to download. I could also get my own PSF model by running Source Extractor and PSFEx. In both of these cases, I see that the output PSF model is (n, 25, 25) where n is 9 for Hubble and 6 for PSFEx. Looking through the documentations for PSFEx, my understanding is that the first dimension is the basis vector for PSF. So is the &quot;final&quot; PSF that's used for convolving a point source simply the sum along the first axis? (I'm assuming the coefficients for the linear combination is already accounted for)</p>
<p>I was looking at the documentations for Petrofit (<a href="https://petrofit.readthedocs.io/en/latest/correction_grids.html#Correction-Grid" rel="nofollow noreferrer">https://petrofit.readthedocs.io/en/latest/correction_grids.html#Correction-Grid</a>) and I see that the PSF used here is a 2D grid instead of 3D like the ones I get from PSFEx or Hubble's page and hence the confusion.</p>
<p>Edit:
I'm also guessing that I should normalize the (25,25) after summing along the first axis? Or do I have this completely wrong?</p>

<observational-astronomy><photometry><image-processing>
Understanding PSF models and PFSEx output
cassandra
# Understanding PSF models and PFSEx output

(Asked by: username_0 on 2023-07-10)

I understand that PSFs are models for spreading of light. When I visit Hubble website (<https://www.stsci.edu/hst/instrumentation/wfc3/data-analysis/psf>) there is PSF model for me to download. I could also get my own PSF model by running Source Extractor and PSFEx. In both of these cases, I see that the output PSF model is (n, 25, 25) where n is 9 for Hubble and 6 for PSFEx. Looking through the documentations for PSFEx, my understanding is that the first dimension is the basis vector for PSF. So is the "final" PSF that's used for convolving a point source simply the sum along the first axis? (I'm assuming the coefficients for the linear combination is already accounted for)

I was looking at the documentations for Petrofit (<https://petrofit.readthedocs.io/en/latest/correction_grids.html#Correction-Grid>) and I see that the PSF used here is a 2D grid instead of 3D like the ones I get from PSFEx or Hubble's page and hence the confusion.

Edit:
I'm also guessing that I should normalize the (25,25) after summing along the first axis? Or do I have this completely wrong?

**Tags:** observational-astronomy, photometry, image-processing

---

## 3 answers

### Answer by username_1 on 2023-08-27. Score: 3

Also the PetroFit grid is not a PSF grid like the ones provided by STScI. The PetroFit grid is something completely different. It is a lookup table that maps direct measurements like the size of galaxy and its concentration to theoretical parameters such as Sersic index or a better value for [Petrosian epsilon](https://petrofit.readthedocs.io/en/latest/introduction.html#Petrosian-Total-Flux-Radius-and-Epsilon). This kind of look up table or grid is called the correction grid. The PSF is used in generating the grid because if you want to map real data to theoretical parameters, you need to account for the PSF. As of today, PetroFit takes only one PSF per grid. One could generate individual correction grids for each of the 9 STScI PSFs but that is most probably over kill. I hope this makes sense.


---

### Answer by username_2 on 2023-07-12. Score: 1

I really don't know PSFEx, so I can't help you there, though I'll note that its "PSF" format seems to be a rather peculiar one mainly designed for use with other SExtractor software, so I wouldn't take it as representative of PSFs in general.

But I have used HST PSFs a fair amount, so: the PSF file format you're referring to is simply a stack of separate PSF images. A PSF is a 2D function, which can be a simple or complex analytical function (e.g., a sum of one or more 2D Gaussians) or -- very often -- a square (2D) image. In the case of the HST WFC3 PSFs you are referring to, the PSF as prepared by STScI is a 25x25-pixel image. Since the actual PSF can vary as a function of position within the camera, people at STScI have prepared individual PSF images for nine sub-regions of the imager (upper-left, upper-middle, upper-right, etc.) and stacked these together into a single 3D FITS file for simplicity of distribution.

Normally, if you want to analyze a particular object in your image, you would extract the individual PSF image corresponding to the subsection of your image that the object is in, and use that PSF image for the analysis.

So, no, you shouldn't sum up the indvidual PSF images along the third axis -- unless what you want is a mean PSF suitable for the entire image (which will be less accurate than the individual subsection PSFs).

It is standard to normalize a PSF so that its individual pixel values all sum to a total of 1, though the convolution software may do this for you. (And for some purposes such as radio astronomy, the PSFs should *not* be normalized.)


---

### Answer by username_3 on 2023-07-11. Score: 1

Check the documentation at <https://www.stsci.edu/hst/instrumentation/wfc3/data-analysis/psf>. According to the description on the page, it could be multiple things: the different focus positions, spatial variations accross the sensor, different sensors.

> **Comments:**
> **username_0**: I see. Do you have any insight on PSFEx? Reading the docs (https://psfex.readthedocs.io/_/downloads/en/latest/pdf/) it tells me the first dimension corresponds to basis vectors but not much more. Also, is my understanding correct, with regards to normalization?  

---

