From 6c6878e399de2959c6e60c53339e32049b9e179f Mon Sep 17 00:00:00 2001 From: tyrin Date: Wed, 1 Oct 2025 12:53:55 +0300 Subject: [PATCH] added the `source_index` list to the map dictionary to preserve association between the sources and healpix pixels --- views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/views.py b/views.py index 24392d0..d8c60ad 100644 --- a/views.py +++ b/views.py @@ -910,6 +910,7 @@ class StackedUpperLimitView(APIView): # Create a single list to hold all Healpix IDs all_map_pixels = [] + source_indices = [] # Iterate over source vectors and get all unique Healpix IDs for index, src_vec in enumerate(src_vec_list): @@ -921,6 +922,7 @@ class StackedUpperLimitView(APIView): radius=(map_radius * u.arcsecond).to(u.radian).value, ) all_map_pixels.extend(pixels) + source_indices.extend([index] * len(pixels)) # Get only unique Healpix IDs unique_map_pixels = list(set(all_map_pixels)) @@ -953,6 +955,7 @@ class StackedUpperLimitView(APIView): "healpix": map_healpix_list, "counts": map_counts_list, "exposure": map_exposure_list, + "source_index": source_indices, # "contaminated": map_contaminated_list, "nside": map_nside, "order": map_order,