Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GstLAL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
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
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
GstLAL
Commits
ab933df4
Commit
ab933df4
authored
3 years ago
by
ChiWai Chan
Browse files
Options
Downloads
Patches
Plain Diff
gstlal_plot_psd_horizon: update this program to use the plots.horizon module to avoid duplication.
parent
cd7f37a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gstlal/bin/gstlal_plot_psd_horizon
+3
-38
3 additions, 38 deletions
gstlal/bin/gstlal_plot_psd_horizon
with
3 additions
and
38 deletions
gstlal/bin/gstlal_plot_psd_horizon
+
3
−
38
View file @
ab933df4
...
...
@@ -22,13 +22,8 @@
from
optparse
import
OptionParser
import
matplotlib
matplotlib
.
use
(
'
Agg
'
)
from
matplotlib
import
pyplot
import
numpy
from
gstlal.plots
import
util
as
plotutil
from
gstlal.psd
import
read_psd
,
HorizonDistance
from
gstlal.plots
import
horizon
def
parse_command_line
():
...
...
@@ -44,35 +39,5 @@ def parse_command_line():
options
,
filenames
=
parse_command_line
()
horizons
=
{}
times
=
{}
for
f
in
filenames
:
psds
=
read_psd
(
f
,
verbose
=
True
)
for
ifo
,
psd
in
psds
.
items
():
if
psd
is
not
None
:
times
.
setdefault
(
ifo
,
[]).
append
(
int
(
psd
.
epoch
))
horizons
.
setdefault
(
ifo
,
[]).
append
(
HorizonDistance
(
10.
,
2048.
,
psd
.
deltaF
,
1.4
,
1.4
)(
psd
,
8.
)[
0
])
pyplot
.
figure
(
figsize
=
(
12
,
4
))
pyplot
.
subplot
(
121
)
minh
,
maxh
=
(
float
(
"
inf
"
),
0
)
mint
=
min
([
min
(
t
)
for
t
in
times
.
values
()
if
t
])
for
ifo
in
horizons
:
if
len
(
horizons
[
ifo
])
>
0
:
pyplot
.
semilogy
((
numpy
.
array
(
times
[
ifo
])
-
mint
)
/
1000.
,
horizons
[
ifo
],
'
x
'
,
color
=
plotutil
.
colour_from_instruments
([
ifo
]),
label
=
ifo
)
maxh
=
max
(
maxh
,
max
(
horizons
[
ifo
]))
minh
=
min
(
minh
,
min
(
horizons
[
ifo
]))
#pyplot.legend()
pyplot
.
xlabel
(
'
Time (ks) from GPS %d
'
%
mint
)
pyplot
.
ylabel
(
'
Mpc
'
)
pyplot
.
grid
()
pyplot
.
subplot
(
122
)
binvec
=
numpy
.
linspace
(
minh
,
maxh
,
25
)
for
ifo
in
horizons
:
if
len
(
horizons
[
ifo
])
>
0
:
pyplot
.
hist
(
horizons
[
ifo
],
binvec
,
color
=
plotutil
.
colour_from_instruments
([
ifo
]),
alpha
=
0.5
,
label
=
ifo
)
pyplot
.
legend
()
pyplot
.
xlabel
(
"
Mpc
"
)
pyplot
.
ylabel
(
"
Count
"
)
pyplot
.
savefig
(
options
.
output
)
horizon_distance
=
horizon
.
HorizonDistance
.
from_psds
(
filenames
)
horizon_distance
.
savefig
(
options
.
output
)
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