Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with lvk #41

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8e5c765
<bot> update dependencies*.log files(s)
wipacdevbot Jan 6, 2025
8e90b9c
header identical to lvk
G-Sommani Jan 6, 2025
fe4010c
flake8
G-Sommani Jan 6, 2025
0f30bf2
get_paths() instead of collections
G-Sommani Jan 6, 2025
67b8711
try to fix incompatibily with new matplotlib
G-Sommani Jan 6, 2025
29d8d5f
modified julian date as in lvk
G-Sommani Jan 8, 2025
beb0558
utc date in isot format
G-Sommani Jan 8, 2025
4d5fd95
add comma
G-Sommani Jan 8, 2025
72a078a
flattened probability map with same units as multiorder map
G-Sommani Jan 8, 2025
a725e43
fix type of output for prepare_flattened_map()
G-Sommani Jan 8, 2025
bfdcc95
fix type of output for prepare_multiorder_map()
G-Sommani Jan 8, 2025
9aa9adf
remove option dozoom
G-Sommani Jan 16, 2025
2c41db1
<bot> update dependencies*.log files(s)
wipacdevbot Jan 16, 2025
837f3e1
flake8
G-Sommani Jan 16, 2025
4662961
test if nans create problems
G-Sommani Jan 21, 2025
1e2a469
<bot> update dependencies*.log files(s)
wipacdevbot Jan 21, 2025
815a078
debug create_plot
G-Sommani Jan 21, 2025
417c162
debug create_plot
G-Sommani Jan 21, 2025
2237f79
try fix
G-Sommani Jan 21, 2025
5f9359d
try fix
G-Sommani Jan 21, 2025
5561d4e
try fix
G-Sommani Jan 21, 2025
e03682b
try fix
G-Sommani Jan 21, 2025
7ef5ede
debug create_plot
G-Sommani Jan 21, 2025
666004b
debug create_plot
G-Sommani Jan 21, 2025
772ff4e
try fix
G-Sommani Jan 21, 2025
d071544
try fix
G-Sommani Jan 21, 2025
057aa04
try fix
G-Sommani Jan 21, 2025
d1df942
try fix
G-Sommani Jan 21, 2025
9067e4a
try debugging
G-Sommani Jan 21, 2025
36bdd5c
<bot> update dependencies*.log files(s)
wipacdevbot Jan 21, 2025
cc90b0f
debug create_plot
G-Sommani Jan 21, 2025
0b3406f
debug create_plot
G-Sommani Jan 21, 2025
efc07f2
try fix
G-Sommani Jan 21, 2025
8c9ba4f
debug create_plot
G-Sommani Jan 21, 2025
6ba75c2
try fix
G-Sommani Jan 21, 2025
1bfc2e6
debug create_plot
G-Sommani Jan 21, 2025
e709862
try increasing dpi for create_plot
G-Sommani Jan 21, 2025
8c524bd
remove debugging lines and past fixing attempts
G-Sommani Jan 21, 2025
9bfc99b
return to probability per pixel for flattened maps
G-Sommani Jan 21, 2025
5689c30
correct output types
G-Sommani Jan 21, 2025
33ea36f
debug saving of flattened llh maps
G-Sommani Jan 23, 2025
0ea426a
<bot> update dependencies*.log files(s)
wipacdevbot Jan 23, 2025
2fefae9
try specifying the need to save float32
G-Sommani Jan 23, 2025
baf4c11
try removing float32 specification
G-Sommani Jan 23, 2025
a4ac440
undo all changes
G-Sommani Jan 23, 2025
7d1a726
flattened map as in lvk
G-Sommani Jan 23, 2025
9e492bd
typo
G-Sommani Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions skyreader/plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ def bounding_box(ra, dec, theta, phi):
plt.legend(fontsize=6, loc="lower left")

# save flattened map
equatorial_map, column_names, column_units = prepare_flattened_map(
equatorial_map, column_names = prepare_flattened_map(
equatorial_map, llh_map
)
if llh_map:
Expand All @@ -701,17 +701,14 @@ def bounding_box(ra, dec, theta, phi):
filename_main = f"{unique_id}.skymap_nside_{mmap_nside}_{type_map}"
healpy.write_map(
self.output_dir / f"{filename_main}.fits.gz",
equatorial_map / healpy.nside2pixarea(
max_nside, degrees=False,
),
equatorial_map,
coord='C',
column_names=column_names,
column_units=column_units,
extra_header=fits_header,
overwrite=True
)
multiorder_map = prepare_multiorder_map(
grid_value, uniq_array, llh_map,
multiorder_map, column_names = prepare_multiorder_map(
grid_value, uniq_array, llh_map, column_names
)
multiorder_map.write_map(
self.output_dir / f"{filename_main}.multiorder.fits.gz",
Expand Down
10 changes: 5 additions & 5 deletions skyreader/utils/handle_map_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,21 +369,20 @@ def prepare_flattened_map(
"""
if llh_map:
column_names = ['2DLLH']
column_units = None
else:
# avoid excessively heavy data format for the flattened map
equatorial_map[equatorial_map < 1e-16] = np.nanmean(
equatorial_map[equatorial_map < 1e-16]
)
column_names = ["PROBDENSITY"]
column_units = ["sr-1"]
return equatorial_map, column_names, column_units
column_names = ["PROBABILITY"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very minor comment: LVK just uses PROB as the column name for their flattened maps. also probably worth including units for flattened as well, they use pix-1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

return equatorial_map, column_names


def prepare_multiorder_map(
grid_value: np.ndarray,
uniq_array: np.ndarray,
llh_map: bool,
column_names: List[str]
) -> mhealpy.HealpixMap:
"""
Create the mhealpix map that needs to be saved keeping
Expand All @@ -406,4 +405,5 @@ def prepare_multiorder_map(
uniq_array,
unit="sr-1"
tianluyuan marked this conversation as resolved.
Show resolved Hide resolved
)
return multiorder_map
column_names = ["PROBDENSITY"]
G-Sommani marked this conversation as resolved.
Show resolved Hide resolved
return multiorder_map, column_names
Loading