Skip to content

Commit

Permalink
re added MW visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDenton committed Mar 28, 2017
1 parent d6778c7 commit 8a2d8ba
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 6 deletions.
1 change: 1 addition & 0 deletions include/Figures.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void Likelihood_Table();
// visualizations
void IC_SkyMap();
void MW_SkyMap();
void MW_Visualization();

// testing
void vMF_test();
Expand Down
45 changes: 45 additions & 0 deletions py/MW_Visualization.py
Original file line number Diff line number Diff line change
@@ -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")

6 changes: 3 additions & 3 deletions src/Figures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
1 change: 0 additions & 1 deletion src/ICEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ If you use this code or any modification of this code, we request that you refer
*/

#include <cmath>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
Expand Down
1 change: 0 additions & 1 deletion src/Likelihood.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ If you use this code or any modification of this code, we request that you refer
#include <string>
#include <sstream>
#include <fstream>

#include <iostream>

#include "Likelihood.h"
Expand Down
1 change: 0 additions & 1 deletion src/MWDisks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ int main()
Likelihood_Table();
// IC_SkyMap();
// MW_SkyMap();
// MW_Visualization();
vMF_test();

return 0;
Expand Down

0 comments on commit 8a2d8ba

Please sign in to comment.