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
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
ift
nifty_gridder
Commits
72b5fd8a
Commit
72b5fd8a
authored
Aug 28, 2019
by
Philipp Arras
Browse files
Simplifications
parent
a2dd2708
Changes
1
Hide whitespace changes
Inline
Side-by-side
test.py
View file @
72b5fd8a
...
...
@@ -363,21 +363,20 @@ def test_holo_from_correlations(nxdirty, nydirty, nchan, nrow, epsilon):
W
=
conf
.
W
()
mat
=
np
.
zeros
(
2
*
(
gridsize
,))
n
=
gridsize
*
(
2
*
W
-
1
)
**
2
row
=
np
.
zeros
((
n
,))
col
=
np
.
zeros
((
n
,))
data
=
np
.
zeros
((
n
,))
foo
=
np
.
arange
(
0
,
gridsize
)
row
=
np
.
empty
((
n
,))
col
=
np
.
empty
((
n
,))
data
=
np
.
empty
((
n
,))
ind
=
np
.
arange
(
0
,
gridsize
)
ycoord0
=
ind
%
ny
xcoord0
=
ind
-
ycoord0
for
ii
,
(
du
,
dv
)
in
enumerate
(
product
(
range
(
-
W
+
1
,
W
),
range
(
-
W
+
1
,
W
))):
ilow
=
ii
*
gridsize
ihigh
=
(
ii
+
1
)
*
gridsize
data
[
ilow
:
ihigh
]
=
ng
.
get_correlations
(
bl
,
conf
,
idx
,
du
=
du
,
dv
=
dv
).
ravel
()
row
[
ilow
:
ihigh
]
=
foo
ycoord
=
foo
%
ny
xcoord
=
foo
-
ycoord
tmp
=
(
ycoord
+
dv
)
%
ny
+
xcoord
ycoord
=
tmp
%
ny
xcoord
=
tmp
-
ycoord
col
[
ilow
:
ihigh
]
=
(
xcoord
+
du
*
ny
)
%
gridsize
+
ycoord
row
[
ilow
:
ihigh
]
=
ind
foo
=
(
ycoord0
+
dv
)
%
ny
+
xcoord0
yy
=
foo
%
ny
col
[
ilow
:
ihigh
]
=
(
foo
-
yy
+
du
*
ny
)
%
gridsize
+
yy
mat
=
coo_matrix
((
data
,
(
row
,
col
)),
shape
=
(
gridsize
,
gridsize
))
res2
=
mat
.
dot
(
grid
.
ravel
()).
reshape
(
nx
,
ny
)
assert_allclose
(
res1
,
res2
)
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