Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Units of aperture photometry output table #1403

Open
hcferguson opened this issue Aug 21, 2022 · 2 comments
Open

Units of aperture photometry output table #1403

hcferguson opened this issue Aug 21, 2022 · 2 comments

Comments

@hcferguson
Copy link

I expected that aperture_photometry -- when fed data in units of MJy/sr and aperture radii in arc seconds -- would output in some units that integrate over area. Instead, the output is in MJy/sr.

In my case I fed it an NDData array drawn from a JWST level 3 data file:

hdu=fits.open('/Volumes/CEERS/ceers/CEERSJune2022/v0.07/ceers_nircam1_f200w_v0.07_i2d.fits')
flux_unit = u.Unit(hdu[1].header['BUNIT'])
data = NDData(hdu[1].data*flux_unit,StdDevUncertainty(hdu[2].data*flux_unit),wcs=wcs)

phot_table = aperture_photometry(data,aperturelist[0])

print(phot_table)

id      xcenter            ycenter            sky_center          aperture_sum     aperture_sum_err 
           pix                pix               deg,deg              MJy / sr           MJy / sr     
--- ------------------ ------------------ -------------------- ------------------- ------------------
  1 399.90599357353494 3526.4940214727003 214.943153,52.942449 0.01577787901579053 0.1537752456576211

@larrybradley
Copy link
Member

larrybradley commented Sep 9, 2022

As you noticed, aperture_photometry simply returns the aperture_sum as the sum of the (weighted) pixel values within the aperture. I'll consider this a feature request to handle images in surface brightness units. The tricky part here is that I don't know of a good (non-hacky) way to automatically determine if the input data are in units of SB. This feature may need a new keyword flag to turn on this mode.

EDIT: This feature would only work for non-geometrically distorted data.

@larrybradley
Copy link
Member

larrybradley commented Sep 9, 2022

I'm sure you know this, but you can simply multiply the data by the pixel area before inputing it into aperture_photometry. That's what I do in practice.

Given the wcs object, you can use this to get the pixel area:
wcs.proj_plane_pixel_area().to(u.steradian)

or for JWST i2d data, get the value of the 'PIXAR_SR' header value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants