Ejemplo n.º 1
0
img_array_NH = hdu_nH[0].data
img_array_Av = img_array_NH / 0.221  # NH to Av
img_array_A_ch1 = img_array_Av * 0.063  # A_ch1/A_v = 0.56/8.8
img_array_A_ch1[img_array_A_ch1 == 0] = np.nan

header = hdu_nH[0].header
header['history'] = '--------------------------------------------------'
header['history'] = 'Used script:    4_2extinction_to_Ach1.py'
header['history'] = 'Author:         Vladimir Domcek'
header['history'] = 'Date and time:  ' + time.strftime('%X %x %Z')
header['history'] = 'Main changes: '
header['history'] = 'Hwang and Laming extinction grid converted to extinction in 3.5micron'
header['history'] = 'NH to Av based on relations of Grover and Ozel (2009) '
header['history'] = 'and Av to Ach1 based on Indebetouw et al (2005)'

hdu_nH[0].data = img_array_A_ch1
hdu_nH.writeto(outpath + '4_ext_grid_A_ch1.fits', overwrite=True)


plt.clf()
wcs_hdr = WCS(hdu_nH[0].header)
fig, ax = mp.plot_casa(figsize=[8, 6], coords=True, wcs=wcs_hdr)
im = ax.imshow(img_array_A_ch1, origin='lower', cmap='magma')  # , norm=LogNorm(vmin=2e-4, vmax=7e-3))
cbar = mp.set_colorbar(fig, im, title=r'A$_{ch1}$ [mag]')
cmap = cm.get_cmap()
cmap.set_bad(color='black')
ax.set_title('Ch1 extinction map')
plt.savefig(outpath + '4_ch1-band_extintion_map.pdf', bbox_inches='tight')
plt.show()
plt.close(fig)
Ejemplo n.º 2
0
#  MASKS
extinction_mask = fits.open(outpath + '4_mask_bin3_NH_extinction.fits')[0].data
# extinction_mask[np.isnan(extinction_mask)] = 0

radio_hires_lowflux_mask = fits.open(outpath +
                                     '5_mask_radio_hires_lowflux.fits')[0].data
# radio_hires_lowflux_mask[np.isnan(radio_hires_lowflux_mask)] = 0

spitzer_stars_mask = fits.open(outpath +
                               '5_mask_bin3_spitzer_stars_daosf.fits')[0].data
# spitzer_stars_mask[np.isnan(spitzer_stars_mask)] = 0

the_mask = extinction_mask * radio_hires_lowflux_mask * spitzer_stars_mask

plt.clf()
fig, ax = plot_casa(coords=True, wcs=wcs_hdr)
cmap = cm.get_cmap('viridis')
cmap.set_bad(color='white')
im = ax.imshow(img_spitzer_bin3,
               cmap=cmap,
               origin='lower',
               norm=LogNorm(vmin=8e-6, vmax=1e-4))
cbar = set_colorbar(fig, im, title=r'Flux density [Jy]')
ax.set_title(r'Spitzer data')
ax.set_xlim(0, 480)
ax.set_ylim(0, 480)
plt.savefig(outpath + '5_1Spitzer_bin3_ch1_jy.pdf', bbox_inches='tight')
plt.show()
plt.close(fig)

plt.clf()