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_gridder
Commits
e8e35562
Commit
e8e35562
authored
Sep 25, 2019
by
Martin Reinecke
Browse files
more tweaks
parent
e81b20be
Changes
3
Hide whitespace changes
Inline
Side-by-side
gridder_cxx.h
View file @
e8e35562
...
...
@@ -530,7 +530,7 @@ class GridderConfig
double
beta
;
vector
<
double
>
cfu
,
cfv
;
size_t
nthreads
;
//
double ushift, vshift;
double
ushift
,
vshift
;
int
maxiu0
,
maxiv0
;
complex
<
double
>
wscreen
(
double
x
,
double
y
,
double
w
,
bool
adjoint
)
const
...
...
@@ -554,7 +554,7 @@ class GridderConfig
nu
(
max
(
2
*
nsafe
,
2
*
nx_dirty
)),
nv
(
max
(
2
*
nsafe
,
2
*
ny_dirty
)),
beta
(
2.3
*
supp
),
cfu
(
nx_dirty
),
cfv
(
ny_dirty
),
nthreads
(
nthreads_
),
//
ushift(
-
supp*0.5+1), vshift(
-
supp*0.5+1),
ushift
(
supp
*
(
-
0.5
)
+
1
+
nu
),
vshift
(
supp
*
(
-
0.5
)
+
1
+
nv
),
maxiu0
((
nu
+
nsafe
)
-
supp
),
maxiv0
((
nv
+
nsafe
)
-
supp
)
{
myassert
((
nx_dirty
&
1
)
==
0
,
"nx_dirty must be even"
);
...
...
@@ -673,12 +673,10 @@ class GridderConfig
void
getpix
(
double
u_in
,
double
v_in
,
double
&
u
,
double
&
v
,
int
&
iu0
,
int
&
iv0
)
const
{
u
=
fmod1
(
u_in
*
psx
)
*
nu
,
iu0
=
int
(
u
-
supp
*
0.5
+
1
+
nu
)
-
nu
;
iu0
=
min
(
iu0
,
maxiu0
);
u
=
fmod1
(
u_in
*
psx
)
*
nu
;
iu0
=
min
(
int
(
u
+
ushift
)
-
int
(
nu
),
maxiu0
);
v
=
fmod1
(
v_in
*
psy
)
*
nv
;
iv0
=
int
(
v
-
supp
*
0.5
+
1
+
nv
)
-
nv
;
iv0
=
min
(
iv0
,
maxiv0
);
iv0
=
min
(
int
(
v
+
vshift
)
-
int
(
nv
),
maxiv0
);
}
template
<
typename
T
>
void
apply_wscreen
(
const
const_mav
<
complex
<
T
>
,
2
>
&
dirty
,
...
...
nifty_gridder.cc
View file @
e8e35562
...
...
@@ -587,9 +587,9 @@ template<typename T> pyarr<complex<T>> Pygrid2vis_c(
auto
wgt2
=
make_const_mav
<
1
>
(
wgt
);
auto
res
=
makeArray
<
complex
<
T
>>
({
nvis
});
auto
vis
=
make_mav
<
1
>
(
res
);
vis
.
fill
(
0
);
{
py
::
gil_scoped_release
release
;
vis
.
fill
(
0
);
grid2vis_c
<
T
>
(
baselines
,
gconf
,
idx2
,
grid2
,
vis
,
wgt2
);
}
return
res
;
...
...
test.py
View file @
e8e35562
...
...
@@ -102,7 +102,7 @@ def test_adjointness_ms2dirty(nxdirty, nydirty, nrow, nchan, epsilon, singleprec
if
wgt
is
not
None
:
wgt
=
wgt
.
astype
(
"f4"
)
dirty2
=
ng
.
ms2dirty
(
uvw
,
freq
,
ms
,
wgt
,
nxdirty
,
nydirty
,
pixsizex
,
pixsizey
,
epsilon
,
wstacking
,
nthreads
,
2
).
astype
(
"f8"
)
pixsizey
,
epsilon
,
wstacking
,
nthreads
,
0
).
astype
(
"f8"
)
ms2
=
ng
.
dirty2ms
(
uvw
,
freq
,
dirty
,
wgt
,
pixsizex
,
pixsizey
,
epsilon
,
wstacking
,
nthreads
,
0
).
astype
(
"c16"
)
tol
=
5e-5
if
singleprec
else
5e-13
...
...
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