You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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.
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:
The text was updated successfully, but these errors were encountered: