diff --git a/admin.py b/admin.py index 8c38f3f..7580f04 100644 --- a/admin.py +++ b/admin.py @@ -1,3 +1,5 @@ +# uplim/admin.py + from django.contrib import admin # Register your models here. diff --git a/apps.py b/apps.py index 9a84079..f863339 100644 --- a/apps.py +++ b/apps.py @@ -1,6 +1,8 @@ +# uplim/apps.py + from django.apps import AppConfig class AxcUlConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'uplim' + default_auto_field = "django.db.models.BigAutoField" + name = "uplim" diff --git a/tests.py b/tests.py index 7ce503c..9c8fd37 100644 --- a/tests.py +++ b/tests.py @@ -1,3 +1,5 @@ +# uplim/tests.py + from django.test import TestCase # Create your tests here. diff --git a/utils/decorators.py b/utils/decorators.py index cb69574..8915d9f 100644 --- a/utils/decorators.py +++ b/utils/decorators.py @@ -1,3 +1,5 @@ +# uplim/utils/decorators.py + import time from functools import wraps from rest_framework.response import Response diff --git a/views.py b/views.py index 43d77ef..437b193 100644 --- a/views.py +++ b/views.py @@ -1,7 +1,6 @@ # uplim/views.py -# from astropy_healpix import HEALPix does not have an option to -# search for pixels non-inclusively +# from astropy_healpix import HEALPix does not have an option to search for pixels non-inclusively so we have to use healpy import healpy as hp import astropy.units as u import numpy as np @@ -679,7 +678,7 @@ class StackedUpperLimitView(APIView): or annulus_pixels.filter(contaminated=True).exists() ) - # exclude contaminated pixels from the background and source regions + # exclude contaminated pixels from the background regions annulus_pixels = annulus_pixels.exclude(contaminated=True) # source_pixels = source_pixels.exclude(contaminated=True) @@ -914,10 +913,6 @@ class StackedUpperLimitView(APIView): # iterate over source vectors, making maps - # # Create a single list to hold all Healpix IDs - # all_map_pixels = [] - # source_indices = [] - hpid_to_source_indices_map = defaultdict(list) # Iterate over source vectors and get all unique Healpix IDs @@ -950,15 +945,6 @@ class StackedUpperLimitView(APIView): map_exposure_list = [] map_source_indices_list = [] - # # turn the queryset to a list - # map_pixels_list = list(map_pixels_qs) - - # # 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_exposure_list = [d["exposure"] for d in map_pixels_list] - # # map_contaminated_list = [d["contaminated"] for d in map_pixels_list] - for hpid, source_indices in hpid_to_source_indices_map.items(): # Check if this pixel was actually found in the database query if hpid in db_results_map: