added separation to nearby sources, set nearby source search radius to 2x map radius
This commit is contained in:
parent
e01941f06b
commit
e2d0afa4c5
20
views.py
20
views.py
@ -167,6 +167,13 @@ class UpperLimitView(APIView):
|
||||
|
||||
map_radius_value = request.query_params.get("mr")
|
||||
|
||||
# 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)
|
||||
|
||||
# CREATE SKYCOORD, CONVERT TO GALACTIC BECAUSE THE HEALPIX
|
||||
# MAP ITSELF WAS MADE IN GALACTIC COORDINATES
|
||||
# **************************************************************
|
||||
@ -362,7 +369,7 @@ class UpperLimitView(APIView):
|
||||
# NEARBY SOURCES CHECK
|
||||
# ****************************************************************
|
||||
|
||||
radius_as = 120
|
||||
radius_as = map_radius * 2
|
||||
radius_deg = radius_as / 3600
|
||||
|
||||
dec_min = max(dec - radius_deg, -90)
|
||||
@ -384,7 +391,8 @@ class UpperLimitView(APIView):
|
||||
# refine belt to circular region using astropy separation
|
||||
for catsrc in belt_sources:
|
||||
catsrc_coord = SkyCoord(catsrc.ra_deg, catsrc.dec_deg, unit="deg")
|
||||
if center_coord.separation(catsrc_coord).deg > radius_deg:
|
||||
separation = center_coord.separation(catsrc_coord).deg
|
||||
if separation > radius_deg:
|
||||
continue
|
||||
f = catsrc.flux or 0.0
|
||||
for lb in reversed(sorted_bounds):
|
||||
@ -406,19 +414,13 @@ class UpperLimitView(APIView):
|
||||
"new_xray": catsrc.new_xray,
|
||||
"source_type": catsrc.source_type,
|
||||
"mask_radius_deg": mask_radius,
|
||||
"separation_deg": separation,
|
||||
}
|
||||
)
|
||||
|
||||
# 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,
|
||||
vec=src_vec,
|
||||
|
Loading…
x
Reference in New Issue
Block a user