diff --git a/views.py b/views.py index 93397bd..8e90c09 100644 --- a/views.py +++ b/views.py @@ -137,7 +137,7 @@ class UpperLimitView(APIView): {"error": "Invalud parameters, provide RA, DEC, and CL"}, status=status.HTTP_400_BAD_REQUEST, ) - # ── NEW: pull & parse survey selection ── + # pull & parse survey selection raw_survey = request.query_params.get("survey") if raw_survey is None: return Response( @@ -152,11 +152,7 @@ class UpperLimitView(APIView): status=status.HTTP_400_BAD_REQUEST, ) - # hp = HEALPix( - # nside = 4096, - # order = 'ring', - # frame = 'icrs' - # ) + map_radius_value = request.query_params.get("mr") # CREATE SKYCOORD, CONVERT TO GALACTIC BECAUSE THE HEALPIX # MAP ITSELF WAS MADE IN GALACTIC COORDINATES @@ -342,8 +338,12 @@ class UpperLimitView(APIView): # SQUARE REGION IMAGE SERVING # **************************************************************** + # default value if not specified in the query # get hpids within a circle of radius sqrt(2) * outer annulus radius - map_radius = annulus_outer * np.sqrt(2) + if map_radius_value is None: + map_radius = annulus_outer * np.sqrt(2) + else: + map_radius = float(map_radius_value) map_pixel_list = hp.query_disc( nside=4096,