image_output_2.png image_output_1.png
from astropy.io import fits

from scipy.ndimage import gaussian_filter

from skimage import data, io, filters

import matplotlib.pyplot as plt

NEAR_INFRARED_PATH = '../input/center-of-all-observable-galaxiesfits-allesa/GALAXIES_CENTER/NGC6946/NEAR_INFRARED/n4k48nbsq_cal.fits'
HST_OPTICAL_PATH = '../input/center-of-all-observable-galaxiesfits-allesa/GALAXIES_CENTER/NGC6946/OPTICAL/HST/idk404050/idk404050_drc.fits'
XMM_NEWTON_PATH = '../input/center-of-all-observable-galaxiesfits-allesa/GALAXIES_CENTER/NGC6946/XMM_NEWTON_Soft_Xray/P0200670301EPX0003COLIM8000.FTZ'
XMM_OM_PATH = '../input/center-of-all-observable-galaxiesfits-allesa/GALAXIES_CENTER/NGC6946/XMM_OM_Optical/P0200670301OMX000LSIMAGB000.FTZ'
ISO_PATH = '../input/center-of-all-observable-galaxiesfits-allesa/GALAXIES_CENTER/NGC6946/ISO/csp3390040401.fits'
NI_OPEN = fits.open(NEAR_INFRARED_PATH)
HST_OPEN = fits.open(HST_OPTICAL_PATH)
XMM_NEWTON_OPEN = fits.open(XMM_NEWTON_PATH)
XMM_OM_OPEN = fits.open(XMM_OM_PATH)
ISO_OPEN = fits.open(ISO_PATH)
HST_SCI = HST_OPEN[1].data
ZOOMED_X3_SCALE_HST = HST_SCI[2450:2850, 2300:2700]
NUCLEUS_SCALE_HST = HST_SCI[2640:2850, 2330:2650]
SATO_ZOOMED_X3_SCALE_HST = filters.sato(ZOOMED_X3_SCALE_HST)
SATO_NUCLEUS_SCALE_HST = filters.sato(NUCLEUS_SCALE_HST)
M_ZOOMED_X3_SCALE_HST = filters.meijering(ZOOMED_X3_SCALE_HST)
M_NUCLEUS_SCALE_HST = filters.meijering(NUCLEUS_SCALE_HST)
BM_ZOOMED_X3_SCALE_HST = filters.meijering(ZOOMED_X3_SCALE_HST, black_ridges=False)
BM_NUCLEUS_SCALE_HST = filters.meijering(NUCLEUS_SCALE_HST, black_ridges=False)

SPECTRAL_LIST = ['gray', 'jet', 'hot', 'prism', 'nipy_spectral', 'gist_ncar', 'gist_earth', 'gist_stern', 'flag', 'gnuplot2', 'terrain']

GAUSS_ZOOMED_X2 = gaussian_filter(ZOOMED_X3_SCALE_HST, sigma=7)
GAUSS_NUCLEUS = gaussian_filter(NUCLEUS_SCALE_HST, sigma=7)

for x_spec in SPECTRAL_LIST:
    figure, axis = plt.subplots(1, 2, figsize=(20, 20))
    axis[0].imshow(GAUSS_ZOOMED_X2, cmap=x_spec)
    axis[0].set_title('ZOOMED' + ' / ' + x_spec)
    axis[0].axis('off')
    DENSITY_FUNC = axis[1].imshow(GAUSS_NUCLEUS, cmap=x_spec)
    axis[1].set_title('NUCLEUS' + ' / ' + x_spec)
    axis[1].axis('off')
    figure.colorbar(DENSITY_FUNC, shrink=0.3, label='DENSITY', location='right', extend='max')
    plt.tight_layout()
    plt.show()