Given a two-dimensional image $D$ of a single astronomical source, define

$$\textrm{PHOTAPER} = \sum_{\forall ij} (K_{source,ij} - \frac{S}{Z} K_{zerolevel,ij}) d_{ij}$$

where

  • $K_{source,ij}$ is a kernel having a value of 1 for a pixel that is part of the source and 0 elsewhere
  • $K_{zerolevel,ij}$ is a kernel having a value of 1 for a pixel that is part of the zerolevel and 0 elsewhere
  • $S = \sum_{\forall ij} K_{source,ij}$ is the surface area of the source, in pixels
  • $Z = \sum_{\forall ij} K_{zerolevel,ij}$ is the surface area of the zerolevel, in pixels
In [1]:
%matplotlib notebook

from photapermap import *

# photapermap.fits is the result of convolving OMEGACAM.2013-02-17T08:22:52.234_6.fits with a "PHOTAPER" kernel
p=fits.open('photapermap.fits')[0].data
In [2]:
figure('Kernels', figsize=(9,5))
subplot(1,2,1)
imshow(Ksource); title('$K_{source}$')
subplot(1,2,2)
imshow(Kzerolevel); title('$K_{zerolevel}$')
Out[2]:
Text(0.5, 1.0, '$K_{zerolevel}$')
In [3]:
figure('PHOTAPERMAP',figsize=(9,9))
subplot(1,2,1)
imshow(p,vmin=nanpercentile(p,3),vmax=nanpercentile(p,95))

q=p.copy()
q[q>nanpercentile(q,95)]=nan
q[q<nanpercentile(q,5)]=nan
subplot(1,2,2)
imshow(q);
/opt/awex/conda/envs/astro-zzp/lib/python3.6/site-packages/ipykernel_launcher.py:7: RuntimeWarning: invalid value encountered in less
  import sys
In [4]:
figure('PHOTAPER', figsize=(9,12))
subplot(2,1,1); title('PHOTAPER')
pmin,pmax=percentile(p,[5,98])
hist(p.flatten(),bins=100,range=(pmin,pmax))
subplot(2,1,2); title(r'$\frac{PHOTAPER}{S}$, i.e. PHOTAPER per pixel')
hist(p.flatten()/S,bins=100,range=(pmin/S,pmax/S));