Skip to content

Commit

Permalink
handle logarithm of null values for plot of full-sky probability map
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Sommani committed Dec 11, 2024
1 parent 0ab1b75 commit 7dab470
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions skyreader/plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,17 @@ def create_plot(
self.PLOT_COLORMAP.name.rstrip('_r')
]
text_colorbar = r"log10$(p)$"
vmin = np.nanmin(np.log10(equatorial_map))
vmax = np.nanmax(np.log10(equatorial_map))
map_to_plot = np.log10(plotting_map)
vmin = np.nanmin(
np.log10(equatorial_map[equatorial_map != 0.])
)
vmax = np.nanmax(
np.log10(equatorial_map[equatorial_map != 0.])
)
map_to_plot = copy.copy(plotting_map)
map_to_plot[plotting_map != 0.] = np.log10(
plotting_map[plotting_map != 0.]
)
map_to_plot[plotting_map == 0.] = np.nan
equatorial_map = np.ma.masked_invalid(equatorial_map)
map_to_plot = np.ma.masked_invalid(map_to_plot)

Expand Down

0 comments on commit 7dab470

Please sign in to comment.