Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
gwcelery
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Teresa Slaven-Blair
gwcelery
Commits
596e3caf
Commit
596e3caf
authored
Nov 04, 2020
by
Teresa Slaven-Blair
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User defined nside in create_external_skymap
parent
668b4e15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
gwcelery/tasks/external_skymaps.py
gwcelery/tasks/external_skymaps.py
+4
-6
No files found.
gwcelery/tasks/external_skymaps.py
View file @
596e3caf
...
...
@@ -203,7 +203,7 @@ def get_upload_external_skymap(graceid, search, skymap_link=None):
).
delay
()
def
create_external_skymap
(
ra
,
dec
,
error
,
pipeline
,
notice_type
=
111
):
def
create_external_skymap
(
ra
,
dec
,
error
,
in_nside
,
pipeline
,
notice_type
=
111
):
"""Create a sky map, either a gaussian or a single
pixel sky map, given an RA, dec, and error radius.
...
...
@@ -236,12 +236,12 @@ def create_external_skymap(ra, dec, error, pipeline, notice_type=111):
if
pipeline
==
'Swift'
:
error
/=
np
.
sqrt
(
-
2
*
np
.
log1p
(
-
.
9
))
error_radius
=
error
*
u
.
deg
nside
=
pixel_resolution_to_nside
(
error_radius
,
round
=
'up'
)
# nside = pixel_resolution_to_nside(error_radius, round='up')
nside
=
in_nside
else
:
nside
=
np
.
inf
if
nside
>=
max_nside
:
if
int
(
nside
)
>=
int
(
max_nside
)
:
nside
=
max_nside
# Find the one pixel the event can localized to
hpx
=
HEALPix
(
nside
,
'ring'
,
frame
=
ICRS
())
skymap
=
np
.
zeros
(
hpx
.
npix
)
...
...
@@ -251,7 +251,6 @@ def create_external_skymap(ra, dec, error, pipeline, notice_type=111):
# If larger error, create gaussian sky map
hpx
=
HEALPix
(
nside
,
'ring'
,
frame
=
ICRS
())
ipix
=
np
.
arange
(
hpx
.
npix
)
# Evaluate Gaussian.
center
=
SkyCoord
(
ra
*
u
.
deg
,
dec
*
u
.
deg
)
distance
=
hpx
.
healpix_to_skycoord
(
ipix
).
separation
(
center
)
...
...
@@ -284,7 +283,6 @@ def create_external_skymap(ra, dec, error, pipeline, notice_type=111):
skymap
=
sum
(
weight
*
hp
.
sphtfunc
.
smoothing
(
skymap
,
sigma
=
np
.
radians
(
scale
))
for
weight
,
scale
in
zip
(
weights
,
scales
))
# Renormalize due to possible lack of precision
return
skymap
/
skymap
.
sum
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment