Extended Aperture Photometry#

Use case: Measure galaxy photometry in a field. Related to JDox Science Use Case #22.
Data: WST simulated NIRCam images from JADES JWST GTO extragalactic blank field.
(Williams et al. 2018) https://ui.adsabs.harvard.edu/abs/2018ApJS..236…33W.
Tools: photutils, matplotlib, scipy, scikit.
Cross-intrument: potentially MIRI.
Documentation: This notebook is part of a STScI’s larger post-pipeline Data Analysis Tools Ecosystem.

Introduction#

This notebook uses photutils to detect objects/galaxies in NIRCam deep imaging. Detections are first made in a F200W image, then isophotal photometry is obtained in all 9 filters (F090W, F115W, F150W, F200W, F277W, F335M, F356W, F410M, F444W). The catalog is loaded back in and some simple analysis is performed on the full catalog and on an individual galaxy.

The notebook analyzes only the central 1000 x 1000 pixels (30” x 30”) of the full JADES simulation. These cutouts have been staged at STScI with permission from the authors (Williams et al.).

NOTE: The photometry is aperture matched, but no PSF corrections are made. For more accurate color measurements, PSF corrections should be implemented, given the large range of wavelengths (and thus PSF FWHM) spanning a factor of >4.

NOTE: The simulated JADES images have different units (e-/s) than JWST pipeline products (MJy/sr).

NOTE: An exposure map is missing but required to calculate flux uncertainties.

To Do#

  • PSF corrections

  • Check accuracy of photometry against simulated JADES catalog

  • Exposure map required for input to error calculation

  • ABmag units cannot be written to ecsv file (astropy update coming soon)

  • plot with text labels looks horrible (I wish cursor hover would show id number instead)

  • Fix plot secondary axis: mag vs. flux

  • requirements.txt file – but I don’t know what versions are “required”

  • rest of Robel’s comments: https://github.com/spacetelescope/dat_pyinthesky/pull/82#pullrequestreview-355206337

Download WEBBPSF Data#

import os
import tarfile
import urllib.request

boxlink = 'https://stsci.box.com/shared/static/34o0keicz2iujyilg4uz617va46ks6u9.gz'                                                           
boxfile = './webbpsf-data/webbpsf-data-1.0.0.tar.gz'

webbpsf_folder = './webbpsf-data'

# Check whether the specified path exists or not
isExist = os.path.exists(webbpsf_folder)
if not isExist:
  # Create a new directory because it does not exist 
  os.makedirs(webbpsf_folder)
    
urllib.request.urlretrieve(boxlink, boxfile)
gzf = tarfile.open(boxfile)
gzf.extractall(webbpsf_folder)

Import packages#

import os

import numpy as np

from astropy.convolution import convolve
from astropy.io import fits
from astropy.stats import gaussian_fwhm_to_sigma
from astropy.table import QTable
import astropy.units as u
from astropy.visualization import make_lupton_rgb, SqrtStretch, ImageNormalize, simple_norm
import astropy.wcs as wcs

from photutils.background import Background2D, MedianBackground
from photutils.segmentation import (detect_sources, deblend_sources, SourceCatalog,
                                    make_2dgaussian_kernel, SegmentationImage)
from photutils.utils import calc_total_error

Matplotlib setup for plotting#

There are two versions

  • notebook – gives interactive plots, but makes the overall notebook a bit harder to scroll

  • inline – gives non-interactive plots for better overall scrolling

import matplotlib.pyplot as plt
import matplotlib as mpl

# Use this version for non-interactive plots (easier scrolling of the notebook)
%matplotlib inline

# Use this version if you want interactive plots
# %matplotlib notebook

# These gymnastics are needed to make the sizes of the figures
# be the same in both the inline and notebook versions
%config InlineBackend.print_figure_kwargs = {'bbox_inches': None}

mpl.rcParams['savefig.dpi'] = 80
mpl.rcParams['figure.dpi'] = 80

Create list of images to be loaded and analyzed#

baseurl = 'https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/'

filters = 'F090W F115W F150W F200W F277W F335M F356W F410M F444W'.split()

# Data images [e-/s]
imagefiles = {}
for filt in filters:
    filename = f'jades_jwst_nircam_goods_s_crop_{filt}.fits'
    imagefiles[filt] = os.path.join(baseurl, filename)

# Weight images (Inverse Variance Maps; IVM)
weightfiles = {}
for filt in filters:
    filename = f'jades_jwst_nircam_goods_s_crop_{filt}_wht.fits'
    weightfiles[filt] = os.path.join(baseurl, filename)

Load detection image: F200W#

filt = 'F200W'
infile = imagefiles[filt]
hdu = fits.open(infile)
data = hdu[0].data
imwcs = wcs.WCS(hdu[0].header, hdu)

weight = fits.open(weightfiles[filt])[0].data

Report image size and field of view#

