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
d62f5f69
Commit
d62f5f69
authored
Jul 30, 2019
by
Philipp Arras
Browse files
Add function which returns all effective uvws
parent
59119185
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty_gridder.cc
View file @
d62f5f69
...
...
@@ -412,6 +412,24 @@ template<typename T> class Baselines
np.array((nvis,), dtype=np.complex)
The visibility data for the index array
)"""
;
pyarr_c
<
T
>
ind2effectiveuvw
(
const
pyarr_c
<
uint32_t
>
&
idx_
)
const
{
checkArray
(
idx_
,
"idx"
,
{
0
});
size_t
nvis
=
size_t
(
idx_
.
shape
(
0
));
auto
idx
=
idx_
.
template
unchecked
<
1
>();
auto
res_
=
makeArray
<
T
>
({
nvis
,
3
});
auto
res
=
res_
.
template
mutable_unchecked
<
2
>();
for
(
size_t
i
=
0
;
i
<
nvis
;
i
++
)
{
auto
uvw
=
effectiveCoord
(
idx
(
i
));
res
(
i
,
0
)
=
uvw
.
u
;
res
(
i
,
1
)
=
uvw
.
v
;
res
(
i
,
2
)
=
uvw
.
w
;
}
return
res_
;
}
template
<
typename
T2
>
pyarr_c
<
T2
>
ms2vis
(
const
pyarr
<
T2
>
&
ms_
,
const
pyarr_c
<
uint32_t
>
&
idx_
)
const
{
...
...
@@ -1528,6 +1546,7 @@ PYBIND11_MODULE(nifty_gridder, m)
.
def
(
"Nchannels"
,
&
Baselines
<
double
>::
Nchannels
)
.
def
(
"ms2vis"
,
&
Baselines
<
double
>::
ms2vis
<
complex
<
double
>>
,
Baselines
<
double
>::
ms2vis_DS
,
"ms"
_a
,
"idx"
_a
)
.
def
(
"ind2effectiveuvw"
,
&
Baselines
<
double
>::
ind2effectiveuvw
,
"idx"
_a
)
.
def
(
"vis2ms"
,
&
Baselines
<
double
>::
vis2ms
<
complex
<
double
>>
,
Baselines
<
double
>::
vis2ms_DS
,
"vis"
_a
,
"idx"
_a
,
"ms_in"
_a
=
None
);
py
::
class_
<
GridderConfig
<
double
>>
(
m
,
"GridderConfig"
,
GridderConfig_DS
)
...
...
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