Skip to content

Commit 7dab470

Browse files
committed
handle logarithm of null values for plot of full-sky probability map
1 parent 0ab1b75 commit 7dab470

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

skyreader/plot/plot.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,17 @@ def create_plot(
135135
self.PLOT_COLORMAP.name.rstrip('_r')
136136
]
137137
text_colorbar = r"log10$(p)$"
138-
vmin = np.nanmin(np.log10(equatorial_map))
139-
vmax = np.nanmax(np.log10(equatorial_map))
140-
map_to_plot = np.log10(plotting_map)
138+
vmin = np.nanmin(
139+
np.log10(equatorial_map[equatorial_map != 0.])
140+
)
141+
vmax = np.nanmax(
142+
np.log10(equatorial_map[equatorial_map != 0.])
143+
)
144+
map_to_plot = copy.copy(plotting_map)
145+
map_to_plot[plotting_map != 0.] = np.log10(
146+
plotting_map[plotting_map != 0.]
147+
)
148+
map_to_plot[plotting_map == 0.] = np.nan
141149
equatorial_map = np.ma.masked_invalid(equatorial_map)
142150
map_to_plot = np.ma.masked_invalid(map_to_plot)
143151

0 commit comments

Comments
 (0)