Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
d4950d48
Commit
d4950d48
authored
Jul 04, 2018
by
Martin Reinecke
Browse files
use StacCalculator
parent
bf20b328
Changes
1
Hide whitespace changes
Inline
Side-by-side
demos/getting_started_3.py
View file @
d4950d48
...
...
@@ -5,7 +5,6 @@ import numpy as np
def
get_random_LOS
(
n_los
):
starts
=
list
(
np
.
random
.
uniform
(
0
,
1
,
(
n_los
,
2
)).
T
)
ends
=
list
(
np
.
random
.
uniform
(
0
,
1
,
(
n_los
,
2
)).
T
)
return
starts
,
ends
...
...
@@ -87,20 +86,12 @@ if __name__ == '__main__':
ift
.
plot
([
A
.
at
(
position
).
value
,
A
.
at
(
MOCK_POSITION
).
value
],
name
=
'power.pdf'
)
avrg
=
0.
va
=
0.
powers
=
[]
sc
=
ift
.
StatCalculator
()
for
sample
in
samples
:
sam
=
signal
.
at
(
sample
+
position
).
value
powers
.
append
(
A
.
at
(
sample
+
position
).
value
)
avrg
=
avrg
+
sam
va
=
va
+
sam
**
2
avrg
=
avrg
/
len
(
samples
)
va
=
va
/
len
(
samples
)
va
=
va
-
avrg
**
2
std
=
ift
.
sqrt
(
va
)
ift
.
plot
(
avrg
,
name
=
'avrg.pdf'
)
ift
.
plot
(
std
,
name
=
'std.pdf'
)
sc
.
add
(
signal
.
at
(
sample
+
position
).
value
)
ift
.
plot
(
sc
.
mean
,
name
=
'avrg.pdf'
)
ift
.
plot
(
ift
.
sqrt
(
sc
.
var
),
name
=
'std.pdf'
)
powers
=
[
A
.
at
(
s
+
position
).
value
for
s
in
samples
]
ift
.
plot
([
A
.
at
(
position
).
value
,
A
.
at
(
MOCK_POSITION
).
value
]
+
powers
,
name
=
'power.pdf'
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment