Skip to content

Commit

Permalink
remove nans in llh map only when calculating contours. Otherwise, nan…
Browse files Browse the repository at this point in the history
…s are kept
  • Loading branch information
G-Sommani committed Dec 10, 2024
1 parent c17903b commit a482ffd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
10 changes: 3 additions & 7 deletions skyreader/plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,16 +449,12 @@ def bounding_box(ra, dec, theta, phi):

if not circular:
if llh_map:
# get rid of nan values only for the contours and
# avoiding crashes during plotting
max_map = np.nanmax(equatorial_map)
# get rid of nan values only for the contours
# this avoids crashes during plotting
grid_values_for_contours = copy.copy(grid_value)
grid_values_for_contours[
np.isnan(grid_values_for_contours)
] = max_map
#grid_values_for_contours = grid_values_for_contours.clip(
# None, max_map
#)
] = np.nanmax(equatorial_map)
contour_levels_for_contours = contour_levels
else:
grid_values_for_contours = np.log(grid_value)
Expand Down
5 changes: 0 additions & 5 deletions skyreader/utils/handle_map_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ def extract_map(
# show 2 * delta_LLH
grid_value = grid_value * 2.
equatorial_map *= 2.

#max_map = np.nanmax(equatorial_map)
#equatorial_map[np.isnan(equatorial_map)] = max_map
#grid_value[np.isnan(grid_value)] = max_map
#grid_value = grid_value.clip(None, max_map)
else:
# Convert to probability
equatorial_map = np.exp(-1. * equatorial_map)
Expand Down

0 comments on commit a482ffd

Please sign in to comment.