NGC1068 overplot
This commit is contained in:
@@ -40,23 +40,23 @@ def main(infile, target=None, output_dir=None):
|
||||
if target is None:
|
||||
target = Stokes[0].header["TARGNAME"]
|
||||
|
||||
fig = figure(figsize=(8,8),layout="constrained")
|
||||
fig, ax = polarization_map(Stokes, P_cut=0.99, step_vec=2, scale_vec=5, display="i", fig=fig)
|
||||
fig = figure(figsize=(8, 8.5), layout="constrained")
|
||||
fig, ax = polarization_map(Stokes, P_cut=0.99, step_vec=1, scale_vec=3, display="i", fig=fig, width=0.33, linewidth=0.5)
|
||||
|
||||
ax.plot(*Stokescenter, marker="+", color="gray", label="Best confidence for center: {0}".format(Stokespos.to_string("hmsdms")))
|
||||
confcentcont = ax.contour(Stokescentconf, [0.001], colors="gray")
|
||||
confcentcont = ax.contour(Stokescentconf, [0.01], colors="gray")
|
||||
confcont = ax.contour(Stokesconf, [0.9905], colors="r")
|
||||
snr3cont = ax.contour(Stokessnr, [3.0], colors="b", linestyles="dashed")
|
||||
snr4cont = ax.contour(Stokessnr, [4.0], colors="b")
|
||||
# snr3cont = ax.contour(Stokessnr, [3.0], colors="b", linestyles="dashed")
|
||||
# snr4cont = ax.contour(Stokessnr, [4.0], colors="b")
|
||||
handles, labels = ax.get_legend_handles_labels()
|
||||
labels.append(r"Center $Conf_{99.9\%}$ contour")
|
||||
labels.append(r"Center $Conf_{99\%}$ contour")
|
||||
handles.append(Rectangle((0, 0), 1, 1, fill=False, ec=confcentcont.get_edgecolor()[0]))
|
||||
labels.append(r"Polarization $Conf_{99\%}$ contour")
|
||||
handles.append(Rectangle((0, 0), 1, 1, fill=False, ec=confcont.get_edgecolor()[0]))
|
||||
labels.append(r"$SNR_P \geq$ 3 contour")
|
||||
handles.append(Rectangle((0, 0), 1, 1, fill=False, ls="--", ec=snr3cont.get_edgecolor()[0]))
|
||||
labels.append(r"$SNR_P \geq$ 4 contour")
|
||||
handles.append(Rectangle((0, 0), 1, 1, fill=False, ec=snr4cont.get_edgecolor()[0]))
|
||||
# labels.append(r"$SNR_P \geq$ 3 contour")
|
||||
# handles.append(Rectangle((0, 0), 1, 1, fill=False, ls="--", ec=snr3cont.get_edgecolor()[0]))
|
||||
# labels.append(r"$SNR_P \geq$ 4 contour")
|
||||
# handles.append(Rectangle((0, 0), 1, 1, fill=False, ec=snr4cont.get_edgecolor()[0]))
|
||||
ax.legend(handles=handles, labels=labels, bbox_to_anchor=(0.0, -0.02, 1.0, 0.01), loc="upper left", mode="expand", borderaxespad=0.0)
|
||||
|
||||
if output_dir is not None:
|
||||
|
||||
42
package/src/overplot_NGC1068.py
Executable file
42
package/src/overplot_NGC1068.py
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding:utf-8 -*-
|
||||
from pathlib import Path
|
||||
from sys import path as syspath
|
||||
|
||||
syspath.append(str(Path(__file__).parent.parent))
|
||||
|
||||
import numpy as np
|
||||
from astropy.io import fits
|
||||
from lib.plots import overplot_pol, plt
|
||||
from matplotlib.colors import LogNorm
|
||||
|
||||
Stokes_UV = fits.open("./data/NGC1068/5144/NGC1068_FOC_b0.05arcsec_c0.07arcsec_crop.fits")
|
||||
Radio = fits.open("./data/NGC1068/MERLIN-VLA/Combined_crop.fits")
|
||||
|
||||
levels = np.logspace(-0.5, 1.99, 7) / 100.0 * Stokes_UV[0].data.max() * Stokes_UV[0].header["photflam"]
|
||||
A = overplot_pol(Stokes_UV, Radio, norm=LogNorm())
|
||||
A.plot(
|
||||
levels=levels,
|
||||
P_cut=0.99,
|
||||
SNRi_cut=1.0,
|
||||
scale_vec=3,
|
||||
step_vec=1,
|
||||
norm=LogNorm(5e-5, 1e-1),
|
||||
cmap="inferno_r",
|
||||
width=0.8,
|
||||
linewidth=1.2,
|
||||
)
|
||||
A.add_vector(
|
||||
A.other_wcs.celestial.wcs.crpix - (1.0, 1.0),
|
||||
pol_deg=0.124,
|
||||
pol_ang=100.7,
|
||||
width=2,
|
||||
linewidth=2,
|
||||
scale=1.0 / (A.px_scale * 6.0),
|
||||
edgecolor="b",
|
||||
color="b",
|
||||
label=r"IXPE torus: P = $12.4 (\pm 3.6)$%, PA = $100.7 (\pm 8.3)$°",
|
||||
)
|
||||
A.fig_overplot.savefig("./plots/NGC1068/NGC1068_radio_overplot_full.pdf", dpi=300, bbox_inches="tight")
|
||||
plt.show()
|
||||
A.write_to(path1="./data/NGC1068/FOC_Radio.fits", path2="./data/NGC1068/Radio_FOC.fits", suffix="aligned")
|
||||
Reference in New Issue
Block a user