Skip to content
GitLab
Menu
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
9df6b03c
Commit
9df6b03c
authored
May 28, 2019
by
Martin Reinecke
Browse files
merge
parents
63791924
f22c1e84
Pipeline
#50116
failed with stages
in 4 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/library/gridder.py
View file @
9df6b03c
...
...
@@ -24,7 +24,7 @@ import numpy as np
class
GridderMaker
(
object
):
def
__init__
(
self
,
dirty_domain
,
uvw
,
channel_fact
,
eps
=
2e-13
):
def
__init__
(
self
,
dirty_domain
,
uvw
,
channel_fact
,
flags
,
eps
=
2e-13
):
import
nifty_gridder
dirty_domain
=
makeDomain
(
dirty_domain
)
if
(
len
(
dirty_domain
)
!=
1
or
not
isinstance
(
dirty_domain
[
0
],
RGSpace
)
...
...
@@ -32,19 +32,18 @@ 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
,
np
.
zeros
((
uvw
.
shape
[
0
],
channel_fact
.
shape
[
0
]),
dtype
=
np
.
bool
))
bl
=
nifty_gridder
.
Baselines
(
uvw
,
channel_fact
,
flags
)
nxdirty
,
nydirty
=
dirty_domain
.
shape
gconf
=
nifty_gridder
.
GridderConfig
(
nxdirty
,
nydirty
,
eps
,
1.
,
1.
)
nu
=
gconf
.
Nu
()
nv
=
gconf
.
Nv
()
idx
=
nifty_gridder
.
getIndices
(
bl
,
gconf
)
self
.
_idx
=
nifty_gridder
.
getIndices
(
bl
,
gconf
)
self
.
_bl
=
bl
grid_domain
=
RGSpace
([
nu
,
nv
],
distances
=
[
1
,
1
],
harmonic
=
False
)
self
.
_rest
=
_RestOperator
(
dirty_domain
,
grid_domain
,
gconf
)
self
.
_gridder
=
RadioGridder
(
grid_domain
,
bl
,
gconf
,
idx
)
self
.
_gridder
=
RadioGridder
(
grid_domain
,
bl
,
gconf
,
self
.
_
idx
)
def
getGridder
(
self
):
return
self
.
_gridder
...
...
@@ -55,6 +54,9 @@ class GridderMaker(object):
def
getFull
(
self
):
return
self
.
getRest
()
@
self
.
_gridder
def
ms2vis
(
self
,
x
):
return
self
.
_bl
.
ms2vis
(
x
,
self
.
_idx
)
class
_RestOperator
(
LinearOperator
):
def
__init__
(
self
,
dirty_domain
,
grid_domain
,
gconf
):
...
...
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