Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pygwinc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Jameson Rollins
pygwinc
Commits
5ac2204f
Commit
5ac2204f
authored
7 years ago
by
Jameson Graef Rollins
Browse files
Options
Downloads
Patches
Plain Diff
preliminary support for plotting noises from nested dictionary
For now each noise just gets it's own trace.
parent
6524f967
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gwinc/plot.py
+16
-7
16 additions, 7 deletions
gwinc/plot.py
with
16 additions
and
7 deletions
gwinc/plot.py
+
16
−
7
View file @
5ac2204f
from
numpy
import
sqrt
import
matplotlib.pyplot
as
plt
import
logging
COLOR_MAP
=
{
'
Quantum Vacuum
'
:
(
0.41568627450980394
,
0.23921568627450981
,
0.60392156862745094
),
...
...
@@ -20,12 +21,21 @@ COLOR_MAP = {
def
plot_noise
(
noises
):
f
=
noises
[
'
Freq
'
]
for
name
in
noises
:
if
name
in
[
'
Freq
'
,
'
Total
'
]:
continue
noise
=
noises
[
name
]
color
=
COLOR_MAP
[
name
]
plt
.
loglog
(
f
,
sqrt
(
noise
),
color
=
color
,
label
=
name
,
lw
=
3
)
def
plot_dict
(
noises
):
for
name
,
noise
in
noises
.
iteritems
():
if
name
in
[
'
Freq
'
,
'
Total
'
]:
continue
if
isinstance
(
noise
,
dict
):
plot_dict
(
noise
)
else
:
logging
.
info
(
"
plotting
'
{}
'
...
"
.
format
(
name
))
noise
=
noises
[
name
]
try
:
color
=
COLOR_MAP
[
name
]
except
KeyError
:
color
=
(
0
,
0
,
0
)
plt
.
loglog
(
f
,
sqrt
(
noise
),
color
=
color
,
label
=
name
,
lw
=
3
)
plot_dict
(
noises
)
plt
.
loglog
(
f
,
sqrt
(
noises
[
'
Total
'
]),
color
=
'
black
'
,
label
=
'
Total
'
,
lw
=
4
)
...
...
@@ -33,6 +43,5 @@ def plot_noise(noises):
plt
.
legend
(
ncol
=
2
)
plt
.
xlabel
(
'
Frequency [Hz]
'
)
plt
.
ylabel
(
u
"
Strain [1/
\u221A
Hz]
"
)
plt
.
tight_layout
()
plt
.
xlim
([
min
(
f
),
max
(
f
)])
plt
.
ylim
([
3e-25
,
1e-21
])
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