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_gridder
Commits
f122e045
Commit
f122e045
authored
Aug 16, 2019
by
Martin Reinecke
Browse files
rearrangements and comments
parent
b60b3b60
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty_gridder.cc
View file @
f122e045
...
...
@@ -552,6 +552,15 @@ template<typename T> class GridderConfig
T
beta
;
vector
<
T
>
cfu
,
cfv
;
complex
<
T
>
wscreen
(
double
x
,
double
y
,
double
w
,
bool
adjoint
)
const
{
constexpr
double
pi
=
3.141592653589793238462643383279502884197
;
double
n
=
cos
(
sqrt
(
x
+
y
)),
xn
=
1.
/
n
;
double
phase
=
2
*
pi
*
w
*
(
n
-
1
);
if
(
adjoint
)
phase
*=
-
1
;
return
complex
<
T
>
(
cos
(
phase
)
*
xn
,
sin
(
phase
)
*
xn
);
}
public:
GridderConfig
(
size_t
nxdirty
,
size_t
nydirty
,
double
epsilon
,
double
pixsize_x
,
double
pixsize_y
)
...
...
@@ -707,14 +716,6 @@ template<typename T> class GridderConfig
}
return
tmp
;
}
complex
<
T
>
wscreen
(
double
x
,
double
y
,
double
w
,
bool
adjoint
)
const
{
constexpr
double
pi
=
3.141592653589793238462643383279502884197
;
double
n
=
cos
(
sqrt
(
x
+
y
)),
xn
=
1.
/
n
;
double
phase
=
2
*
pi
*
w
*
(
n
-
1
);
if
(
adjoint
)
phase
*=
-
1
;
return
complex
<
T
>
(
cos
(
phase
)
*
xn
,
sin
(
phase
)
*
xn
);
}
inline
void
getpix
(
T
u_in
,
T
v_in
,
T
&
u
,
T
&
v
,
int
&
iu0
,
int
&
iv0
)
const
{
u
=
fmodulo
(
u_in
*
psx
,
T
(
1
))
*
nu
,
...
...
@@ -745,17 +746,16 @@ template<typename T> class GridderConfig
{
double
fy
=
y0
+
j
*
psy
;
auto
ws
=
wscreen
(
fx
,
fy
*
fy
,
w
,
adjoint
);
res
[
ny_dirty
*
i
+
j
]
=
dirty
[
ny_dirty
*
i
+
j
]
*
ws
;
size_t
i2
=
nx_dirty
-
i
,
j2
=
ny_dirty
-
j
;
res
[
ny_dirty
*
i
+
j
]
=
dirty
[
ny_dirty
*
i
+
j
]
*
ws
;
// lower left
size_t
i2
=
nx_dirty
-
i
,
j2
=
ny_dirty
-
j
;
if
((
i
>
0
)
&&
(
i
<
i2
))
{
res
[
ny_dirty
*
i2
+
j
]
=
dirty
[
ny_dirty
*
i2
+
j
]
*
ws
;
res
[
ny_dirty
*
i2
+
j
]
=
dirty
[
ny_dirty
*
i2
+
j
]
*
ws
;
// lower right
if
((
j
>
0
)
&&
(
j
<
j2
))
res
[
ny_dirty
*
i2
+
j2
]
=
dirty
[
ny_dirty
*
i2
+
j2
]
*
ws
;
res
[
ny_dirty
*
i2
+
j2
]
=
dirty
[
ny_dirty
*
i2
+
j2
]
*
ws
;
// upper right
}
if
((
j
>
0
)
&&
(
j
<
j2
))
res
[
ny_dirty
*
i
+
j2
]
=
dirty
[
ny_dirty
*
i
+
j2
]
*
ws
;
res
[
ny_dirty
*
i
+
j2
]
=
dirty
[
ny_dirty
*
i
+
j2
]
*
ws
;
// upper left
}
}
}
...
...
Write
Preview
Supports
Markdown
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