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
9db2e777
Commit
9db2e777
authored
Jun 07, 2019
by
Simon Perkins
Browse files
user_grid in ms2grid functions
parent
e25b1855
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty_gridder.cc
View file @
9db2e777
...
...
@@ -691,7 +691,8 @@ template<typename T> pyarr_c<T> vis2grid(const Baselines<T> &baselines,
template
<
typename
T
>
pyarr_c
<
complex
<
T
>>
ms2grid_c
(
const
Baselines
<
T
>
&
baselines
,
const
GridderConfig
<
T
>
&
gconf
,
const
pyarr_c
<
uint32_t
>
&
idx_
,
const
pyarr_c
<
complex
<
T
>>
&
ms_
)
const
pyarr_c
<
uint32_t
>
&
idx_
,
const
pyarr_c
<
complex
<
T
>>
&
ms_
,
py
::
object
user_grid
)
{
auto
nrows
=
baselines
.
Nrows
();
auto
nchan
=
baselines
.
Nchannels
();
...
...
@@ -701,8 +702,11 @@ template<typename T> pyarr_c<complex<T>> ms2grid_c(
auto
ms
=
ms_
.
data
();
auto
idx
=
idx_
.
data
();
bool
have_user_grid
=
!
user_grid
.
is
(
py
::
none
());
size_t
nu
=
gconf
.
Nu
(),
nv
=
gconf
.
Nv
();
auto
res
=
makeArray
<
complex
<
T
>>
({
nu
,
nv
});
auto
res
=
have_user_grid
?
user_grid
.
cast
<
pyarr_c
<
complex
<
T
>>>
()
:
makeArray
<
complex
<
T
>>
({
nu
,
nv
});
auto
grid
=
res
.
mutable_data
();
{
py
::
gil_scoped_release
release
;
...
...
@@ -740,8 +744,8 @@ template<typename T> pyarr_c<complex<T>> ms2grid_c(
template
<
typename
T
>
pyarr_c
<
T
>
ms2grid
(
const
Baselines
<
T
>
&
baselines
,
const
GridderConfig
<
T
>
&
gconf
,
const
pyarr_c
<
uint32_t
>
&
idx_
,
const
pyarr_c
<
complex
<
T
>>
&
ms_
)
{
return
complex2hartley
(
ms2grid_c
(
baselines
,
gconf
,
idx_
,
ms_
));
}
const
pyarr_c
<
complex
<
T
>>
&
ms_
,
py
::
object
user_grid
)
{
return
complex2hartley
(
ms2grid_c
(
baselines
,
gconf
,
idx_
,
ms_
,
user_grid
));
}
template
<
typename
T
>
pyarr_c
<
complex
<
T
>>
grid2vis_c
(
const
Baselines
<
T
>
&
baselines
,
const
GridderConfig
<
T
>
&
gconf
,
const
pyarr_c
<
uint32_t
>
&
idx_
,
...
...
@@ -1126,7 +1130,8 @@ PYBIND11_MODULE(nifty_gridder, m)
"wmin"
_a
=-
1e30
,
"wmax"
_a
=
1e30
);
m
.
def
(
"vis2grid"
,
&
vis2grid
<
double
>
,
vis2grid_DS
,
"baselines"
_a
,
"gconf"
_a
,
"idx"
_a
,
"vis"
_a
,
"user_grid"
_a
);
m
.
def
(
"ms2grid"
,
&
ms2grid
<
double
>
,
"baselines"
_a
,
"gconf"
_a
,
"idx"
_a
,
"ms"
_a
);
m
.
def
(
"ms2grid"
,
&
ms2grid
<
double
>
,
"baselines"
_a
,
"gconf"
_a
,
"idx"
_a
,
"ms"
_a
,
"user_grid"
_a
);
m
.
def
(
"grid2vis"
,
&
grid2vis
<
double
>
,
grid2vis_DS
,
"baselines"
_a
,
"gconf"
_a
,
"idx"
_a
,
"grid"
_a
);
m
.
def
(
"grid2ms"
,
&
grid2ms
<
double
>
,
"baselines"
_a
,
"gconf"
_a
,
"idx"
_a
,
...
...
@@ -1134,7 +1139,7 @@ PYBIND11_MODULE(nifty_gridder, m)
m
.
def
(
"vis2grid_c"
,
&
vis2grid_c
<
double
>
,
"baselines"
_a
,
"gconf"
_a
,
"idx"
_a
,
"vis"
_a
,
"user_grid"
_a
);
m
.
def
(
"ms2grid_c"
,
&
ms2grid_c
<
double
>
,
"baselines"
_a
,
"gconf"
_a
,
"idx"
_a
,
"ms"
_a
);
"ms"
_a
,
"user_grid"
_a
);
m
.
def
(
"grid2vis_c"
,
&
grid2vis_c
<
double
>
,
"baselines"
_a
,
"gconf"
_a
,
"idx"
_a
,
"grid"
_a
);
m
.
def
(
"grid2ms_c"
,
&
grid2ms_c
<
double
>
,
"baselines"
_a
,
"gconf"
_a
,
"idx"
_a
,
...
...
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