Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lscsoft
bilby
Commits
59ea9890
Commit
59ea9890
authored
6 years ago
by
Gregory Ashton
Browse files
Options
Downloads
Patches
Plain Diff
Clean up and document of InterferometerSet
parent
18367122
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!72
Clean up of detectors
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tupak/gw/detector.py
+24
-12
24 additions, 12 deletions
tupak/gw/detector.py
with
24 additions
and
12 deletions
tupak/gw/detector.py
+
24
−
12
View file @
59ea9890
...
...
@@ -14,23 +14,35 @@ from tupak.core import utils
class
InterferometerSet
(
list
):
"""
A list of Interferometer objects
"""
def
__init__
(
self
,
interferometers
):
"""
Instantiate a InterferometerSet
The InterferometerSet containes a list of Interferometer objects, each
object has the data used in evaluating the likelihood
Parameters
----------
interferometers: list
The list of interferometers
"""
if
type
(
interferometers
)
!=
list
:
raise
ValueError
(
"
Input must be list
"
)
for
ifo
in
interferometers
:
if
type
(
ifo
)
!=
Interferometer
:
raise
ValueError
(
"
Input list of interferometers are not all Interferometer objects
"
)
self
.
interferometers
=
interferometers
self
.
number_of_interferometers
=
len
(
interferometers
)
self
.
check_interferometers
()
def
check_interferometers
(
self
):
durations
=
[
interferomer
.
strain_data
.
duration
for
interferomer
in
self
.
interferometers
]
if
np
.
mean
(
durations
)
!=
durations
[
0
]:
raise
ValueError
(
"
The duration of all interferometers are not the same
"
)
start_times
=
[
interferomer
.
strain_data
.
start_time
for
interferomer
in
self
.
interferometers
]
if
np
.
mean
(
start_times
)
!=
start_times
[
0
]:
raise
ValueError
(
"
The start time of all interferometers are not the same
"
)
sampling_frequencies
=
[
interferomer
.
strain_data
.
sampling_frequency
for
interferomer
in
self
.
interferometers
]
if
np
.
mean
(
sampling_frequencies
)
!=
sampling_frequencies
[
0
]:
raise
ValueError
(
"
The sampling_frequencies of all interferometers are not the same
"
)
self
.
_check_interferometers
()
def
_check_interferometers
(
self
):
"""
Check certain aspects of the set are the same
"""
samesies
=
[
'
duration
'
,
'
start_time
'
,
'
sampling_frequency
'
]
for
attribute
in
samesies
:
x
=
[
getattr
(
interferometer
.
strain_data
,
attribute
)
for
interferometer
in
self
.
interferometers
]
if
np
.
mean
(
x
)
!=
x
[
0
]:
raise
ValueError
(
"
The {} of all interferometers are not the same
"
.
format
(
attribute
))
def
__iter__
(
self
):
i
=
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment