diff --git a/include/Figures.h b/include/Figures.h index 0da6877..458d787 100644 --- a/include/Figures.h +++ b/include/Figures.h @@ -22,6 +22,7 @@ void Likelihood_Table(); // visualizations void IC_SkyMap(); void MW_SkyMap(); +void MW_Visualization(); // testing void vMF_test(); diff --git a/py/MW_Visualization.py b/py/MW_Visualization.py new file mode 100644 index 0000000..f6beaaf --- /dev/null +++ b/py/MW_Visualization.py @@ -0,0 +1,45 @@ +""" +This code is free to use, copy, distribute, and modify. +If you use this code or any modification of this code, we request that you reference both this code https://zenodo.org/record/x and the paper https://arxiv.org/abs/17xx.xxxxx. +""" + +import matplotlib.pyplot as plt +import numpy as np +from matplotlib.colors import LogNorm + +R_0 = 8.29 + +N_Bins = 400 + +data = np.genfromtxt("data/MW_Visualization.txt").transpose() + +data /= 1e3 # pc to kpc + +plt.rcParams["font.size"] = 12 + +f, (a0, a1) = plt.subplots(2, 1, gridspec_kw = {"width_ratios": [5, 1]}) + +v = [[-15, 15], [-15, 15]] # just the MW +a0.hist2d(data[0], data[1], bins = N_Bins, cmap = plt.cm.Oranges, norm = LogNorm(), range = v) +a0.set_aspect("equal") + +a0.text(-R_0, 0, r"$\odot$", verticalalignment = "center", horizontalalignment = "center") + +a0.set_xlabel(r"$x{\rm\ (kpc)}$") +a0.set_ylabel(r"$y{\rm\ (kpc)}$") + +v = [[-15, 15], [-3, 3]] # just the MW +a1.hist2d(data[0], data[2], bins = N_Bins, cmap = plt.cm.Oranges, norm = LogNorm(), range = v) +a1.set_aspect("equal") + +a1.text(-R_0, 0, r"$\odot$", verticalalignment = "center", horizontalalignment = "center") + +a1.set_xlabel(r"$x{\rm\ (kpc)}$") +a1.set_ylabel(r"$z{\rm\ (kpc)}$") + +a1.set_yticks([-3, 0, 3]) + +f.subplots_adjust(hspace = 0) + +f.savefig("fig/MW_Visualization.eps") + diff --git a/src/Figures.cpp b/src/Figures.cpp index 31408b5..3d861ac 100644 --- a/src/Figures.cpp +++ b/src/Figures.cpp @@ -211,12 +211,12 @@ void MW_SkyMap() std::cout << "Done." << std::endl; } -void MW_SkyMap_old() +void MW_Visualization() { - std::ofstream data("data/MW_SkyMap.txt"); + std::ofstream data("data/MW_Visualization.txt"); int N_Repeat; coord_cart coord_c; - N_Repeat = 1e7; + N_Repeat = 1e6; Progress_Bar *pbar = new Progress_Bar(); diff --git a/src/ICEvent.cpp b/src/ICEvent.cpp index 5f7986a..90e8f27 100644 --- a/src/ICEvent.cpp +++ b/src/ICEvent.cpp @@ -4,7 +4,6 @@ If you use this code or any modification of this code, we request that you refer */ #include -#include #include #include #include diff --git a/src/Likelihood.cpp b/src/Likelihood.cpp index 914b87d..35a337c 100644 --- a/src/Likelihood.cpp +++ b/src/Likelihood.cpp @@ -10,7 +10,6 @@ If you use this code or any modification of this code, we request that you refer #include #include #include - #include #include "Likelihood.h" diff --git a/src/MWDisks.cpp b/src/MWDisks.cpp index 9c3129a..c7117f6 100644 --- a/src/MWDisks.cpp +++ b/src/MWDisks.cpp @@ -11,7 +11,6 @@ If you use this code or any modification of this code, we request that you refer #include "Coordinates.h" #include "rng.h" -// soft disk model // initialize the MCMC points MCMC_point::MCMC_point(double x, double y, double z, int section) : x(x), y(y), z(z), section(section) diff --git a/src/main.cpp b/src/main.cpp index 189ff0d..e6f32d2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,6 +26,7 @@ int main() Likelihood_Table(); // IC_SkyMap(); // MW_SkyMap(); +// MW_Visualization(); vMF_test(); return 0;