make image map radius a parameter

This commit is contained in:
Никита Тырин 2025-05-23 10:54:11 +03:00
parent 3c5aed6a41
commit 03cdfa01b0

View File

@ -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
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,