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
00fb5b31
Commit
00fb5b31
authored
Aug 29, 2019
by
Martin Reinecke
Browse files
tweaks
parent
ed1b72fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
demo_wstack_realdata.py
View file @
00fb5b31
...
...
@@ -61,20 +61,36 @@ wgt = 1/np.sum(1/wgt, axis=1)
# WEIGHT -> WEIGHT_SPECTRUM
wgt
=
np
.
repeat
(
wgt
[:,
None
],
len
(
freq
),
axis
=
1
)
# FLAGGED -> WGT=0
wgt
[
flags
]
=
0
npixdirty
=
4096
# flip visibilities with w<0
mask
=
uvw
[:,
2
]
<
0
uvw
[
mask
]
*=-
1
uvw
[
mask
]
*=-
1
uvw
[
mask
]
*=-
1
vis
=
np
.
conj
(
vis
)
*
mask
.
reshape
(
-
1
,
1
)
+
vis
*
(
1
-
mask
.
reshape
(
-
1
,
1
))
npixdirty
=
756
DEG2RAD
=
np
.
pi
/
180
pixsize
=
2.3
/
npixdirty
*
DEG2RAD
nthreads
=
4
epsilon
=
1
e-
4
epsilon
=
6
e-
6
t0
=
time
()
print
(
'Start gridding...'
)
dirty
=
ng
.
full_gridding
(
uvw
,
freq
,
vis
,
wgt
,
npixdirty
,
npixdirty
,
pixsize
,
pixsize
,
epsilon
,
nthreads
)
if
(
epsilon
>
5e-6
):
dirty
=
ng
.
full_gridding_f
(
uvw
.
astype
(
"f4"
),
freq
.
astype
(
"f4"
),
vis
.
astype
(
"c8"
),
wgt
.
astype
(
"f4"
),
npixdirty
,
npixdirty
,
pixsize
,
pixsize
,
epsilon
,
nthreads
,
verbosity
=
2
)
else
:
dirty
=
ng
.
full_gridding
(
uvw
,
freq
,
vis
,
wgt
,
npixdirty
,
npixdirty
,
pixsize
,
pixsize
,
epsilon
,
nthreads
,
verbosity
=
2
)
print
(
'Done'
)
t
=
time
()
-
t0
print
(
"{} s"
.
format
(
t
))
print
(
"{} visibilities/
n
thread
s
/s"
.
format
(
np
.
sum
(
wgt
!=
0
)
/
nthreads
/
t
))
print
(
"{} visibilities/thread/s"
.
format
(
np
.
sum
(
wgt
!=
0
)
/
nthreads
/
t
))
plt
.
imshow
(
dirty
.
real
)
plt
.
show
()
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