Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
c9cbd360
Commit
c9cbd360
authored
Jan 08, 2019
by
Martin Reinecke
Browse files
cosmetics
parent
8f2f7a17
Changes
1
Show whitespace changes
Inline
Sidebyside
nifty5/library/los_response.py
View file @
c9cbd360
...
@@ 118,20 +118,20 @@ class LOSResponse(LinearOperator):
...
@@ 118,20 +118,20 @@ class LOSResponse(LinearOperator):
has dimensions. The second dimensions must be identical for both arrays
has dimensions. The second dimensions must be identical for both arrays
and indicated the total number of lines of sight.
and indicated the total number of lines of sight.
sigmas: numpy.ndarray(float) (optional)
sigmas: numpy.ndarray(float) (optional)
If this is not None, the inverse of the lengths of the LOSs are assumed
to be
If this is not None, the inverse of the lengths of the LOSs are assumed
Gaussian di
a
stributed with these sigmas. The start point will
remain the same,
to be
Gaussian distributed with these sigmas. The start point will
but the endpoint is assumed to be unknown.
remain the same,
but the endpoint is assumed to be unknown.
This is a typical statistical model for astrophysical parallaxes.
This is a typical statistical model for astrophysical parallaxes.
The LOS response then returns the expected integral
The LOS response then returns the expected integral
over the input given that the length of the LOS is unknown and
therefore the
over the input given that the length of the LOS is unknown and
result is averaged over different endpoints.
therefore the
result is averaged over different endpoints.
default: None
default: None
truncation: float (optional)
truncation: float (optional)
Use only if the sigmas keyword argument is used!
Use only if the sigmas keyword argument is used!
This truncates the probability of the endpoint lying more sigmas away
than
This truncates the probability of the endpoint lying more sigmas away
the truncation. Used to speed up computation and to avoid negative
distances.
than
the truncation. Used to speed up computation and to avoid negative
It should hold that 1./(1./lengthsigma*truncation)>0
for all lengths of the
distances.
It should hold that
`
1./(1./lengthsigma*truncation)>0
`
LOSs and all corresponding sigma of sigmas.
for all lengths of the
LOSs and all corresponding sigma of sigmas.
If unsure, leave blank.
If unsure, leave blank.
default: 3.
default: 3.
...
@@ 173,8 +173,9 @@ class LOSResponse(LinearOperator):
...
@@ 173,8 +173,9 @@ class LOSResponse(LinearOperator):
difflen
=
np
.
linalg
.
norm
(
diffs
,
axis
=
0
)
difflen
=
np
.
linalg
.
norm
(
diffs
,
axis
=
0
)
diffs
/=
difflen
diffs
/=
difflen
real_distances
=
1.
/
(
1.
/
difflen

truncation
*
sigmas
)
real_distances
=
1.
/
(
1.
/
difflen

truncation
*
sigmas
)
if
np
.
any
(
real_distances
<
0
):
if
np
.
any
(
real_distances
<
0
):
raise
ValueError
(
"parallax error truncation to high: getting negative distances"
)
raise
ValueError
(
"parallax error truncation to high: "
"getting negative distances"
)
real_ends
=
starts
+
diffs
*
real_distances
real_ends
=
starts
+
diffs
*
real_distances
lzp
=
local_zero_point
.
reshape
((

1
,
1
))
lzp
=
local_zero_point
.
reshape
((

1
,
1
))
dist
=
np
.
array
(
self
.
domain
[
0
].
distances
).
reshape
((

1
,
1
))
dist
=
np
.
array
(
self
.
domain
[
0
].
distances
).
reshape
((

1
,
1
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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