## GNU Astronomy Utilities

Next: , Previous: , Up: Building the extended PSF   [Contents][Index]

#### 2.3.5 Inner part of the PSF

In Building outer part of PSF, we were able to create a stack of the outer-most behavior of the PSF in a J-PLUS survey image. But the central part that was affected by saturation and non-linearity is still remaining, and we still do not have a “complete” PSF! In this section, we will use the same steps before to make stacks of more inner regions of the PSF to ultimately unite them all into a single PSF in Uniting the different PSF components.

For the outer PSF, we selected stars in the magnitude range of 6 to 10. So let’s have a look and see how many stars we have in the magnitude range of 12 to 13 with a more relaxed condition on the minimum distance for neighbors, --mindistdeg=0.01 (36 arcsec, since these stars are fainter), and use the ds9 region script to visually inspect them:

```\$ mkdir inner
\$ astscript-psf-select-stars flat/67510.fits \
--magnituderange=12,13 --mindistdeg=0.01 \
--output=inner/67510-12-13.fits

\$ astscript-ds9-region inner/67510-12-13.fits -cra,dec \
--namecol=phot_g_mean_mag \
--command="ds9 flat/67510.fits -zoom to fit -zscale"
```

We have 41 stars, but if you zoom into their centers, you will see that they do not have any major bleeding-vertical saturation any more. Only the very central core of some of the stars is saturated. We can therefore use these stars to fill the strong bleeding footprints that were present in the outer stack of outer/stack.fits. Similar to before, let’s build ready-to-stack crops of these stars. To get a better feeling of the normalization radii, follow the same steps of Building outer part of PSF (setting --tmpdir and --keeptmp). In this case, since the stars are fainter, we can set a smaller size for the individual stamps, --widthinpix=500,500, to speed up the calculations:

```\$ counter=1
\$ mkdir inner/stamps
\$ asttable inner/67510-12-13.fits \
| while read -r ra dec mag; do
astscript-psf-stamp label/67510-seg.fits \
--mode=wcs \
--center=\$ra,\$dec \
--widthinpix=500,500 \
--segment=label/67510-seg.fits \
--output=inner/stamps/67510-\$counter.fits; \
counter=\$((counter+1)); \
done

\$ imgs=inner/stamps/*.fits
\$ numimgs=\$(echo \$imgs | wc -w)
\$ astarithmetic \$imgs \$numimgs 3 0.2 sigclip-mean -g1 \
--output=inner/stack.fits --wcsfile=none
\$ astscript-fits-view inner/stack.fits inner/stamps/*.fits
```

We are now ready to unite the two stacks we have constructed: the outer and the inner parts.

Next: Uniting the different PSF components, Previous: Building outer part of PSF, Up: Building the extended PSF   [Contents][Index]