diff --git a/data/IC5063_x3nl030/IR/Figure_3.png b/data/IC5063_x3nl030/IR/Figure_3.png new file mode 100644 index 0000000..a013331 Binary files /dev/null and b/data/IC5063_x3nl030/IR/Figure_3.png differ diff --git a/plots/IC5063_x3nl030/IR_overplot.png b/plots/IC5063_x3nl030/IR_overplot.png new file mode 100644 index 0000000..cf1f5a7 Binary files /dev/null and b/plots/IC5063_x3nl030/IR_overplot.png differ diff --git a/plots/IC5063_x3nl030/IR_overplot_forced.png b/plots/IC5063_x3nl030/IR_overplot_forced.png new file mode 100644 index 0000000..93b3ef7 Binary files /dev/null and b/plots/IC5063_x3nl030/IR_overplot_forced.png differ diff --git a/plots/IC5063_x3nl030/S2_overplot.png b/plots/IC5063_x3nl030/S2_overplot.png new file mode 100644 index 0000000..4fa218d Binary files /dev/null and b/plots/IC5063_x3nl030/S2_overplot.png differ diff --git a/plots/IC5063_x3nl030/S2_overplot_forced.png b/plots/IC5063_x3nl030/S2_overplot_forced.png index 4b4019b..2ceccf8 100644 Binary files a/plots/IC5063_x3nl030/S2_overplot_forced.png and b/plots/IC5063_x3nl030/S2_overplot_forced.png differ diff --git a/src/FOC_reduction.py b/src/FOC_reduction.py index df9c5a0..8ca2624 100755 --- a/src/FOC_reduction.py +++ b/src/FOC_reduction.py @@ -113,7 +113,7 @@ def main(): display_data = False # Smoothing smoothing_function = 'combine' #gaussian_after, weighted_gaussian_after, gaussian, weighted_gaussian or combine - smoothing_FWHM = 0.10 #If None, no smoothing is done + smoothing_FWHM = 0.20 #If None, no smoothing is done smoothing_scale = 'arcsec' #pixel or arcsec # Rotation rotate_stokes = True #rotation to North convention can give erroneous results diff --git a/src/lib/plots.py b/src/lib/plots.py index 359c052..1875118 100755 --- a/src/lib/plots.py +++ b/src/lib/plots.py @@ -15,6 +15,7 @@ import matplotlib.pyplot as plt from matplotlib.patches import Rectangle from matplotlib.path import Path from matplotlib.widgets import RectangleSelector, Button, Slider, TextBox, LassoSelector +from matplotlib.colors import LogNorm import matplotlib.font_manager as fm from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar, AnchoredDirectionArrows from astropy.wcs import WCS @@ -391,14 +392,20 @@ class align_maps(object): self.other_map = other_map self.wcs_map = WCS(self.map[0]).deepcopy() - if self.wcs_map.naxis > 2: + if self.wcs_map.naxis == 4: self.wcs_map = WCS(self.map[0],naxis=[1,2]).deepcopy() self.map[0].data = self.map[0].data[0,0] + elif self.wcs_map.naxis == 3: + self.wcs_map = WCS(self.map[0],naxis=[1,2]).deepcopy() + self.map[0].data = self.map[0].data[1] self.wcs_other = WCS(self.other_map[0]).deepcopy() - if self.wcs_other.naxis > 2: + if self.wcs_other.naxis == 4: self.wcs_other = WCS(self.other_map[0],naxis=[1,2]).deepcopy() self.other_map[0].data = self.other_map[0].data[0,0] + elif self.wcs_other.naxis == 3: + self.wcs_other = WCS(self.other_map[0],naxis=[1,2]).deepcopy() + self.other_map[0].data = self.other_map[0].data[1] try: convert_flux = self.map[0].header['photflam'] @@ -442,7 +449,7 @@ class align_maps(object): self.ax2.set_facecolor('k') vmin, vmax = 0., np.max(other_data[other_data > 0.]*other_convert) - im2 = self.ax2.imshow(other_data*other_convert, vmin=vmin, vmax=vmax, aspect='auto', cmap='inferno', alpha=1.) + im2 = self.ax2.imshow(other_data*other_convert, norm=LogNorm(), aspect='auto', cmap='inferno', alpha=1.) fontprops = fm.FontProperties(size=16) px_size = self.wcs_other.wcs.get_cdelt()[0]*3600. @@ -605,7 +612,9 @@ class overplot_pol(align_maps): Class to overplot maps from different observations. Inherit from class align_maps in order to get the same WCS on both maps. """ - def overplot(self, SNRp_cut=3., SNRi_cut=30., savename=None): + def overplot(self, SNRp_cut=3., SNRi_cut=30., savename=None, **kwargs): + self.Stokes_UV = self.map + self.wcs_UV = self.wcs_map #Get Data obj = self.Stokes_UV[0].header['targname'] stkI = self.Stokes_UV[np.argmax([self.Stokes_UV[i].header['datatype']=='I_stokes' for i in range(len(self.Stokes_UV))])] @@ -653,7 +662,7 @@ class overplot_pol(align_maps): #Display "other" intensity map vmin, vmax = 0., np.max(other_data[other_data > 0.]*other_convert) - im = self.ax.imshow(other_data*other_convert, vmin=vmin, vmax=vmax, transform=self.ax.get_transform(self.wcs_other), cmap='inferno', alpha=1.) + im = self.ax.imshow(other_data*other_convert, transform=self.ax.get_transform(self.wcs_other), cmap='inferno', alpha=1., **kwargs) cbar_ax = self.fig2.add_axes([0.95, 0.12, 0.01, 0.75]) cbar = plt.colorbar(im, cax=cbar_ax, label=r"$F_{\lambda}$ [$ergs \cdot cm^{-2} \cdot s^{-1} \cdot \AA^{-1}$]") @@ -673,10 +682,10 @@ class overplot_pol(align_maps): self.fig2.canvas.draw() - def plot(self, SNRp_cut=3., SNRi_cut=30., savename=None) -> None: + def plot(self, SNRp_cut=3., SNRi_cut=30., savename=None, **kwargs) -> None: self.align() if self.aligned: - self.overplot(SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, savename=savename) + self.overplot(SNRp_cut=SNRp_cut, SNRi_cut=SNRi_cut, savename=savename, **kwargs) plt.show(block=True) diff --git a/src/overplot.py b/src/overplot.py index 7a9b4e1..f84170c 100755 --- a/src/overplot.py +++ b/src/overplot.py @@ -2,7 +2,8 @@ from astropy.io import fits import numpy as np from copy import deepcopy -from lib.plots import overplot_radio +from lib.plots import overplot_radio, overplot_pol +from matplotlib.colors import LogNorm Stokes_UV = fits.open("../data/IC5063_x3nl030/IC5063_FOC_combine_FWHM020.fits") Stokes_18GHz = fits.open("../data/IC5063_x3nl030/radio/IC5063.18GHz.fits") @@ -10,6 +11,8 @@ Stokes_24GHz = fits.open("../data/IC5063_x3nl030/radio/IC5063.24GHz.fits") Stokes_103GHz = fits.open("../data/IC5063_x3nl030/radio/I5063_103GHz.fits") Stokes_229GHz = fits.open("../data/IC5063_x3nl030/radio/I5063_229GHz.fits") Stokes_357GHz = fits.open("../data/IC5063_x3nl030/radio/I5063_357GHz.fits") +Stokes_S2 = fits.open("../data/IC5063_x3nl030/POLARIZATION_COMPARISON/S2_rot_crop.fits") +Stokes_IR = fits.open("../data/IC5063_x3nl030/IR/u2e65g01t_c0f_rot.fits") levelsMorganti = np.array([1.,2.,3.,8.,16.,32.,64.,128.]) @@ -34,3 +37,9 @@ D.plot(levels=levels229GHz, SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC50 levels357GHz = np.linspace(1,99,11)/100.*np.max(deepcopy(Stokes_357GHz[0].data[Stokes_357GHz[0].data > 0.])) E = overplot_radio(Stokes_UV, Stokes_357GHz) E.plot(levels=levels357GHz, SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/357GHz_overplot_forced.png') + +F = overplot_pol(Stokes_UV, Stokes_S2) +F.plot(SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/S2_overplot_forced.png', norm=LogNorm(vmin=5e-20,vmax=5e-18)) + +G = overplot_pol(Stokes_UV, Stokes_IR) +G.plot(SNRp_cut=3.0, SNRi_cut=80.0, savename='../plots/IC5063_x3nl030/IR_overplot_forced.png', norm=LogNorm(vmin=1e-17,vmax=5e-15))