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
64938148
Commit
64938148
authored
3 years ago
by
ChiWai Chan
Browse files
Options
Downloads
Patches
Plain Diff
horizon.py: add limits and title options for horizon distance plots.
parent
a369b614
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!114
Plot horizon distance from ranking statistics
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gstlal-inspiral/python/plots/horizon.py
+11
-1
11 additions, 1 deletion
gstlal-inspiral/python/plots/horizon.py
with
11 additions
and
1 deletion
gstlal-inspiral/python/plots/horizon.py
+
11
−
1
View file @
64938148
...
...
@@ -133,7 +133,7 @@ class HorizonDistance:
raise
UnknownExtensionError
(
"
Cannot determine the extension of the input data sources, please prepare files with the following extension: (
'
.gz
'
or
'
.cache
'
).
"
)
def
savefig
(
self
,
output
,
figsize
=
(
12
,
4
)):
def
savefig
(
self
,
output
,
figsize
=
(
12
,
4
)
,
limits
=
None
,
title
=
None
):
"""
Save the horizon distance plot to disk.
Args:
...
...
@@ -142,11 +142,18 @@ class HorizonDistance:
figsize:
tuple of float, default (12,4), set the output
figure size in inch.
limits:
list of float, default to auto detection, set
the limits on horizon distance.
title:
str, the title of the plots.
Returns:
None
"""
fig
,
ax
=
pyplot
.
subplots
(
1
,
2
,
figsize
=
figsize
)
if
title
is
not
None
:
fig
.
suptitle
(
title
)
pyplot
.
tight_layout
(
pad
=
4
,
w_pad
=
4
,
h_pad
=
4
)
mint
=
int
(
min
([
min
(
horizon_history
.
keys
())
for
_
,
horizon_history
in
self
.
horizon_history_dict
.
items
()]))
...
...
@@ -162,6 +169,9 @@ class HorizonDistance:
ax
[
0
].
semilogy
(
SinceGPSTime
,
horizon_dist
,
"
x
"
,
color
=
plotutil
.
colour_from_instruments
([
ifo
]),
label
=
ifo
)
ax
[
1
].
hist
(
horizon_dist
,
binvec
,
alpha
=
0.5
,
color
=
plotutil
.
colour_from_instruments
([
ifo
]),
label
=
ifo
)
if
limits
is
not
None
:
ax
[
0
].
set_ylim
(
limits
)
ax
[
1
].
set_xlim
(
limits
)
if
self
.
verbose
:
sys
.
stderr
.
write
(
"
plotting
"
+
str
(
output
)
+
"
\n
"
)
...
...
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