added the source_index
list to the map dictionary to preserve association between the sources and healpix pixels
This commit is contained in:
3
views.py
3
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,
|
||||
|
Reference in New Issue
Block a user