Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resolve
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
resolve
Commits
40bd9444
Commit
40bd9444
authored
4 years ago
by
Simon Ding
Browse files
Options
Downloads
Patches
Plain Diff
Export SingleResponse; Added control over verbosity setting
parent
c8d398b3
No related branches found
No related tags found
1 merge request
!12
Mpi likelihood
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
resolve/__init__.py
+1
-1
1 addition, 1 deletion
resolve/__init__.py
resolve/mpi_operators.py
+1
-0
1 addition, 0 deletions
resolve/mpi_operators.py
resolve/response.py
+5
-3
5 additions, 3 deletions
resolve/response.py
with
7 additions
and
4 deletions
resolve/__init__.py
+
1
−
1
View file @
40bd9444
...
@@ -18,7 +18,7 @@ from .plotter import MfPlotter, Plotter
...
@@ -18,7 +18,7 @@ from .plotter import MfPlotter, Plotter
from
.points
import
PointInserter
from
.points
import
PointInserter
from
.polarization
import
polarization_matrix_exponential
from
.polarization
import
polarization_matrix_exponential
from
.primary_beam
import
vla_beam
from
.primary_beam
import
vla_beam
from
.response
import
MfResponse
,
ResponseDistributor
,
StokesIResponse
from
.response
import
MfResponse
,
ResponseDistributor
,
StokesIResponse
,
SingleResponse
from
.simple_operators
import
*
from
.simple_operators
import
*
from
.util
import
(
from
.util
import
(
Reshaper
,
Reshaper
,
...
...
This diff is collapsed.
Click to expand it.
resolve/mpi_operators.py
+
1
−
0
View file @
40bd9444
...
@@ -13,6 +13,7 @@ class AllreduceSum(ift.Operator):
...
@@ -13,6 +13,7 @@ class AllreduceSum(ift.Operator):
# domain and target. In NIFTy, we generally support the addition of
# domain and target. In NIFTy, we generally support the addition of
# operators that have different domains (not all keys need to be present
# operators that have different domains (not all keys need to be present
# in all domains). This could be done here as well.
# in all domains). This could be done here as well.
# TOASK: What domain would be picked if I have IRGSpaces with different freq_domains?
# FIXME If all operators in oplist are linear operators, we could
# FIXME If all operators in oplist are linear operators, we could
# automatically instantiate AllreduceSumLinear.
# automatically instantiate AllreduceSumLinear.
...
...
This diff is collapsed.
Click to expand it.
resolve/response.py
+
5
−
3
View file @
40bd9444
...
@@ -100,7 +100,7 @@ class MfResponse(ift.LinearOperator):
...
@@ -100,7 +100,7 @@ class MfResponse(ift.LinearOperator):
Contains the the :class:`nifty7.RGSpace` for the positions.
Contains the the :class:`nifty7.RGSpace` for the positions.
"""
"""
def
__init__
(
self
,
observation
,
frequency_domain
,
position_domain
):
def
__init__
(
self
,
observation
,
frequency_domain
,
position_domain
,
verbose
=
True
):
my_assert_isinstance
(
observation
,
Observation
)
my_assert_isinstance
(
observation
,
Observation
)
# FIXME Add polarization support
# FIXME Add polarization support
my_asserteq
(
observation
.
npol
,
1
)
my_asserteq
(
observation
.
npol
,
1
)
...
@@ -115,6 +115,7 @@ class MfResponse(ift.LinearOperator):
...
@@ -115,6 +115,7 @@ class MfResponse(ift.LinearOperator):
data_freq
=
observation
.
freq
data_freq
=
observation
.
freq
my_assert
(
np
.
all
(
np
.
diff
(
data_freq
)
>
0
))
my_assert
(
np
.
all
(
np
.
diff
(
data_freq
)
>
0
))
sky_freq
=
np
.
array
(
frequency_domain
.
coordinates
)
sky_freq
=
np
.
array
(
frequency_domain
.
coordinates
)
# TOASK: Why is it necessary to construct band indices like this?
band_indices
=
[
np
.
argmin
(
np
.
abs
(
ff
-
sky_freq
))
for
ff
in
data_freq
]
band_indices
=
[
np
.
argmin
(
np
.
abs
(
ff
-
sky_freq
))
for
ff
in
data_freq
]
# Make sure that no index is wasted
# Make sure that no index is wasted
my_asserteq
(
len
(
set
(
band_indices
)),
frequency_domain
.
size
)
my_asserteq
(
len
(
set
(
band_indices
)),
frequency_domain
.
size
)
...
@@ -130,6 +131,7 @@ class MfResponse(ift.LinearOperator):
...
@@ -130,6 +131,7 @@ class MfResponse(ift.LinearOperator):
observation
.
freq
[
sel
],
observation
.
freq
[
sel
],
mask
[
0
,
:,
sel
].
T
,
mask
[
0
,
:,
sel
].
T
,
sp
,
sp
,
verbose
)
)
self
.
_r
.
append
((
band_index
,
sel
,
r
))
self
.
_r
.
append
((
band_index
,
sel
,
r
))
# Double check that all channels are written to
# Double check that all channels are written to
...
@@ -203,7 +205,7 @@ class FullResponse(ift.LinearOperator):
...
@@ -203,7 +205,7 @@ class FullResponse(ift.LinearOperator):
class
SingleResponse
(
ift
.
LinearOperator
):
class
SingleResponse
(
ift
.
LinearOperator
):
def
__init__
(
self
,
domain
,
uvw
,
freq
,
mask
,
single_precision
):
def
__init__
(
self
,
domain
,
uvw
,
freq
,
mask
,
single_precision
,
verbose
=
True
):
# FIXME Currently only the response uses single_precision if possible.
# FIXME Currently only the response uses single_precision if possible.
# Could be rolled out to the whole likelihood
# Could be rolled out to the whole likelihood
self
.
_domain
=
ift
.
DomainTuple
.
make
(
domain
)
self
.
_domain
=
ift
.
DomainTuple
.
make
(
domain
)
...
@@ -225,7 +227,7 @@ class SingleResponse(ift.LinearOperator):
...
@@ -225,7 +227,7 @@ class SingleResponse(ift.LinearOperator):
self
.
_vol
=
self
.
_domain
[
0
].
scalar_dvol
self
.
_vol
=
self
.
_domain
[
0
].
scalar_dvol
self
.
_target_dtype
=
np
.
complex64
if
single_precision
else
np
.
complex128
self
.
_target_dtype
=
np
.
complex64
if
single_precision
else
np
.
complex128
self
.
_domain_dtype
=
np
.
float32
if
single_precision
else
np
.
float64
self
.
_domain_dtype
=
np
.
float32
if
single_precision
else
np
.
float64
self
.
_verbt
,
self
.
_verbadj
=
True
,
Tru
e
self
.
_verbt
,
self
.
_verbadj
=
verbose
,
verbos
e
def
apply
(
self
,
x
,
mode
):
def
apply
(
self
,
x
,
mode
):
self
.
_check_input
(
x
,
mode
)
self
.
_check_input
(
x
,
mode
)
...
...
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