ny, nx = data.shape
pixscale = wcs.utils.proj_plane_pixel_scales(imwcs)[0] 
pixscale *= imwcs.wcs.cunit[0].to('arcsec')
outline = '%d x %d pixels' % (ny, nx)
outline += ' = %g" x %g"' % (ny * pixscale, nx * pixscale)
outline += ' (%.2f" / pixel)' % pixscale
print(outline)
1000 x 1000 pixels = 30" x 30" (0.03" / pixel)

Create color image (optional)#

# 3 NIRCam short wavelength channel images
r = fits.open(imagefiles['F200W'])[0].data
g = fits.open(imagefiles['F150W'])[0].data
b = fits.open(imagefiles['F090W'])[0].data

rgb = make_lupton_rgb(r, g, b, Q=5, stretch=0.02)  # , minimum=-0.001

fig = plt.figure(figsize=(8, 8))
ax = plt.subplot(projection=imwcs)
plt.imshow(rgb, origin='lower')
plt.xlabel('Right Ascension')
plt.ylabel('Declination')
fig.tight_layout()
plt.subplots_adjust(left=0.15)
../../../_images/e88c607e681a9140c50be0c854dab589a89aa9ee533fea234f6744bbabdabfb1.png

Detect Sources and Deblend using photutils#

https://photutils.readthedocs.io/en/latest/segmentation.html

# For detection, requiring 5 connected pixels 2-sigma above background

# Measure background and set detection threshold
bkg_estimator = MedianBackground()
bkg = Background2D(data, (50, 50), filter_size=(3, 3), bkg_estimator=bkg_estimator)
threshold = bkg.background + (2. * bkg.background_rms)

# Before detection, smooth image with Gaussian FWHM = 3 pixels
smooth_kernel = make_2dgaussian_kernel(3.0, size=3)
convolved_data = convolve(data, smooth_kernel)

# Detect and deblend
segm_detect = detect_sources(convolved_data, threshold, npixels=5)

segm_deblend = deblend_sources(convolved_data, segm_detect, npixels=5, nlevels=32, contrast=0.001)

# Save segmentation map of detected objects
segm_hdu = fits.PrimaryHDU(segm_deblend.data.astype(np.uint32), header=imwcs.to_header())
segm_hdu.writeto('JADES_detections_segm.fits', overwrite=True)

Measure photometry (and more) in detection image#

https://photutils.readthedocs.io/en/latest/segmentation.html#centroids-photometry-and-morphological-properties

#error = bkg.background_rms
# Input weight should be exposure map. Fudging for now.
error = calc_total_error(data, bkg.background_rms, weight/500)
#cat = source_properties(data-bkg.background, segm_deblend, wcs=imwcs, background=bkg.background, error=error)
cat = SourceCatalog(data-bkg.background, segm_deblend, wcs=imwcs, background=bkg.background, error=error)

Show detections alongside images (optional)#

fig, ax = plt.subplots(2, 3, sharex=True, sharey=True, figsize=(9.5, 6))
# For RA,Dec axes instead of pixels, add: , subplot_kw={'projection': imwcs})

# Color image
ax[0, 0].imshow(rgb, origin='lower')
ax[0, 0].set_title('Color Image')

# Data
norm = simple_norm(data, 'sqrt', percent=99.)
ax[0, 1].imshow(data, origin='lower', cmap='Greys_r', norm=norm)
ax[0, 1].set_title('Detection Image F200W')

# Segmentation map
cmap = segm_deblend.make_cmap(seed=12345)
ax[0, 2].imshow(segm_deblend, origin='lower', cmap=cmap, interpolation='nearest')
ax[0, 2].set_title('Detections (Segmentation Image)')

# Weight
ax[1, 0].imshow(weight, origin='lower', cmap='Greys_r', vmin=0)
ax[1, 0].set_title('Weight Image F200W')

# RMS
ax[1, 1].imshow(bkg.background_rms, origin='lower', norm=None)
ax[1, 1].set_title('Background RMS')

# Total error including Poisson noise
norm = simple_norm(error, 'sqrt', percent=99.)
ax[1, 2].imshow(error, origin='lower', norm=norm)
ax[1, 2].set_title('RMS + Poisson noise')

fig.tight_layout()
../../../_images/dda732896e37cd213315ed4174d37ad2a5de0de766c65d8390d1d40223727ca3.png

View all measured quantities in detection image (optional)#

cat.to_table()
QTable length=326
labelxcentroidycentroidsky_centroidbbox_xminbbox_xmaxbbox_yminbbox_ymaxareasemimajor_sigmasemiminor_sigmaorientationeccentricitymin_valuemax_valuelocal_backgroundsegment_fluxsegment_fluxerrkron_fluxkron_fluxerr
deg,degpix2pixpixdeg
int32float64float64SkyCoordint64int64int64int64float64float64float64float64float64float64float64float64float64float64float64float64
1466.244613500336478.797564260237153.17381009103326,-27.805320830365776460472314101.03.1218835927233961.687718238373556-44.4789474937866060.84127400633129780.00066971646287911340.030035654569434760.00.88635946268619040.043331053793477331.15236463988468780.05542864325311204
2104.8068179161906718.08212941103560253.17721522973072,-27.805243193448323951161027271.04.43307602055267052.8904310038200527-26.549722105819660.75820627200859060.0011695926826142560.056832899952609780.03.38509317966082260.100962735674347584.0643078865604630.1178471432803697
315.0441639655175513.2187096435808353.178060898531776,-27.805283643045666141612148.00.85019454558437720.6682678017840504-38.16122766424210.61820423015873090.00357281017560595040.0060673364311997410.00.040722280965723980.0112228255853605830.100868506984707420.02315230578296353
4710.324288970185814.25977713808687753.17151058505514,-27.805275444028442708712121725.01.27497536431044561.117371994707132-59.261781965590240.48160731527476410.00135306359668158640.0151009560126024680.00.154969013836878560.0185752119272267930.190116865465269460.023625589169720226
5434.529489171350822.21909152799715853.17410887322447,-27.80520896436384244471430268.03.95512761202273972.6287674709150584-8.1400603708823440.7471566761152122-0.00034209583965618370.106560584227364210.03.61478638229980160.087735020881218374.2787412093748450.10086436727140968
6289.3880251501489617.28176556215395453.17547627056455,-27.805250009193262287291152017.01.29130449311472351.197856886386651768.122709231498590.373492561225041150.00195128621973057470.0087972159450054980.00.085138042864578630.01664285701626640.343841986682007160.045989916939691816
7640.486309199531717.77342915466198353.17216853452775,-27.805246129692247638642152021.01.51249166928846180.8803106550282112-64.726783778115280.81316961831549830.00035762508811050880.0099469359108096920.00.097083238320361750.0144624942015966550.176958362626054360.026075310664432968
8762.76229173728528.28991415588462753.171016553902064,-27.8051585496483047547712136200.03.1603157747364452.353609520828006637.5200566173994760.6673561574146197-0.00019417920506550570.105561219677835720.03.82127525451699550.088479101581148913.98113926411816440.09150995786991047
9801.070672216388632.5802611851737453.17065564474934,-27.805122812753073799804313412.01.33494349088449060.6567170220834244-28.755196160479750.87062702081902230.00188568549006148190.0093360177941932860.00.059352035014049560.0121893556449921490.170035041723203220.027778386430149567
............................................................
31813.440867157588091884.670242485233353.17807510890577,-27.798021546451285621877892184.03.27361066437583273.140562210245422-6.2965911503800230.28219428882034860.00143610344190947580.034953824689460910.02.1078466545164140.107589773899331933.41001062485070160.154602699729525
3197.1117930282611415891.888174500344253.17813472440638,-27.79796139126172251188989530.01.63886137204938591.3203695638683461-73.170862308799170.59237448403462110.00190184549198246440.013475602039041760.00.223725470163031760.035843936854392910.66884476488315340.07533566959001846
320143.92969676102126953.697360010852453.17684577662435,-27.79744643361144413914995095759.02.65075811101952661.396406846538550225.197030835258050.8499921992816310.00216170092196250620.0211652306331749260.00.56819240755599290.057438031999664681.2547609875056720.10492362090925443
321142.746173256619959.538991786639953.176856920479636,-27.79739775237413914795796348.02.14274366102136371.2555061677914512-35.474279501961710.81035884341569080.000475836657960552240.0304531849666570370.00.56379821148343390.05687180127081430.88938017849309430.08214060528713435
322790.4887212488912955.359408152321153.17075490894491,-27.79743298303266778479795195996.02.6881081989069021.8943181515544928.7478121741199480.70950232997450980.00057679500669287080.040231696440169390.01.13129400475049310.079573099188785561.67676743972025480.10950450078803163
323797.3519286211066965.598074328851353.17069024984349,-27.797347663631648792802958974118.02.9820376042599381.768240228608643879.70373239971180.80522914750565430.0023334202218001770.087616869541827830.02.10123374638294940.10590564818846392.8227666356526690.13081451901117752
324790.7983558965504979.582229630056153.17075198078638,-27.79723112632807781799972989133.04.5064513596653571.493045462994405-44.198244691994310.9435209394229406-0.0012488494588083590.069434441931773130.02.0027505976507430.103721076699361242.8135770385945170.13630578304670982
325307.63744942017837990.225288278578953.17530354876154,-27.79714216072120830531198799440.01.9565314357920761.170389373708425-59.6583822819672560.80134979099482460.00179727124129960860.0305358601308233540.00.41133909908029420.047578177693647640.77613347929771340.0762793986919714
326306.8980749204495997.390265331568753.17531050813543,-27.79708245205092630231299499948.02.5238064334846081.38444059218226212.216989457530270.83611604467659550.0028531976752658360.020470511199261450.00.52673570915947820.053378597757780760.7295907270626270.06944105571892703

Only keep some quantities#

columns = 'label xcentroid ycentroid sky_centroid area semimajor_sigma semiminor_sigma ellipticity orientation gini'.split()
tbl = cat.to_table(columns=columns)
tbl.rename_column('semimajor_sigma', 'a')
tbl.rename_column('semiminor_sigma', 'b')
tbl
QTable length=326
labelxcentroidycentroidsky_centroidareaabellipticityorientationgini
deg,degpix2pixpixdeg
int32float64float64SkyCoordfloat64float64float64float64float64float64
1466.244613500336478.797564260237153.17381009103326,-27.805320830365776101.03.1218835927233961.6877182383735560.4593910412587602-44.4789474937866060.3750841422808698
2104.8068179161906718.08212941103560253.17721522973072,-27.805243193448323271.04.43307602055267052.89043100382005270.34798523859744157-26.549722105819660.4292034166747856
315.0441639655175513.2187096435808353.178060898531776,-27.8052836430456668.00.85019454558437720.66826780178405040.21398248759086114-38.16122766424210.10521135944081007
4710.324288970185814.25977713808687753.17151058505514,-27.80527544402844225.01.27497536431044561.1173719947071320.12361287442487268-59.261781965590240.33737600483155716
5434.529489171350822.21909152799715853.17410887322447,-27.8052089643638268.03.95512761202273972.62876747091505840.33535204706817323-8.1400603708823440.5363680123723463
6289.3880251501489617.28176556215395453.17547627056455,-27.80525000919326217.01.29130449311472351.19785688638665170.0723668253509047768.122709231498590.18041073594089005
7640.486309199531717.77342915466198353.17216853452775,-27.80524612969224721.01.51249166928846180.88031065502821120.41797322067741016-64.726783778115280.257339933672325
8762.76229173728528.28991415588462753.171016553902064,-27.805158549648304200.03.1603157747364452.35360952082800660.255261281279942337.5200566173994760.5417393494467531
9801.070672216388632.5802611851737453.17065564474934,-27.80512281275307312.01.33494349088449060.65671702208342440.5080563135685205-28.755196160479750.28793220448127643
..............................
31813.440867157588091884.670242485233353.17807510890577,-27.798021546451285184.03.27361066437583273.1405622102454220.04064272382121481-6.2965911503800230.33246937212374045
3197.1117930282611415891.888174500344253.17813472440638,-27.79796139126172230.01.63886137204938591.32036956386834610.1943372475627806-73.170862308799170.2490826303025817
320143.92969676102126953.697360010852453.17684577662435,-27.79744643361144459.02.65075811101952661.39640684653855020.4732047255713316425.197030835258050.2823870637944277
321142.746173256619959.538991786639953.176856920479636,-27.79739775237448.02.14274366102136371.25550616779145120.41406609169806174-35.474279501961710.3421221334166607
322790.4887212488912955.359408152321153.17075490894491,-27.79743298303266796.02.6881081989069021.8943181515544920.295296910918689378.7478121741199480.3790106203018768
323797.3519286211066965.598074328851353.17069024984349,-27.797347663631648118.02.9820376042599381.76824022860864380.407036240561602979.70373239971180.4740381190737283
324790.7983558965504979.582229630056153.17075198078638,-27.79723112632807133.04.5064513596653571.4930454629944050.6686871012615841-44.198244691994310.42319913307021234
325307.63744942017837990.225288278578953.17530354876154,-27.79714216072120840.01.9565314357920761.1703893737084250.40180395147364023-59.6583822819672560.35192342998474957
326306.8980749204495997.390265331568753.17531050813543,-27.79708245205092648.02.5238064334846081.3844405921822620.451447395563228212.216989457530270.2410634775489439

Convert measured fluxes (data units) to magnitudes#

https://docs.astropy.org/en/stable/units/

https://docs.astropy.org/en/stable/units/equivalencies.html#photometric-zero-point-equivalency

https://docs.astropy.org/en/stable/units/logarithmic_units.html#logarithmic-units

# not detected: mag =  99; magerr = 1-sigma upper limit assuming zero flux
# not observed: mag = -99; magerr = 0
def fluxes2mags(flux, fluxerr):
    nondet = flux < 0  # Non-detection if flux is negative
    unobs = (fluxerr <= 0) + (fluxerr == np.inf)  # Unobserved if flux uncertainty is negative or infinity

    mag = flux.to(u.ABmag)
    magupperlimit = fluxerr.to(u.ABmag)  # 1-sigma upper limit if flux=0

    mag = np.where(nondet, 99 * u.ABmag, mag)
    mag = np.where(unobs, -99 * u.ABmag, mag)

    magerr = 2.5 * np.log10(1 + fluxerr/flux) 
    magerr = magerr.value * u.ABmag

    magerr = np.where(nondet, magupperlimit, magerr)
    magerr = np.where(unobs, 0*u.ABmag, magerr)
    
    return mag, magerr

# Includes features I couldn't find in astropy:
# mag = 99 / -99 for non-detections / unobserved
# flux uncertainties -> mag uncertainties

Multiband photometry using isophotal apertures defined in detection image#

(Similar to running SourceExtractor in double-image mode)

filters = 'F090W F115W F150W F200W F277W F335M F356W F410M F444W'.split()
for filt in filters:
    infile = imagefiles[filt]
    print(filt)
    print(infile)
    print(weightfiles[filt])
    hdu = fits.open(infile)
    data = hdu[0].data
    zp = hdu[0].header['ABMAG'] * u.ABmag  # zeropoint
    weight = fits.open(weightfiles[filt])[0].data
    
    # Measure background
    bkg = Background2D(data, (50, 50), filter_size=(3, 3), bkg_estimator=bkg_estimator)
    #error = bkg.background_rms
    error = calc_total_error(data, bkg.background_rms, weight/500)
                             
    # Measure properties in each image of previously detected objects 
    filtcat = SourceCatalog(data-bkg.background, segm_deblend, wcs=imwcs, background=bkg.background, error=error)

    # Convert measured fluxes to fluxes in nJy and to AB magnitudes
    filttbl = filtcat.to_table()
    tbl[filt+'_flux']    = flux    = filttbl['segment_flux']     * zp.to(u.nJy)
    tbl[filt+'_fluxerr'] = fluxerr = filttbl['segment_fluxerr'] * zp.to(u.nJy)

    mag, magerr = fluxes2mags(flux, fluxerr)
    #mag = mag * u.ABmag  # incompatible with file writing
    tbl[filt+'_mag']    = mag.value
    tbl[filt+'_magerr'] = magerr.value
F090W
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F090W.fits
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F090W_wht.fits
/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/astropy/units/function/logarithmic.py:67: RuntimeWarning: invalid value encountered in log10
  return dex.to(self._function_unit, np.log10(x))
F115W
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F115W.fits
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F115W_wht.fits
/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/astropy/units/function/logarithmic.py:67: RuntimeWarning: invalid value encountered in log10
  return dex.to(self._function_unit, np.log10(x))
/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/astropy/units/quantity.py:658: RuntimeWarning: invalid value encountered in log10
  result = super().__array_ufunc__(function, method, *arrays, **kwargs)
F150W
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F150W.fits
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F150W_wht.fits
F200W
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F200W.fits
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F200W_wht.fits
F277W
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F277W.fits
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F277W_wht.fits
F335M
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F335M.fits
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F335M_wht.fits
F356W
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F356W.fits
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F356W_wht.fits
F410M
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F410M.fits
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F410M_wht.fits
/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/astropy/units/function/logarithmic.py:67: RuntimeWarning: invalid value encountered in log10
  return dex.to(self._function_unit, np.log10(x))
/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/astropy/units/quantity.py:658: RuntimeWarning: invalid value encountered in log10
  result = super().__array_ufunc__(function, method, *arrays, **kwargs)
F444W
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F444W.fits
https://data.science.stsci.edu/redirect/JWST/jwst-data_analysis_tools/nircam_photometry/jades_jwst_nircam_goods_s_crop_F444W_wht.fits
/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/astropy/units/function/logarithmic.py:67: RuntimeWarning: invalid value encountered in log10
  return dex.to(self._function_unit, np.log10(x))
/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/astropy/units/quantity.py:658: RuntimeWarning: invalid value encountered in log10
  result = super().__array_ufunc__(function, method, *arrays, **kwargs)

View complete results (optional)#

tbl
QTable length=326
labelxcentroidycentroidsky_centroidareaabellipticityorientationginiF090W_fluxF090W_fluxerrF090W_magF090W_magerrF115W_fluxF115W_fluxerrF115W_magF115W_magerrF150W_fluxF150W_fluxerrF150W_magF150W_magerrF200W_fluxF200W_fluxerrF200W_magF200W_magerrF277W_fluxF277W_fluxerrF277W_magF277W_magerrF335M_fluxF335M_fluxerrF335M_magF335M_magerrF356W_fluxF356W_fluxerrF356W_magF356W_magerrF410M_fluxF410M_fluxerrF410M_magF410M_magerrF444W_fluxF444W_fluxerrF444W_magF444W_magerr
deg,degpix2pixpixdegnJynJynJynJynJynJynJynJynJynJynJynJynJynJynJynJynJynJy
int32float64float64SkyCoordfloat64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64
1466.244613500336478.797564260237153.17381009103326,-27.805320830365776101.03.1218835927233961.6877182383735560.4593910412587602-44.4789474937866060.37508414228086989.1728113576001090.84642730068574728.99374384458480.0958306486455150515.2517506554160940.735186596238872428.4417007586044330.0511139345256905818.356035113113580.907615519995420628.2405528005453060.0523992836818080320.3558801662447270.995128698489914528.1282752861371360.0518212882909908215.3054146318122160.372429099131501428.4378872515976940.0261030798431231914.020837882792390.4536467684272995628.5330650805810180.0345728557738658714.1740145743041430.39992610811826728.5212678125371040.03021030644957815213.8806116819573550.4650116285226762528.5439784881169170.03577704531629849513.8075784440798550.498639263295004728.549706201922080.038518276199782
2104.8068179161906718.08212941103560253.17721522973072,-27.805243193448323271.04.43307602055267052.89043100382005270.34798523859744157-26.549722105819660.429203416674785666.57967761264022.436256023623420326.8416457802099550.0390191987723188767.808073368829981.781930408459867326.821796487648120.02816363781855341470.393384140357212.109686015675715326.7811703893020550.0320613824051575577.741090401314922.31868156787635726.67337343055230.03190930252363899472.900690267577690.831882411325622726.7431708987530430.01231936770850041475.272502539519281.07060310590987926.7084091124971150.01533367028926042771.487928966360.934213121607565226.7644182110873250.0140966264580620661.427673890999040.999308782885589626.9290898249775950.01752068594229819257.22037605466371.05109315762743627.006123230800470.019763151293857934
315.0441639655175513.2187096435808353.178060898531776,-27.8052836430456668.00.85019454558437720.66826780178405040.21398248759086114-38.16122766424210.105211359440810070.30189458182435890.2200328572844353632.7003617032396860.59438702690874770.76733446641904650.2004971001723481531.687538235309370.252037692462739660.71852631349828740.2241374379587019231.7588933068276840.294785325181296740.93521636122917530.2577402310908105731.472719759936880.264281363540913860.349713623329662270.0690028698237118332.540718622818150.195518792806108040.56076173468020880.1133629984973717932.028054073660130.199904727160175320.266865768209514460.0705653665151825532.834267827719060.2547307087052087-0.060316541767083690.0827580445377532299.034.105474449211510.117654224275606340.0820075811266348533.7234811880781460.5742186726193422
4710.324288970185814.25977713808687753.17151058505514,-27.80527544402844225.01.27497536431044561.1173719947071320.12361287442487268-59.261781965590240.337376004831557162.6566836219551390.437148808697345630.3391504039819680.165392372918989563.8182797398874240.3605578987306688529.9453306422923580.097969386601509253.97618216720223840.424624999722771829.9013343169755430.110165165004611973.55897444315034230.4265930516579788430.021687826589590.122913247141083881.69622982190262820.1267276882693104730.8262882640099040.078229629403633621.5905365350914810.1668091058917216830.8961408764255130.108283847620601091.99122551484107960.151127025730500830.6521988786798330.079426225856374741.94383536574491340.17889684257333530.678351301683160.095589325504576581.62531031364175880.1710244148684479430.87265927188790.1086274373485027
5434.529489171350822.21909152799715853.17410887322447,-27.8052089643638268.03.95512761202273972.62876747091505840.33535204706817323-8.1400603708823440.536368012372346348.235022061972991.791998596329495327.1915937962497760.03960539474416098554.215515841534091.36588515114213227.0646910142796460.02701473794870812358.287222421341411.623579937240189626.986066599384770.0298294392374628483.016159382640152.01489761956019726.6020934061792430.026037350500330014133.101917028759151.056137229300284626.0895392236533470.008581100944569356133.484096704706731.282653671522106626.0864261826550030.010383073588802694144.05302153521441.238472358399950826.0036940697291680.009294542790104875161.56838200592771.430304180075947325.8791090603865040.009569320100872941148.333626365368811.572246876965978325.9719009644804720.01144758607362489
6289.3880251501489617.28176556215395453.17547627056455,-27.80525000919326217.01.29130449311472351.19785688638665170.0723668253509047768.122709231498590.180410735940890051.13035541195836680.382167093637674131.2669624550447940.316217068700616331.5011462585577480.286761599853339730.958942479601550.18980531271054521.04562399602403080.2893029616707093531.35156114672380.26520490509896491.9552561585880510.3822151365320357630.6719908437858420.19385655954830741.1886164496262840.123682444182432231.2123956592554140.107477566115040251.77084710147560730.1974670158310179430.779547337640330.114783356068400871.4921438342111690.1506799168480300330.9654732782954060.104450710851016431.14339271696203640.1756375050398780431.254511446067160.155148311919992820.59265530326064010.1365705667809733531.9679945626145850.2251497308694742
7640.486309199531717.77342915466198353.17216853452775,-27.80524612969224721.01.51249166928846180.88031065502821120.41797322067741016-64.726783778115280.2573399336723251.73185622406968730.3544952056592658430.8037204131364180.202189072616268171.64342983964822030.2498558283720741530.860622079585680.15366244794038391.63610210419379240.284066143863478130.8654739920281040.173822201809836352.22958613135484460.3321415421916017530.5294393642967030.150771763920817121.03995986848430630.0961779028754872631.3574585489455870.096036044886159631.65375745174451930.150720959938050630.8538204647295730.0946996913262891.26045721517602630.1159191274040514831.1486797284561770.09552272664716470.407881321750577950.1157545116742151732.373665455059720.271238851352037070.56881407078372240.1086500556501025132.012574172449660.18978993015591245
8762.76229173728528.28991415588462753.171016553902064,-27.805158549648304200.03.1603157747364452.35360952082800660.255261281279942337.5200566173994760.541739349446753152.884573363950361.790582005249827627.0916774872078920.0361525517994319455.844804197636071.340403900522882327.0325430686030330.02575233323781883661.656514188084541.629973165803390726.9250525804571620.02833005873506147287.758324289164492.031985965992353426.541779195093080.02485287557612766385.910844314879360.787204773810109226.5648800319568960.00990334428786069273.696764079893820.893239425770293426.731378952438490.01308052134695740374.681992064240940.836338501819852326.7169602655403580.01209121737630715970.619100872280840.900119750012822726.7776945405195550.01375147328893841573.99616545286091.038715415080909726.7269769630310560.015134956407915642
9801.070672216388632.5802611851737453.17065564474934,-27.80512281275307312.01.33494349088449060.65671702208342440.5080563135685205-28.755196160479750.287932204481276431.12460362218565060.300478644836192831.2725013050615850.25710114501476181.27974760412330580.2305526085037724631.1321891871010620.17984739594351111.27343422012220380.2595936278284940431.137558709545920.20143381961315991.36306201177940830.279937286460770731.0637109642999860.202804409146797811.0827870683235610.1003013786232939431.3136423490742320.09618538263285320.67813671012309810.116101215374980331.8217068624302930.171583415262564180.57588910423384620.0898934281746872931.999152845504890.15748383735788291.10761760369296080.1352058544185378631.2890253762535830.125048981016840451.1134330029492510.1420534202367805831.2833397750993640.1303698266479056
..........................................................................................................................................
31813.440867157588091884.670242485233353.17807510890577,-27.798021546451285184.03.27361066437583273.1405622102454220.04064272382121481-6.2965911503800230.3324693721237404518.7325197485782231.95872974138917728.2185095021971260.1079762955861177231.8220260983708951.711918390216890227.6431804310408860.0568920337355352150.180954945563342.405186086059731427.148652695753870.050830950313501348.4082087623031752.470876249203592527.187702467898910.05405069924299093436.576627133853730.819573429279576927.4919908622864780.02405956308941199833.309849641379651.004801361082283727.5935683192076980.0322672848384842834.232297973866820.91102756479713227.5639098655155160.02851700419879626331.4744945227445961.011143554806689227.6551030897258270.03433159354040260531.66124163732591.104588404666478727.6486801442727850.03723307981708463
3197.1117930282611415891.888174500344253.17813472440638,-27.79796139126172230.01.63886137204938591.32036956386834610.1943372475627806-73.170862308799170.24908263030258174.6003204444030310.896971411714131529.7430297890629660.19340177570890313.5877109434752060.597022528698615930.012956386694340.167125893622531055.3385007773577490.803042643482935929.5814517242533270.152145540917907775.1380157289388520.823181693218733629.6230114264193670.161345188858301044.180574204810220.2904487036771658529.8469101586880470.072927396433601763.9869864387665990.372867423746460629.8983881038330070.097067934935763233.53301365026098320.311640118630798630.0296367115207450.091779800063208023.4687773538655570.363224376888839730.0495589369693120.108123178367181344.1298072397926780.4124265497242059529.860175546796070.10334925596380154
320143.92969676102126953.697360010852453.17684577662435,-27.79744643361144459.02.65075811101952661.39640684653855020.4732047255713316425.197030835258050.28238706379442775.34233931317228451.081979266512549629.5806713291811750.200239002466927835.9220643583151330.803661693108388829.468817193013010.138165127749899427.2127925544372170.99963702998013729.2547413956993620.140920542764292113.048945768038541.319105561108058428.611061434534150.104556111587579448.3787922001590280.4134455928815519729.0920464506231550.0522950141551488956.6945377333171190.504486794403155929.3356985155622460.078882648678986886.4688486698743780.425448612015337129.3729325212086150.069157536810061987.5253707895246170.528495920804460829.2086802417016570.073691336340465836.7167421878142030.539282580226544729.3321033028272070.08385019406434349
321142.746173256619959.538991786639953.176856920479636,-27.79739775237448.02.14274366102136371.25550616779145120.41406609169806174-35.474279501961710.34212213341666076.9362363003372391.139260769499339529.297190299864630.165113459583989967.9032548798974090.869397173799035629.155485029604660.1133122907201146710.1876230254024431.126300623550060628.879817834235850.1138509432735006312.9480299066464631.306101666697101528.6194907653970670.104342673528034229.0230177648825510.4184777153387268529.0116204689373620.0492224428626934845.4470147353357070.4567689453008257329.5596036246653750.08742971518734176.4728933057115340.4196892219065778729.372253878763920.06820881573550456.4883486447543360.486939506762526729.3696645545042580.078569937425284915.766279267773310.500732540740538529.4977608200984950.09041210263092743
322790.4887212488912955.359408152321153.17075490894491,-27.79743298303266796.02.6881081989069021.8943181515544920.295296910918689378.7478121741199480.379010620301876821.2554951104511931.896520832991559528.081321936077290.0927939681981434428.609427580548971.55564352373548527.7587270787563160.05748796215822013526.0380197743493161.74845234505128227.8609801187863260.070563645109372925.980977428392631.82745323960860927.8633612859892280.0738024877920070421.649315389052410.634089405907647528.0613895817012280.0313434557976492319.2317329178721050.756789889910020428.189953952331350.0419057024923611718.3082894748422160.666646827591418928.243380573754080.0388313904366457413.1510484031144890.681992838190219328.6025990594682470.0548932387935082513.9551080701095070.750382736498779628.538166989828290.056865799787852764
323797.3519286211066965.598074328851353.17069024984349,-27.797347663631648118.02.9820376042599381.76824022860864380.407036240561602979.70373239971180.474038119073728345.093297693391952.63314819441872927.2647200084471280.06161774433222723449.8167960406966942.00529436688082727.1565605187044450.04284783780894399549.5372676787456852.34743604505427527.162669878548260.0502682313830429248.256338588652362.432199095522142427.1911140823148540.05338848837422742533.087795476809350.771720012245354227.6008304184671440.02503226672582387823.3517332857194760.844169938087905327.9792021958296680.03855679281478758422.6801861557182360.753073883391642728.0108834628440530.0354652426492341619.272175842532080.799600571254326528.187673126041690.04413765249764562618.3131354506195230.854398236129516428.24309323095460.049508818947499034
324790.7983558965504979.582229630056153.17075198078638,-27.79723112632807133.04.5064513596653571.4930454629944050.6686871012615841-44.198244691994310.4231991330702123434.209891481828382.35362389907353127.564620758626630.0722406188640472236.571354620186571.755790613359895327.492147382230060.0509135631933678242.688495540964212.20647872025270427.3242228766215870.0547171938969295545.994602511607742.38202884595770327.2432328249786760.0548218838777627534.800043028220410.782298163999233227.546050547683320.0241368470061163123.405681882620230.846231745268850827.9766967549008920.0385617870139375222.767378399316490.743845751411664928.0067174357873870.0349055407207079920.5012563699189950.820549850987213228.1205488086040520.042608788682020619.0896042068368780.866780953485821528.1980076898289060.048212383021397735
325307.63744942017837990.225288278578953.17530354876154,-27.79714216072120840.01.9565314357920761.1703893737084250.40180395147364023-59.6583822819672560.351923429984749577.5252462670619231.123927743089444829.208698207549240.151134794141423426.762986542644410.779591663676705729.3246536918909870.118453246680949846.5718696975592620.892436020868444929.3557776400979120.138251186768227659.4466971483487171.092666942061043528.9618000186670840.118836038183477426.420318174925390.3528087741182169329.3811086221213420.05808166133377495.3616085955201870.42404586894742829.5767622331609950.082643465161938287.840847181418520.4292733524777390729.164092526216890.0578721244103994064.7122134014494510.413067395764606729.716937624832240.09123178468341115.0298458237568430.4586960851757813729.646113317140420.09475577889820616
326306.8980749204495997.390265331568753.17531050813543,-27.79708245205092648.02.5238064334846081.3844405921822620.451447395563228212.216989457530270.24106347754894397.7411442235124091.14789052931229.177987103063460.1501236133963538310.457124212351170.947300800882953928.851469333228510.0941528181381969310.3598227665393241.092744352639286428.8616191858428830.1088763000724416712.0968629842770531.225877745025278728.6933180959554370.104802036639596189.1663015916391440.407506957242078128.9945146440127460.047226490211660298.7340045976209790.501455274052168529.0469664594999130.060612773574436629.663218651280610.462419307505787128.937195483737170.0507514716644051557.3374755641881850.485947593775443329.2361333301549950.069625383303748167.1436408022974180.528370400930742229.2652009770897980.07747404796836206

Save photometry as output catalog#

tbl.write('JADESphotometry.ecsv', overwrite=True)
!head -175 JADESphotometry.ecsv  # show the first 175 lines
# %ECSV 1.0
# ---
# datatype:
# - {name: label, datatype: int32}
# - {name: xcentroid, datatype: float64}
# - {name: ycentroid, datatype: float64}
# - {name: sky_centroid.ra, unit: deg, datatype: float64}
# - {name: sky_centroid.dec, unit: deg, datatype: float64}
# - {name: area, unit: pix2, datatype: float64}
# - {name: a, unit: pix, datatype: float64}
# - {name: b, unit: pix, datatype: float64}
# - {name: ellipticity, datatype: float64}
# - {name: orientation, unit: deg, datatype: float64}
# - {name: gini, datatype: float64}
# - {name: F090W_flux, unit: nJy, datatype: float64}
# - {name: F090W_fluxerr, unit: nJy, datatype: float64}
# - {name: F090W_mag, datatype: float64}
# - {name: F090W_magerr, datatype: float64}
# - {name: F115W_flux, unit: nJy, datatype: float64}
# - {name: F115W_fluxerr, unit: nJy, datatype: float64}
# - {name: F115W_mag, datatype: float64}
# - {name: F115W_magerr, datatype: float64}
# - {name: F150W_flux, unit: nJy, datatype: float64}
# - {name: F150W_fluxerr, unit: nJy, datatype: float64}
# - {name: F150W_mag, datatype: float64}
# - {name: F150W_magerr, datatype: float64}
# - {name: F200W_flux, unit: nJy, datatype: float64}
# - {name: F200W_fluxerr, unit: nJy, datatype: float64}
# - {name: F200W_mag, datatype: float64}
# - {name: F200W_magerr, datatype: float64}
# - {name: F277W_flux, unit: nJy, datatype: float64}
# - {name: F277W_fluxerr, unit: nJy, datatype: float64}
# - {name: F277W_mag, datatype: float64}
# - {name: F277W_magerr, datatype: float64}
# - {name: F335M_flux, unit: nJy, datatype: float64}
# - {name: F335M_fluxerr, unit: nJy, datatype: float64}
# - {name: F335M_mag, datatype: float64}
# - {name: F335M_magerr, datatype: float64}
# - {name: F356W_flux, unit: nJy, datatype: float64}
# - {name: F356W_fluxerr, unit: nJy, datatype: float64}
# - {name: F356W_mag, datatype: float64}
# - {name: F356W_magerr, datatype: float64}
# - {name: F410M_flux, unit: nJy, datatype: float64}
# - {name: F410M_fluxerr, unit: nJy, datatype: float64}
# - {name: F410M_mag, datatype: float64}
# - {name: F410M_magerr, datatype: float64}
# - {name: F444W_flux, unit: nJy, datatype: float64}
# - {name: F444W_fluxerr, unit: nJy, datatype: float64}
# - {name: F444W_mag, datatype: float64}
# - {name: F444W_magerr, datatype: float64}
# meta: !!omap
# - {date: '2025-01-10 19:28:32 UTC'}
# - version: {Python: 3.11.11, astropy: 7.0.0, bottleneck: null, gwcs: 0.22.1, matplotlib: 3.10.0, numpy: 2.2.1, photutils: 2.1.0, scipy: 1.15.0,
#     skimage: 0.25.0}
# - {localbkg_width: 0}
# - {apermask_method: correct}
# - kron_params: !!python/tuple [2.5, 1.4, 0.0]
# - __serialized_columns__:
#     F090W_flux:
#       __class__: astropy.units.quantity.Quantity
#       unit: &id001 !astropy.units.Unit {unit: nJy}
#       value: !astropy.table.SerializedColumn {name: F090W_flux}
#     F090W_fluxerr:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F090W_fluxerr}
#     F115W_flux:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F115W_flux}
#     F115W_fluxerr:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F115W_fluxerr}
#     F150W_flux:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F150W_flux}
#     F150W_fluxerr:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F150W_fluxerr}
#     F200W_flux:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F200W_flux}
#     F200W_fluxerr:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F200W_fluxerr}
#     F277W_flux:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F277W_flux}
#     F277W_fluxerr:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F277W_fluxerr}
#     F335M_flux:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F335M_flux}
#     F335M_fluxerr:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F335M_fluxerr}
#     F356W_flux:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F356W_flux}
#     F356W_fluxerr:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F356W_fluxerr}
#     F410M_flux:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F410M_flux}
#     F410M_fluxerr:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F410M_fluxerr}
#     F444W_flux:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F444W_flux}
#     F444W_fluxerr:
#       __class__: astropy.units.quantity.Quantity
#       unit: *id001
#       value: !astropy.table.SerializedColumn {name: F444W_fluxerr}
#     a:
#       __class__: astropy.units.quantity.Quantity
#       unit: !astropy.units.Unit {unit: pix}
#       value: !astropy.table.SerializedColumn {name: a}
#     area:
#       __class__: astropy.units.quantity.Quantity
#       unit: !astropy.units.Unit {unit: pix2}
#       value: !astropy.table.SerializedColumn {name: area}
#     b:
#       __class__: astropy.units.quantity.Quantity
#       unit: !astropy.units.Unit {unit: pix}
#       value: !astropy.table.SerializedColumn {name: b}
#     ellipticity:
#       __class__: astropy.units.quantity.Quantity
#       unit: !astropy.units.Unit {unit: ''}
#       value: !astropy.table.SerializedColumn {name: ellipticity}
#     orientation:
#       __class__: astropy.units.quantity.Quantity
#       unit: &id002 !astropy.units.Unit {unit: deg}
#       value: !astropy.table.SerializedColumn {name: orientation}
#     sky_centroid:
#       __class__: astropy.coordinates.sky_coordinate.SkyCoord
#       dec: !astropy.table.SerializedColumn
#         __class__: astropy.coordinates.angles.core.Latitude
#         unit: *id002
#         value: !astropy.table.SerializedColumn {name: sky_centroid.dec}
#       frame: icrs
#       ra: !astropy.table.SerializedColumn
#         __class__: astropy.coordinates.angles.core.Longitude
#         unit: *id002
#         value: !astropy.table.SerializedColumn {name: sky_centroid.ra}
#         wrap_angle: !astropy.coordinates.Angle
#           unit: *id002
#           value: 360.0
#       representation_type: spherical
# schema: astropy-2.0
label xcentroid ycentroid sky_centroid.ra sky_centroid.dec area a b ellipticity orientation gini F090W_flux F090W_fluxerr F090W_mag F090W_magerr F115W_flux F115W_fluxerr F115W_mag F115W_magerr F150W_flux F150W_fluxerr F150W_mag F150W_magerr F200W_flux F200W_fluxerr F200W_mag F200W_magerr F277W_flux F277W_fluxerr F277W_mag F277W_magerr F335M_flux F335M_fluxerr F335M_mag F335M_magerr F356W_flux F356W_fluxerr F356W_mag F356W_magerr F410M_flux F410M_fluxerr F410M_mag F410M_magerr F444W_flux F444W_fluxerr F444W_mag F444W_magerr
1 466.24461350033647 8.7975642602371 53.17381009103326 -27.805320830365776 101.0 3.121883592723396 1.687718238373556 0.4593910412587602 -44.478947493786606 0.3750841422808698 9.172811357600109 0.846427300685747 28.9937438445848 0.09583064864551505 15.251750655416094 0.7351865962388724 28.441700758604433 0.05111393452569058 18.35603511311358 0.9076155199954206 28.240552800545306 0.05239928368180803 20.355880166244727 0.9951286984899145 28.128275286137136 0.05182128829099082 15.305414631812216 0.3724290991315014 28.437887251597694 0.02610307984312319 14.02083788279239 0.45364676842729956 28.533065080581018 0.03457285577386587 14.174014574304143 0.399926108118267 28.521267812537104 0.030210306449578152 13.880611681957355 0.46501162852267625 28.543978488116917 0.035777045316298495 13.807578444079855 0.4986392632950047 28.54970620192208 0.038518276199782
2 104.80681791619067 18.082129411035602 53.17721522973072 -27.805243193448323 271.0 4.4330760205526705 2.8904310038200527 0.34798523859744157 -26.54972210581966 0.4292034166747856 66.5796776126402 2.4362560236234203 26.841645780209955 0.03901919877231887 67.80807336882998 1.7819304084598673 26.82179648764812 0.028163637818553414 70.39338414035721 2.1096860156757153 26.781170389302055 0.03206138240515755 77.74109040131492 2.318681567876357 26.6733734305523 0.031909302523638994 72.90069026757769 0.8318824113256227 26.743170898753043 0.012319367708500414 75.27250253951928 1.070603105909879 26.708409112497115 0.015333670289260427 71.48792896636 0.9342131216075652 26.764418211087325 0.01409662645806206 61.42767389099904 0.9993087828855896 26.929089824977595 0.017520685942298192 57.2203760546637 1.051093157627436 27.00612323080047 0.019763151293857934
3 15.04416396551755 13.21870964358083 53.178060898531776 -27.805283643045666 8.0 0.8501945455843772 0.6682678017840504 0.21398248759086114 -38.1612276642421 0.10521135944081007 0.3018945818243589 0.22003285728443536 32.700361703239686 0.5943870269087477 0.7673344664190465 0.20049710017234815 31.68753823530937 0.25203769246273966 0.7185263134982874 0.22413743795870192 31.758893306827684 0.29478532518129674 0.9352163612291753 0.25774023109081057 31.47271975993688 0.26428136354091386 0.34971362332966227 0.06900286982371183 32.54071862281815 0.19551879280610804 0.5607617346802088 0.11336299849737179 32.02805407366013 0.19990472716017532 0.26686576820951446 0.07056536651518255 32.83426782771906 0.2547307087052087 -0.06031654176708369 0.08275804453775322 99.0 34.10547444921151 0.11765422427560634 0.08200758112663485 33.723481188078146 0.5742186726193422
4 710.3242889701858 14.259777138086877 53.17151058505514 -27.805275444028442 25.0 1.2749753643104456 1.117371994707132 0.12361287442487268 -59.26178196559024 0.33737600483155716 2.656683621955139 0.4371488086973456 30.339150403981968 0.16539237291898956 3.818279739887424 0.36055789873066885 29.945330642292358 0.09796938660150925 3.9761821672022384 0.4246249997227718 29.901334316975543 0.11016516500461197 3.5589744431503423 0.42659305165797884 30.02168782658959 0.12291324714108388 1.6962298219026282 0.12672768826931047 30.826288264009904 0.07822962940363362 1.590536535091481 0.16680910589172168 30.896140876425513 0.10828384762060109 1.9912255148410796 0.1511270257305008 30.652198878679833 0.07942622585637474 1.9438353657449134 0.178896842573335 30.67835130168316 0.09558932550457658 1.6253103136417588 0.17102441486844794 30.8726592718879 0.1086274373485027
5 434.5294891713508 22.219091527997158 53.17410887322447 -27.8052089643638 268.0 3.9551276120227397 2.6287674709150584 0.33535204706817323 -8.140060370882344 0.5363680123723463 48.23502206197299 1.7919985963294953 27.191593796249776 0.039605394744160985 54.21551584153409 1.365885151142132 27.064691014279646 0.027014737948708123 58.28722242134141 1.6235799372401896 26.98606659938477 0.02982943923746284 83.01615938264015 2.014897619560197 26.602093406179243 0.026037350500330014 133.10191702875915 1.0561372293002846 26.089539223653347 0.008581100944569356 133.48409670470673 1.2826536715221066 26.086426182655003 0.010383073588802694 144.0530215352144 1.2384723583999508 26.003694069729168 0.009294542790104875 161.5683820059277 1.4303041800759473 25.879109060386504 0.009569320100872941 148.33362636536881 1.5722468769659783 25.971900964480472 0.01144758607362489
6 289.38802515014896 17.281765562153954 53.17547627056455 -27.805250009193262 17.0 1.2913044931147235 1.1978568863866517 0.07236682535090477 68.12270923149859 0.18041073594089005 1.1303554119583668 0.3821670936376741 31.266962455044794 0.31621706870061633 1.501146258557748 0.2867615998533397 30.95894247960155 0.1898053127105452 1.0456239960240308 0.28930296167070935 31.3515611467238 0.2652049050989649 1.955256158588051 0.38221513653203576 30.671990843785842 0.1938565595483074 1.188616449626284 0.1236824441824322 31.212395659255414 0.10747756611504025 1.7708471014756073 0.19746701583101794 30.77954733764033 0.11478335606840087 1.492143834211169 0.15067991684803003 30.965473278295406 0.10445071085101643 1.1433927169620364 0.17563750503987804 31.25451144606716 0.15514831191999282 0.5926553032606401 0.13657056678097335 31.967994562614585 0.2251497308694742
7 640.4863091995317 17.773429154661983 53.17216853452775 -27.805246129692247 21.0 1.5124916692884618 0.8803106550282112 0.41797322067741016 -64.72678377811528 0.257339933672325 1.7318562240696873 0.35449520565926584 30.803720413136418 0.20218907261626817 1.6434298396482203 0.24985582837207415 30.86062207958568 0.1536624479403839 1.6361021041937924 0.2840661438634781 30.865473992028104 0.17382220180983635 2.2295861313548446 0.33214154219160175 30.529439364296703 0.15077176392081712 1.0399598684843063 0.09617790287548726 31.357458548945587 0.09603604488615963 1.6537574517445193 0.1507209599380506 30.853820464729573 0.094699691326289 1.2604572151760263 0.11591912740405148 31.148679728456177 0.0955227266471647 0.40788132175057795 0.11575451167421517 32.37366545505972 0.27123885135203707 0.5688140707837224 0.10865005565010251 32.01257417244966 0.18978993015591245
8 762.762291737285 28.289914155884627 53.171016553902064 -27.805158549648304 200.0 3.160315774736445 2.3536095208280066 0.2552612812799423 37.520056617399476 0.5417393494467531 52.88457336395036 1.7905820052498276 27.091677487207892 0.03615255179943194 55.84480419763607 1.3404039005228823 27.032543068603033 0.025752333237818836 61.65651418808454 1.6299731658033907 26.925052580457162 0.028330058735061472 87.75832428916449 2.0319859659923534 26.54177919509308 0.024852875576127663 85.91084431487936 0.7872047738101092 26.564880031956896 0.009903344287860692 73.69676407989382 0.8932394257702934 26.73137895243849 0.013080521346957403 74.68199206424094 0.8363385018198523 26.716960265540358 0.012091217376307159 70.61910087228084 0.9001197500128227 26.777694540519555 0.013751473288938415 73.9961654528609 1.0387154150809097 26.726976963031056 0.015134956407915642

Reformat output catalog for readability (optional)#

# Remove units (pixels) from area
tbl['area'] = tbl['area'].value.astype(int)

# Replace sky_centroid with ra, dec
tbl['ra'] = tbl['sky_centroid'].ra.degree
tbl['dec'] = tbl['sky_centroid'].dec.degree

columns = list(tbl.columns)
columns = columns[:3] + ['ra', 'dec'] + columns[4:-2]

tbl = tbl[columns]
for column in columns:
    tbl[column].info.format = '.4f'

tbl['ra'].info.format = '11.7f'
tbl['dec'].info.format = '11.7f'

tbl['label'].info.format = 'd'
tbl['area'].info.format = 'd'
tbl.write('JADESphotometry.cat', format='ascii.fixed_width_two_line', delimiter=' ', overwrite=True)
!head -10 JADESphotometry.cat  # show the first 10 lines
label xcentroid ycentroid          ra         dec area       a      b ellipticity orientation   gini F090W_flux F090W_fluxerr F090W_mag F090W_magerr F115W_flux F115W_fluxerr F115W_mag F115W_magerr F150W_flux F150W_fluxerr F150W_mag F150W_magerr F200W_flux F200W_fluxerr F200W_mag F200W_magerr F277W_flux F277W_fluxerr F277W_mag F277W_magerr F335M_flux F335M_fluxerr F335M_mag F335M_magerr F356W_flux F356W_fluxerr F356W_mag F356W_magerr F410M_flux F410M_fluxerr F410M_mag F410M_magerr F444W_flux F444W_fluxerr F444W_mag F444W_magerr
----- --------- --------- ----------- ----------- ---- ------- ------ ----------- ----------- ------ ---------- ------------- --------- ------------ ---------- ------------- --------- ------------ ---------- ------------- --------- ------------ ---------- ------------- --------- ------------ ---------- ------------- --------- ------------ ---------- ------------- --------- ------------ ---------- ------------- --------- ------------ ---------- ------------- --------- ------------ ---------- ------------- --------- ------------
    1  466.2446    8.7976  53.1738101 -27.8053208  101  3.1219 1.6877      0.4594    -44.4789 0.3751     9.1728        0.8464   28.9937       0.0958    15.2518        0.7352   28.4417       0.0511    18.3560        0.9076   28.2406       0.0524    20.3559        0.9951   28.1283       0.0518    15.3054        0.3724   28.4379       0.0261    14.0208        0.4536   28.5331       0.0346    14.1740        0.3999   28.5213       0.0302    13.8806        0.4650   28.5440       0.0358    13.8076        0.4986   28.5497       0.0385
    2  104.8068   18.0821  53.1772152 -27.8052432  271  4.4331 2.8904      0.3480    -26.5497 0.4292    66.5797        2.4363   26.8416       0.0390    67.8081        1.7819   26.8218       0.0282    70.3934        2.1097   26.7812       0.0321    77.7411        2.3187   26.6734       0.0319    72.9007        0.8319   26.7432       0.0123    75.2725        1.0706   26.7084       0.0153    71.4879        0.9342   26.7644       0.0141    61.4277        0.9993   26.9291       0.0175    57.2204        1.0511   27.0061       0.0198
    3   15.0442   13.2187  53.1780609 -27.8052836    8  0.8502 0.6683      0.2140    -38.1612 0.1052     0.3019        0.2200   32.7004       0.5944     0.7673        0.2005   31.6875       0.2520     0.7185        0.2241   31.7589       0.2948     0.9352        0.2577   31.4727       0.2643     0.3497        0.0690   32.5407       0.1955     0.5608        0.1134   32.0281       0.1999     0.2669        0.0706   32.8343       0.2547    -0.0603        0.0828   99.0000      34.1055     0.1177        0.0820   33.7235       0.5742
    4  710.3243   14.2598  53.1715106 -27.8052754   25  1.2750 1.1174      0.1236    -59.2618 0.3374     2.6567        0.4371   30.3392       0.1654     3.8183        0.3606   29.9453       0.0980     3.9762        0.4246   29.9013       0.1102     3.5590        0.4266   30.0217       0.1229     1.6962        0.1267   30.8263       0.0782     1.5905        0.1668   30.8961       0.1083     1.9912        0.1511   30.6522       0.0794     1.9438        0.1789   30.6784       0.0956     1.6253        0.1710   30.8727       0.1086
    5  434.5295   22.2191  53.1741089 -27.8052090  268  3.9551 2.6288      0.3354     -8.1401 0.5364    48.2350        1.7920   27.1916       0.0396    54.2155        1.3659   27.0647       0.0270    58.2872        1.6236   26.9861       0.0298    83.0162        2.0149   26.6021       0.0260   133.1019        1.0561   26.0895       0.0086   133.4841        1.2827   26.0864       0.0104   144.0530        1.2385   26.0037       0.0093   161.5684        1.4303   25.8791       0.0096   148.3336        1.5722   25.9719       0.0114
    6  289.3880   17.2818  53.1754763 -27.8052500   17  1.2913 1.1979      0.0724     68.1227 0.1804     1.1304        0.3822   31.2670       0.3162     1.5011        0.2868   30.9589       0.1898     1.0456        0.2893   31.3516       0.2652     1.9553        0.3822   30.6720       0.1939     1.1886        0.1237   31.2124       0.1075     1.7708        0.1975   30.7795       0.1148     1.4921        0.1507   30.9655       0.1045     1.1434        0.1756   31.2545       0.1551     0.5927        0.1366   31.9680       0.2251
    7  640.4863   17.7734  53.1721685 -27.8052461   21  1.5125 0.8803      0.4180    -64.7268 0.2573     1.7319        0.3545   30.8037       0.2022     1.6434        0.2499   30.8606       0.1537     1.6361        0.2841   30.8655       0.1738     2.2296        0.3321   30.5294       0.1508     1.0400        0.0962   31.3575       0.0960     1.6538        0.1507   30.8538       0.0947     1.2605        0.1159   31.1487       0.0955     0.4079        0.1158   32.3737       0.2712     0.5688        0.1087   32.0126       0.1898
    8  762.7623   28.2899  53.1710166 -27.8051585  200  3.1603 2.3536      0.2553     37.5201 0.5417    52.8846        1.7906   27.0917       0.0362    55.8448        1.3404   27.0325       0.0258    61.6565        1.6300   26.9251       0.0283    87.7583        2.0320   26.5418       0.0249    85.9108        0.7872   26.5649       0.0099    73.6968        0.8932   26.7314       0.0131    74.6820        0.8363   26.7170       0.0121    70.6191        0.9001   26.7777       0.0138    73.9962        1.0387   26.7270       0.0151

Start new session and analyze results#

Load catalog and segmentation map#

# Catalog: ecsv format preserves units for loading in Python notebooks
tbl = QTable.read('JADESphotometry.ecsv')

# Reconstitute filter list
filters = []
for param in tbl.columns:
    if param[-4:] == '_mag':
        filters.append(param[:-4])

# Segmentation map
segmfile = 'JADES_detections_segm.fits'
segm = fits.open(segmfile)[0].data
segm = SegmentationImage(segm)

Plot number counts vs. magnitude#

fig = plt.figure(figsize=(8, 4))

filt = 'F200W'
mag1 = tbl[filt + '_mag']

mag1 = mag1[(0 < mag1) & (mag1 < 90)]  # detections only
n = plt.hist(mag1, histtype='step', label=filt)

plt.xlabel('AB magnitude')
plt.ylabel('Number counts')
plt.legend()
<matplotlib.legend.Legend at 0x7f5c74919050>
../../../_images/203c27bfe34fdc7d2d5e0ade179dc49876a00336171b42cae5981b9566867ff5.png

Plot F200W vs. F090W magnitudes and look for dropouts#

#import mplcursors
# Would love a better solution here!

mag1 = tbl['F090W_mag']
mag2 = tbl['F200W_mag']

# Only plot detections in F200W
det2 = (0 < mag2) & (mag2 < 90)

mag1 = mag1[det2]
mag2 = mag2[det2]
ids = tbl['label'][det2]

plt.figure(figsize=(8, 4))

plt.plot(mag1, mag2, '.')

for i in range(len(mag1)):
    plt.text(mag1[i], mag2[i], ids[i])

plt.xlabel('F090W AB magnitude')
plt.ylabel('F200W AB magnitude')
Text(0, 0.5, 'F200W AB magnitude')
../../../_images/be2b9f559b1e1326250e283de21f41923cd092cc94bea552ffb52aa00a7feaf5.png

Look at one object#

# Could select object by position
#x, y = 905, 276
#id = segm.data[y,x]

# Select by ID number
id = 261  # F090W dropout
obj = tbl[id-1]
obj
Row index=260
labelxcentroidycentroidsky_centroidareaabellipticityorientationginiF090W_fluxF090W_fluxerrF090W_magF090W_magerrF115W_fluxF115W_fluxerrF115W_magF115W_magerrF150W_fluxF150W_fluxerrF150W_magF150W_magerrF200W_fluxF200W_fluxerrF200W_magF200W_magerrF277W_fluxF277W_fluxerrF277W_magF277W_magerrF335M_fluxF335M_fluxerrF335M_magF335M_magerrF356W_fluxF356W_fluxerrF356W_magF356W_magerrF410M_fluxF410M_fluxerrF410M_magF410M_magerrF444W_fluxF444W_fluxerrF444W_magF444W_magerr
deg,degpix2pixpixdegnJynJynJynJynJynJynJynJynJynJynJynJynJynJynJynJynJynJy
int32float64float64SkyCoordfloat64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64
261713.6003231522444868.286273146934453.17147927632734,-27.79815855888541111.02.19573642379047441.8718598618520150.14750247726881305-17.3387743379370680.54624528398523883.2106453728223.52725413558831826.5995527740889770.0450750261677540584.188464326889232.58799749117907426.5868685308231180.03287337692009984.424816461791983.05488635392334826.5838246871020440.03859293458114375478.7288368652023.13178772987917926.6596654118736680.0423530468259579845.2587793950387860.939761047145372727.2607429072804130.02231354487644226435.2778093527472051.005126721872933627.531245977753050.0305020368304290332.913033723701360.912697578809134627.606580213077470.0296981998075490824.753535319264160.919737711771397827.9159069150581870.03961001376295534425.4013154001160761.040221774063961727.8878594824442380.043576230399079735
obj['ellipticity']
\[0.14750248 \; \mathrm{}\]
segmobj = segm.segments[segm.get_index(id)]
segmobj
<photutils.segmentation.core.Segment>
label: 261
slices: (slice(863, 874, None), slice(708, 720, None))
area: 111

Show the object in all the images#

fig, ax = plt.subplots(2, len(filters)+1, figsize=(9.5, 3.5), sharex=True, sharey=True)

ax[0, 0].imshow(rgb[segmobj.slices], origin='lower', extent=segmobj.bbox.extent)
ax[0, 0].set_title('Color')

cmap = segm.make_cmap(seed=12345)  # ERROR
ax[1, 0].imshow(segm.data[segmobj.slices], origin='lower', extent=segmobj.bbox.extent, cmap=cmap,
               interpolation='nearest')
ax[1, 0].set_title('Segment')

for i in range(1, len(filters)+1):
    filt = filters[i-1]

    # Show data on top row
    data = fits.open(imagefiles[filt])[0].data
    stamp = data[segmobj.slices]
    norm = ImageNormalize(stretch=SqrtStretch())  # scale each filter individually
    ax[0, i].imshow(stamp, extent=segmobj.bbox.extent, cmap='Greys_r', norm=norm, origin='lower')
    ax[0, i].set_title(filt.upper())

    # Show weights on bottom row
    weight = fits.open(weightfiles[filt])[0].data
    stamp = weight[segmobj.slices]
    # set black to zero weight (no exposure time / bad pixel)
    ax[1, i].imshow(stamp, extent=segmobj.bbox.extent, vmin=0, cmap='Greys_r', origin='lower')

ax[0, 0].set_ylabel('Data')
ax[1, 0].set_ylabel('Weight')
Text(0, 0.5, 'Weight')
../../../_images/618e316140f2de7864282e01d677d9b3ddc1f55fbc27303269709ecdad31c1c0.png

Plot SED (Spectral Energy Distribution)#

fig, ax = plt.subplots(figsize=(8, 6))

for filt in filters:
    lam = int(filt[1:4]) / 100
    plt.errorbar(lam, obj[filt+'_flux'].value, obj[filt+'_fluxerr'].value, marker='.', c='b')

plt.axhline(0, c='k', ls=':')
plt.xlim(0, 5)
plt.xlabel('Wavelength ($\mu$m)')
plt.ylabel('Flux (nJy)')

mlim = 31.4
flim = mlim * u.ABmag
flim = flim.to(u.nJy).value

# Add AB magnitudes as secondary x-axis at right
# https://matplotlib.org/gallery/subplots_axes_and_figures/secondary_axis.html#sphx-glr-gallery-subplots-axes-and-figures-secondary-axis-py
def AB2nJy(mAB):
    m = mAB * u.ABmag
    f = m.to(u.nJy)
    f = f.value
    f = np.where(f > flim, f, flim)
    return f

def nJy2AB(F_nJy):
    f = F_nJy * u.nJy
    m = f.to(u.ABmag)
    m = m.value
    m = np.where(m < mlim, m, mlim)
    return m
    
plt.ylim(flim, plt.ylim()[1])

secax = ax.secondary_yaxis('right', functions=(nJy2AB, AB2nJy))
secax.set_ylabel('magnitude (AB)')
Text(0, 0.5, 'magnitude (AB)')
../../../_images/93e99184bf6a605df4c060e1a21486e3715d68829adae10d4be9978d0312ca80.png

Magnitude conversion fails for flux <= 0#

fig, ax = plt.subplots(figsize=(8, 6))

for filt in filters:
    lam = int(filt[1:4]) / 100
    plt.errorbar(lam, obj[filt+'_flux'].value, obj[filt+'_fluxerr'].value, marker='.', c='b')

plt.axhline(0, c='k', ls=':')
plt.xlim(0, 5)
plt.xlabel('Wavelength ($\mu$m)')
plt.ylabel('Flux (nJy)')

f0 = 10**(0.4 * 31.4)  # flux [nJy] at zero magnitude
b0 = 1.e-12  # this should be filter dependent

# Add AB magnitudes as secondary x-axis at right
# https://matplotlib.org/gallery/subplots_axes_and_figures/secondary_axis.html#sphx-glr-gallery-subplots-axes-and-figures-secondary-axis-py
def AB2nJy(m):
    f = np.sinh(-0.4 * m * np.log(10) - np.log(b0)) * 2 * b0 * f0
    return f

# Luptitudes
# https://www.sdss.org/dr12/algorithms/magnitudes/
def nJy2AB(f):
    m = -2.5 / np.log(10) * (np.arcsinh((f / f0) / (2 * b0)) + np.log(b0))
    return m

#plt.ylim(flim, plt.ylim()[1])

secax = ax.secondary_yaxis('right', functions=(nJy2AB, AB2nJy))
secax.set_ylabel('asinh magnitude (AB)')
Text(0, 0.5, 'asinh magnitude (AB)')
../../../_images/89219e554d8dd762c31e1338ed75bf2ab1f621d16f93c6314af449edef54268d.png