Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
L
lvcnrpy
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
waveforms
lvcnrpy
Commits
94689225
Commit
94689225
authored
Jul 13, 2018
by
Edward Fauchon-Jones
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into candidate-add-phase-sense-check
parents
f2b37d32
0ed8a149
Pipeline
#25153
passed with stage
in 2 minutes and 8 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
lvcnrpy/format/specs.py
lvcnrpy/format/specs.py
+6
-3
lvcnrpy/test/test_lvcnrcheck.py
lvcnrpy/test/test_lvcnrcheck.py
+2
-2
No files found.
lvcnrpy/format/specs.py
View file @
94689225
...
...
@@ -273,7 +273,7 @@ def get_waveform_peak(sim):
# Prepare container for piecewise polynomial
amp22
=
sim
[
'amp_l2_m2'
]
tck22
=
splrep
(
amp22
[
'X'
][:],
amp22
[
'Y'
][:],
s
=
0
,
k
=
5
)
tck22
=
splrep
(
amp22
[
'X'
][:],
amp22
[
'Y'
][:]
**
2
,
s
=
0
,
k
=
5
)
interiorKnots22
=
np
.
setdiff1d
(
interiorKnots
,
amp22
[
'X'
][
3
:
-
3
])
tck22
=
reduce
(
...
...
@@ -286,7 +286,7 @@ def get_waveform_peak(sim):
ampKeys
=
[
k
for
k
in
ampKeys
if
k
!=
'amp_l2_m2'
]
for
k
in
ampKeys
:
amplm
=
sim
[
k
]
tcklm
=
splrep
(
amplm
[
'X'
][:],
amplm
[
'Y'
][:],
s
=
0
,
k
=
5
)
tcklm
=
splrep
(
amplm
[
'X'
][:],
amplm
[
'Y'
][:]
**
2
,
s
=
0
,
k
=
5
)
interiorKnotslm
=
np
.
setdiff1d
(
interiorKnots
,
amplm
[
'X'
][
3
:
-
3
])
tcklm
=
reduce
(
...
...
@@ -296,9 +296,12 @@ def get_waveform_peak(sim):
plm
=
PPoly
.
from_spline
(
tcklm
)
pAll
.
c
+=
plm
.
c
# Find the global maximum point of the piecewise polynomial
# Find the global maximum point of the piecewise polynomial
in domain
dpAll
=
pAll
.
derivative
()
extremumPoints
=
dpAll
.
roots
()
t0
,
t1
=
sim
[
'amp_l2_m2/X'
][:][
np
.
r_
[
0
,
-
1
]]
mask
=
(
extremumPoints
>=
t0
)
*
(
extremumPoints
<=
t1
)
extremumPoints
=
extremumPoints
[
mask
]
extremum
=
pAll
(
extremumPoints
)
idx
=
np
.
argmax
(
extremum
)
maximumPoint
=
extremumPoints
[
idx
]
...
...
lvcnrpy/test/test_lvcnrcheck.py
View file @
94689225
...
...
@@ -70,7 +70,7 @@ templateOutput = """# Format 1
# Format 1 (Interfield)
- [=] mass-ordering (mass1 >= mass2)
- [=] peak-near-zero (waveform peak is at 0.
88
M which is less than 10.00M from zero)
- [=] peak-near-zero (waveform peak is at 0.
05
M which is less than 10.00M from zero)
- [=] phase-sense ((2,2) phase is decreasing on average)
# Format 2
...
...
@@ -1869,7 +1869,7 @@ class TestPeakNearZero(TestInterfield):
def
test_invalid_peak_location
(
self
):
self
.
setOutput
(
(
'- [INVALID INTERFIELD] peak-near-zero (waveform peak is at '
'-99.
12
M which is greater than 10.00M from zero)'
))
'-99.
95
M which is greater than 10.00M from zero)'
))
nr
=
h5
.
File
(
self
.
f
.
name
)
keys
=
[
k
for
k
in
nr
.
keys
()
if
k
.
startswith
(
'amp_l'
)]
...
...
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