Skip to content
GitLab
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
9fb21e4b
Commit
9fb21e4b
authored
Apr 12, 2019
by
Martin Reinecke
Browse files
use new helper functions
parent
b31bc4eb
Pipeline
#46795
passed with stages
in 16 minutes and 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/library/gridder.py
View file @
9fb21e4b
...
...
@@ -114,16 +114,15 @@ class RadioGridder(LinearOperator):
self
.
_uv
=
uv
# FIXME: should we write-protect this?
def
apply
(
self
,
x
,
mode
):
from
nifty_gridder
import
to_grid
,
from_grid
from
nifty_gridder
import
(
to_grid
,
to_grid_post
,
from_grid
,
from_grid_pre
)
self
.
_check_input
(
x
,
mode
)
nu2
,
nv2
=
self
.
_target
.
shape
x
=
x
.
to_global_data
()
if
mode
==
self
.
TIMES
:
res
=
to_grid
(
self
.
_uv
,
x
,
nu2
,
nv2
,
self
.
_nspread
,
self
.
_r2lamb
)
res
+=
np
.
conj
(
np
.
roll
(
res
[::
-
1
,
::
-
1
],
(
1
,
1
),
axis
=
(
0
,
1
)))
res
=
0.5
*
(
res
.
real
+
res
.
imag
)
res
=
to_grid_post
(
res
)
else
:
mirr
=
np
.
roll
(
x
[::
-
1
,
::
-
1
],
(
1
,
1
),
axis
=
(
0
,
1
))
x
=
0.5
*
(
x
+
mirr
+
1j
*
(
x
-
mirr
))
x
=
from_grid_pre
(
x
)
res
=
from_grid
(
self
.
_uv
,
x
,
nu2
,
nv2
,
self
.
_nspread
,
self
.
_r2lamb
)
return
from_global_data
(
self
.
_tgt
(
mode
),
res
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment