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

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

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

1
,
1
))
...
...
@@ 186,9 +187,9 @@ class LOSResponse(LinearOperator):
localized_pixel_ends
,
self
.
_local_shape
,
np
.
array
(
self
.
domain
[
0
].
distances
),
1.
/
(
1.
/
difflen
+
truncation
*
sigmas
),
difflen
,
1.
/
(
1.
/
difflen

truncation
*
sigmas
),
1.
/
(
1.
/
difflen
+
truncation
*
sigmas
),
difflen
,
1.
/
(
1.
/
difflen

truncation
*
sigmas
),
sigmas
,
_gaussian_sf
)
...
...
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