make image map radius a parameter
This commit is contained in:
parent
3c5aed6a41
commit
03cdfa01b0
14
views.py
14
views.py
@ -137,7 +137,7 @@ class UpperLimitView(APIView):
|
|||||||
{"error": "Invalud parameters, provide RA, DEC, and CL"},
|
{"error": "Invalud parameters, provide RA, DEC, and CL"},
|
||||||
status=status.HTTP_400_BAD_REQUEST,
|
status=status.HTTP_400_BAD_REQUEST,
|
||||||
)
|
)
|
||||||
# ── NEW: pull & parse survey selection ──
|
# pull & parse survey selection
|
||||||
raw_survey = request.query_params.get("survey")
|
raw_survey = request.query_params.get("survey")
|
||||||
if raw_survey is None:
|
if raw_survey is None:
|
||||||
return Response(
|
return Response(
|
||||||
@ -152,11 +152,7 @@ class UpperLimitView(APIView):
|
|||||||
status=status.HTTP_400_BAD_REQUEST,
|
status=status.HTTP_400_BAD_REQUEST,
|
||||||
)
|
)
|
||||||
|
|
||||||
# hp = HEALPix(
|
map_radius_value = request.query_params.get("mr")
|
||||||
# nside = 4096,
|
|
||||||
# order = 'ring',
|
|
||||||
# frame = 'icrs'
|
|
||||||
# )
|
|
||||||
|
|
||||||
# CREATE SKYCOORD, CONVERT TO GALACTIC BECAUSE THE HEALPIX
|
# CREATE SKYCOORD, CONVERT TO GALACTIC BECAUSE THE HEALPIX
|
||||||
# MAP ITSELF WAS MADE IN GALACTIC COORDINATES
|
# MAP ITSELF WAS MADE IN GALACTIC COORDINATES
|
||||||
@ -342,8 +338,12 @@ class UpperLimitView(APIView):
|
|||||||
# SQUARE REGION IMAGE SERVING
|
# SQUARE REGION IMAGE SERVING
|
||||||
# ****************************************************************
|
# ****************************************************************
|
||||||
|
|
||||||
|
# default value if not specified in the query
|
||||||
# get hpids within a circle of radius sqrt(2) * outer annulus radius
|
# 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(
|
map_pixel_list = hp.query_disc(
|
||||||
nside=4096,
|
nside=4096,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user