diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-07-17 16:59:46 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-07-17 16:59:46 +0800 |
commit | c8c9045555ebbb6bac1ac8dc29f54c20d579c713 (patch) | |
tree | 2de56d9c7b67634b4852c67625f098a3c7464f32 | |
parent | c8f44aabfa2edbb3b99cfdeffa89900389a9c8ac (diff) | |
download | cexcess-c8c9045555ebbb6bac1ac8dc29f54c20d579c713.tar.bz2 |
deproject_sbp.py: ignore non-finite numbers for plot
-rwxr-xr-x | deproject_sbp.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/deproject_sbp.py b/deproject_sbp.py index 5abb593..a7dcc82 100755 --- a/deproject_sbp.py +++ b/deproject_sbp.py @@ -2,9 +2,11 @@ # # Aaron LI # Created: 2016-06-10 -# Updated: 2016-07-15 +# Updated: 2016-07-17 # # Change logs: +# 2016-07-17: +# * Ignore non-finite numbers of deprojected density for plot # 2016-07-15: # * Do not repeat electron number density calculation # 2016-07-11: @@ -612,11 +614,12 @@ class BrightnessProfile: ax.set_ylabel(r"Surface brightness (%s)" % s_unit) # deprojected density profile ax2 = ax.twinx() - line2, = ax2.plot(r, density, color="black", + mask = np.isfinite(density) + line2, = ax2.plot(r[mask], density[mask], color="black", linestyle="solid", linewidth=2, label="Density profile") - d_min = min(density) / 1.2 - d_max = max(density) * 1.2 + d_min = min(density[mask]) / 1.2 + d_max = max(density[mask]) * 1.2 ax2.set_xlim(r_min, r_max) ax2.set_ylim(d_min, d_max) ax2.set_yscale(ax.get_yscale()) |