In [3]:
import astropy
import astropy.io.fits as pyfits
import matplotlib
import matplotlib.pyplot as pyplot
import os
#Choose from <instrument> = "hst-acs", "hst-wfc3", "jwst-miri", "jwst-nircam", or "wfirst-wfidrm15".
mast_filename='https://archive.stsci.edu/hlsps/illustris/mag30-fielda-11-10_images/hlsp_misty_illustris_jwst-nircam_mag30-fielda-11-10_f200w_v1_lightcone.fits'
hdu_list=pyfits.open(mast_filename)
print(hdu_list.info())
In [4]:
hdu_list['IMAGE_NOPSF'].header
Out[4]:
In [5]:
hdu_list['SimulationAssumptions'].header
Out[5]:
In [6]:
hdu_list['MockDataAssumptions'].header
Out[6]:
In [7]:
hdu_list['IMAGE_PSF'].header
Out[7]:
In [8]:
cat=hdu_list['catalog'].data
print(np.asarray(cat.columns.names))
newi=cat['new_i'] ; newj=cat['new_j']
In [9]:
image=hdu_list['IMAGE_PSF'].data
print(image.shape)
In [11]:
fig=pyplot.figure(figsize=(16,8))
pyplot.imshow(np.log10(image+1.0e-1))
pyplot.show()
In [12]:
fig=pyplot.figure(figsize=(16,8),dpi=600)
pyplot.imshow(np.log10(image[0:1000,0:2000]+7.0e-3))
pyplot.plot(newj,newi,'or',markersize=2,alpha=0.3) ; pyplot.xlim(0,2000) ; pyplot.ylim(0,1000)
z=cat['true_z']
zi= z > 4
pyplot.plot(newj[zi],newi[zi],marker='o',markersize=8,markerfacecolor='None',markeredgecolor='Gray',linestyle='None',markeredgewidth=2)
m=cat['mstar_msun_rad']
mi=m>1.0e10
pyplot.plot(newj[mi],newi[mi],marker='o',markersize=20,markerfacecolor='None',markeredgecolor='Orange',linestyle='None',markeredgewidth=4)
distmod=cat['g_AB_appmag']-cat['g_AB_absmag']
h=cat['AB_absmag_jwst-nircam_f200w']+distmod
hi=h>29.0
pyplot.plot(newj[hi],newi[hi],marker='s',markersize=15,markerfacecolor='None',markeredgecolor='DodgerBlue',linestyle='None',markeredgewidth=3)
pyplot.legend(['all sources',r'$z > 4$',r'$M_* > 10^{10} M_{\odot}$',r'$g > 29$'],loc='upper left',fontsize=24,framealpha=1.0)
pyplot.show()
In [ ]: