changed from using Max aggregatio to a separate query for the contamination status
This commit is contained in:
parent
a36163f731
commit
42c63547b1
10
views.py
10
views.py
@ -412,7 +412,6 @@ class UpperLimitView(APIView):
|
||||
.values("hpid")
|
||||
.annotate(
|
||||
counts=Sum("counts"),
|
||||
contaminated=Max("contaminated"),
|
||||
)
|
||||
.order_by("hpid")
|
||||
)
|
||||
@ -423,7 +422,14 @@ class UpperLimitView(APIView):
|
||||
# get lists of healpix indices and count values
|
||||
map_healpix_list = [d["hpid"] for d in map_pixels_list]
|
||||
map_counts_list = [d["counts"] for d in map_pixels_list]
|
||||
map_contaminated_list = [d["contaminated"] for d in map_pixels_list]
|
||||
|
||||
cont_dict = dict(
|
||||
Pixel.objects.filter(hpid__in=map_healpix_list, survey__in=survey_numbers)
|
||||
.values_list("hpid", "contaminated")
|
||||
.distinct()
|
||||
)
|
||||
|
||||
map_contaminated_list = [cont_dict[h] for h in map_healpix_list]
|
||||
|
||||
# set map nside
|
||||
map_nside = 4096
|
||||
|
Loading…
x
Reference in New Issue
Block a user