Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Roberto DePietri
gwcelery
Commits
d0d3f945
Commit
d0d3f945
authored
May 19, 2020
by
Brandon Piotrzkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure external sky maps are normalized
parent
657c93b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
CHANGES.rst
CHANGES.rst
+2
-0
gwcelery/tasks/external_skymaps.py
gwcelery/tasks/external_skymaps.py
+2
-1
gwcelery/tests/test_tasks_external_skymaps.py
gwcelery/tests/test_tasks_external_skymaps.py
+4
-1
No files found.
CHANGES.rst
View file @
d0d3f945
...
...
@@ -50,6 +50,8 @@ Changelog
- Add platform and hostname information to the Flask dashboard.
- Ensure external sky maps are normalized.
0.12.3 (2020-03-24)
-------------------
...
...
gwcelery/tasks/external_skymaps.py
View file @
d0d3f945
...
...
@@ -285,7 +285,8 @@ def create_external_skymap(ra, dec, error, pipeline, notice_type=111):
weight
*
hp
.
sphtfunc
.
smoothing
(
skymap
,
sigma
=
np
.
radians
(
scale
))
for
weight
,
scale
in
zip
(
weights
,
scales
))
return
skymap
# Renormalize due to possible lack of precision
return
skymap
/
skymap
.
sum
()
def
write_to_fits
(
skymap
,
event
,
notice_type
,
notice_date
):
...
...
gwcelery/tests/test_tasks_external_skymaps.py
View file @
d0d3f945
from
importlib
import
resources
from
unittest.mock
import
patch
import
numpy
as
np
import
pytest
from
.
import
data
...
...
@@ -150,7 +151,9 @@ def test_create_swift_skymap(ra, dec, error, pix):
def
test_create_fermi_skymap
():
"""Test created single pixel sky maps for Swift localization."""
ra
,
dec
,
error
=
0
,
90
,
10
external_skymaps
.
create_external_skymap
(
ra
,
dec
,
error
,
'Fermi'
)
assert
(
np
.
sum
(
external_skymaps
.
create_external_skymap
(
ra
,
dec
,
error
,
'Fermi'
))
==
pytest
.
approx
(
1.0
,
1.e-9
))
@
patch
(
'gwcelery.tasks.gracedb.upload.run'
)
...
...
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