Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pygwinc
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
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
gwinc
pygwinc
Commits
df6a16cd
Commit
df6a16cd
authored
2 years ago
by
Kevin Kuns
Browse files
Options
Downloads
Patches
Plain Diff
adjustments after refactoring
parent
e673aa0f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!155
Budget tests
Pipeline
#482957
passed
2 years ago
Stage: dist
Stage: test
Stage: review
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+5
-5
5 additions, 5 deletions
README.md
test/budgets/test_budgets.py
+9
-9
9 additions, 9 deletions
test/budgets/test_budgets.py
with
14 additions
and
14 deletions
README.md
+
5
−
5
View file @
df6a16cd
...
...
@@ -153,8 +153,8 @@ is available in the `budget.ifo` attribute.
The budget
`run()`
method calculates all budget noises and the noise
total and returns a
`BudgetTrace`
object with
`freq`
,
`psd`
, and
`asd`
properties. The budget sub-traces are available through a dictionary
(
`trace['Quantum
Vacuum
']`
) interface and via attributes
(
`trace.Quantum
Vacumm
`
).
(
`trace['Quantum']`
) interface and via attributes
(
`trace.Quantum`
).
The budget
`freq`
and
`ifo`
attributes can be updated at run time by
passing them as keyword arguments to the
`run()`
method:
...
...
@@ -438,13 +438,13 @@ and extract the noise data the output traces dictionary:
```
python
budget
=
load_budget
(
'
/path/to/MyBudget
'
,
freq
)
trace
=
budget
.
run
()
quantum_trace
=
trace
[
'
Quantum
Vacuum
'
]
quantum_trace
=
trace
[
'
Quantum
'
]
```
You can also calculate the final calibrated output noise for just a
single term using the Budget
`calc_noise()`
method:
```
python
data
=
budget
.
calc_noise
(
'
Quantum
Vacuum
'
)
data
=
budget
.
calc_noise
(
'
Quantum
'
)
```
You can also calculate a noise at it's source, without applying any
...
...
@@ -452,7 +452,7 @@ calibrations, by using the Budget `__getitem__` interface to extract
the specific Noise BudgetItem for the noise you're interested in, and
running it's
`calc_trace()`
method directly:
```
python
data
=
budget
[
'
Quantum
Vacuum
'
].
calc_trace
()
data
=
budget
[
'
Quantum
'
].
calc_trace
()
```
...
...
This diff is collapsed.
Click to expand it.
test/budgets/test_budgets.py
+
9
−
9
View file @
df6a16cd
...
...
@@ -65,12 +65,12 @@ def test_budget_run_calc(tpath_join, pprint, compare_noise):
F_Hz
=
np
.
logspace
(
np
.
log10
(
5
),
4
,
3000
)
B
=
load_budget
(
'
CE2silica
'
,
freq
=
F_Hz
)
traces1
=
B
.
run
()
traces2
=
B
.
calc_noise
(
'
Quantum
Vacuum
'
)
traces3
=
B
[
'
Quantum
Vacuum
'
].
calc_trace
()
traces4
=
B
[
'
Quantum
Vacuum
'
].
calc_noise
(
'
QuantumVacuum
AS
'
)
traces5
=
B
[
'
Quantum
Vacuum
'
][
'
QuantumVacuum
AS
'
].
calc_trace
()
traces6
=
B
[
'
Quantum
Vacuum
'
].
run
()
fig1
=
traces1
.
Quantum
Vacuum
.
plot
()
traces2
=
B
.
calc_noise
(
'
Quantum
'
)
traces3
=
B
[
'
Quantum
'
].
calc_trace
()
traces4
=
B
[
'
Quantum
'
].
calc_noise
(
'
AS
'
)
traces5
=
B
[
'
Quantum
'
][
'
AS
'
].
calc_trace
()
traces6
=
B
[
'
Quantum
'
].
run
()
fig1
=
traces1
.
Quantum
.
plot
()
fig2
=
traces2
.
plot
()
fig3
=
traces3
.
plot
()
fig1
.
savefig
(
tpath_join
(
'
run.pdf
'
))
...
...
@@ -78,8 +78,8 @@ def test_budget_run_calc(tpath_join, pprint, compare_noise):
fig3
.
savefig
(
tpath_join
(
'
calc_trace.pdf
'
))
pprint
(
'
Testing that run() and calc_noise() do the same thing
'
)
compare_noise
(
traces1
.
Quantum
Vacuum
,
traces2
)
compare_noise
(
traces1
.
Quantum
Vacuum
.
QuantumVacuumAS
,
traces2
.
QuantumVacuum
AS
)
compare_noise
(
traces1
.
Quantum
,
traces2
)
compare_noise
(
traces1
.
Quantum
.
AS
,
traces2
.
AS
)
pprint
(
"
Testing that run() and calc_trace() on sub-budgets don
'
t apply strain calibration
"
)
compare_noise
(
traces3
,
traces6
)
...
...
@@ -96,7 +96,7 @@ def test_budget_run_calc(tpath_join, pprint, compare_noise):
update_total_psd
(
traces3
)
fig
,
ax
=
plt
.
subplots
()
ax
.
loglog
(
F_Hz
,
traces1
.
Quantum
Vacuum
.
asd
,
label
=
'
run
'
)
ax
.
loglog
(
F_Hz
,
traces1
.
Quantum
.
asd
,
label
=
'
run
'
)
ax
.
loglog
(
F_Hz
,
traces2
.
asd
,
ls
=
'
--
'
,
label
=
'
calc_noise
'
)
ax
.
loglog
(
F_Hz
,
traces3
.
asd
,
ls
=
'
-.
'
,
label
=
'
calc_trace / $L_\mathrm{arm}$
'
)
...
...
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