Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
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
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
ift
NIFTy
Commits
d05c02bb
Commit
d05c02bb
authored
6 years ago
by
Martin Reinecke
Browse files
Options
Downloads
Patches
Plain Diff
adjust
parent
a9b8d316
No related branches found
No related tags found
1 merge request
!327
Power grid
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nifty5/library/gridder.py
+4
-4
4 additions, 4 deletions
nifty5/library/gridder.py
test/test_operators/test_nft.py
+2
-1
2 additions, 1 deletion
test/test_operators/test_nft.py
with
6 additions
and
5 deletions
nifty5/library/gridder.py
+
4
−
4
View file @
d05c02bb
...
...
@@ -35,7 +35,9 @@ class GridderMaker(object):
raise
ValueError
(
"
need dirty_domain with exactly one 2D RGSpace
"
)
if
channel_fact
.
ndim
!=
1
:
raise
ValueError
(
"
channel_fact must be a 1D array
"
)
bl
=
nifty_gridder
.
Baselines
(
uvw
,
channel_fact
);
bl
=
nifty_gridder
.
Baselines
(
uvw
,
channel_fact
,
np
.
zeros
((
uvw
.
shape
[
0
],
channel_fact
.
shape
[
0
]),
dtype
=
np
.
bool
))
nxdirty
,
nydirty
=
dirty_domain
.
shape
gconf
=
nifty_gridder
.
GridderConfig
(
nxdirty
,
nydirty
,
eps
,
1.
,
1.
)
nu
=
gconf
.
Nu
()
...
...
@@ -59,14 +61,12 @@ class GridderMaker(object):
class
_RestOperator
(
LinearOperator
):
def
__init__
(
self
,
dirty_domain
,
grid_domain
,
gconf
):
import
nifty_gridder
self
.
_domain
=
makeDomain
(
grid_domain
)
self
.
_target
=
makeDomain
(
dirty_domain
)
self
.
_gconf
=
gconf
self
.
_capability
=
self
.
TIMES
|
self
.
ADJOINT_TIMES
def
apply
(
self
,
x
,
mode
):
import
nifty_gridder
self
.
_check_input
(
x
,
mode
)
res
=
x
.
to_global_data
()
if
mode
==
self
.
TIMES
:
...
...
@@ -90,7 +90,7 @@ class RadioGridder(LinearOperator):
import
nifty_gridder
self
.
_check_input
(
x
,
mode
)
if
mode
==
self
.
TIMES
:
x
=
x
.
to_global_data
().
reshape
((
-
1
,
1
))
x
=
x
.
to_global_data
().
reshape
((
-
1
,
1
))
x
=
self
.
_bl
.
ms2vis
(
x
,
self
.
_idx
)
res
=
nifty_gridder
.
vis2grid
(
self
.
_bl
,
self
.
_gconf
,
self
.
_idx
,
x
)
...
...
This diff is collapsed.
Click to expand it.
test/test_operators/test_nft.py
+
2
−
1
View file @
d05c02bb
...
...
@@ -39,7 +39,8 @@ def test_gridding(nu, nv, N, eps):
vis
=
(
np
.
random
.
randn
(
N
)
+
1j
*
np
.
random
.
randn
(
N
))
# Nifty
GM
=
ift
.
GridderMaker
(
ift
.
RGSpace
((
nu
,
nv
)),
uvw
=
uvw
,
channel_fact
=
np
.
array
([
1.
]),
eps
=
eps
)
GM
=
ift
.
GridderMaker
(
ift
.
RGSpace
((
nu
,
nv
)),
uvw
=
uvw
,
channel_fact
=
np
.
array
([
1.
]),
eps
=
eps
)
vis2
=
ift
.
from_global_data
(
ift
.
UnstructuredDomain
(
vis
.
shape
),
vis
)
Op
=
GM
.
getFull
()
...
...
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