Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nifty_gridder
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ift
nifty_gridder
Commits
73a27198
Commit
73a27198
authored
Oct 08, 2019
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
5e415e5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
gridder_cxx.h
gridder_cxx.h
+1
-1
nifty_gridder.cc
nifty_gridder.cc
+19
-19
No files found.
gridder_cxx.h
View file @
73a27198
...
...
@@ -1303,7 +1303,7 @@ template<typename T> void update_idx(vector<T> &v, vector<T> &vold,
{
if
(
irem
!=
erem
)
{
while
((
iin
!=
ein
)
&&
(
*
iin
==*
irem
))
while
((
iin
!=
ein
)
&&
(
irem
!=
erem
)
&&
(
*
iin
==*
irem
))
{
++
irem
;
++
iin
;
}
// skip the entries to be removed
if
(
iin
==
ein
)
break
;
}
...
...
nifty_gridder.cc
View file @
73a27198
...
...
@@ -26,7 +26,7 @@
using
namespace
std
;
using
namespace
gridder
;
using
gridder
::
detail
::
idx_t
;
namespace
py
=
pybind11
;
namespace
{
...
...
@@ -167,7 +167,7 @@ class PyBaselines: public Baselines
The visibility data for the index array
)"""
;
template
<
typename
T
>
pyarr
<
T
>
effectiveuvw
(
const
pyarr
<
uint32
_t
>
&
idx_
)
const
template
<
typename
T
>
pyarr
<
T
>
effectiveuvw
(
const
pyarr
<
idx
_t
>
&
idx_
)
const
{
size_t
nvis
=
size_t
(
idx_
.
shape
(
0
));
auto
idx
=
make_const_mav
<
1
>
(
idx_
);
...
...
@@ -181,7 +181,7 @@ class PyBaselines: public Baselines
}
template
<
typename
T
>
pyarr
<
T
>
ms2vis
(
const
pyarr
<
T
>
&
ms_
,
const
pyarr
<
uint32
_t
>
&
idx_
,
size_t
nthreads
)
const
const
pyarr
<
idx
_t
>
&
idx_
,
size_t
nthreads
)
const
{
auto
idx
=
make_const_mav
<
1
>
(
idx_
);
size_t
nvis
=
size_t
(
idx
.
shape
(
0
));
...
...
@@ -213,7 +213,7 @@ class PyBaselines: public Baselines
the measurement set's visibility data (0 where not covered by idx)
)"""
;
template
<
typename
T
>
pyarr
<
T
>
vis2ms
(
const
pyarr
<
T
>
&
vis_
,
const
pyarr
<
uint32
_t
>
&
idx_
,
py
::
object
&
ms_in
,
size_t
nthreads
)
const
const
pyarr
<
idx
_t
>
&
idx_
,
py
::
object
&
ms_in
,
size_t
nthreads
)
const
{
auto
vis
=
make_const_mav
<
1
>
(
vis_
);
auto
idx
=
make_const_mav
<
1
>
(
idx_
);
...
...
@@ -462,7 +462,7 @@ np.array((nu,nv), dtype=np.complex128):
)"""
;
template
<
typename
T
>
pyarr
<
complex
<
T
>>
Pyvis2grid_c
(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
uint32
_t
>
&
idx_
,
const
pyarr
<
complex
<
T
>>
&
vis_
,
const
pyarr
<
idx
_t
>
&
idx_
,
const
pyarr
<
complex
<
T
>>
&
vis_
,
py
::
object
&
grid_in
,
const
py
::
object
&
wgt_
)
{
auto
vis2
=
make_const_mav
<
1
>
(
vis_
);
...
...
@@ -504,7 +504,7 @@ np.array((nu,nv), dtype=np.float64):
the gridded visibilities (made real by making use of Hermitian symmetry)
)"""
;
template
<
typename
T
>
pyarr
<
T
>
Pyvis2grid
(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
uint32
_t
>
&
idx_
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
idx
_t
>
&
idx_
,
const
pyarr
<
complex
<
T
>>
&
vis_
,
py
::
object
&
grid_in
,
const
py
::
object
&
wgt_
)
{
auto
tmp
=
Pyvis2grid_c
(
baselines
,
gconf
,
idx_
,
vis_
,
None
,
wgt_
);
...
...
@@ -542,7 +542,7 @@ np.array((nu,nv), dtype=np.complex128):
)"""
;
template
<
typename
T
>
pyarr
<
complex
<
T
>>
Pyms2grid_c
(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
uint32
_t
>
&
idx_
,
const
pyarr
<
complex
<
T
>>
&
ms_
,
const
pyarr
<
idx
_t
>
&
idx_
,
const
pyarr
<
complex
<
T
>>
&
ms_
,
py
::
object
&
grid_in
,
const
py
::
object
&
wgt_
)
{
auto
nrows
=
baselines
.
Nrows
();
...
...
@@ -562,7 +562,7 @@ template<typename T> pyarr<complex<T>> Pyms2grid_c(
template
<
typename
T
>
pyarr
<
T
>
Pyms2grid
(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
uint32
_t
>
&
idx_
,
const
pyarr
<
complex
<
T
>>
&
ms_
,
const
pyarr
<
idx
_t
>
&
idx_
,
const
pyarr
<
complex
<
T
>>
&
ms_
,
py
::
object
&
grid_in
,
const
py
::
object
&
wgt_
)
{
auto
tmp
=
Pyms2grid_c
(
baselines
,
gconf
,
idx_
,
ms_
,
None
,
wgt_
);
...
...
@@ -577,7 +577,7 @@ template<typename T> pyarr<T> Pyms2grid(
template
<
typename
T
>
pyarr
<
complex
<
T
>>
Pygrid2vis_c
(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
uint32
_t
>
&
idx_
,
const
pyarr
<
complex
<
T
>>
&
grid_
,
const
pyarr
<
idx
_t
>
&
idx_
,
const
pyarr
<
complex
<
T
>>
&
grid_
,
const
py
::
object
&
wgt_
)
{
auto
grid2
=
make_const_mav
<
2
>
(
grid_
);
...
...
@@ -618,7 +618,7 @@ np.array((nvis,), dtype=np.complex)
The degridded visibility data
)"""
;
template
<
typename
T
>
pyarr
<
complex
<
T
>>
Pygrid2vis
(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
uint32
_t
>
&
idx_
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
idx
_t
>
&
idx_
,
const
pyarr
<
T
>
&
grid_
,
const
py
::
object
&
wgt_
)
{
auto
tmp
=
makeArray
<
complex
<
T
>>
({
gconf
.
Nu
(),
gconf
.
Nv
()});
...
...
@@ -628,7 +628,7 @@ template<typename T> pyarr<complex<T>> Pygrid2vis(const PyBaselines &baselines,
template
<
typename
T
>
pyarr
<
complex
<
T
>>
Pygrid2ms_c
(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
uint32
_t
>
&
idx_
,
const
pyarr
<
complex
<
T
>>
&
grid_
,
const
pyarr
<
idx
_t
>
&
idx_
,
const
pyarr
<
complex
<
T
>>
&
grid_
,
py
::
object
&
ms_in
,
const
py
::
object
&
wgt_
)
{
auto
nrows
=
baselines
.
Nrows
();
...
...
@@ -647,7 +647,7 @@ template<typename T> pyarr<complex<T>> Pygrid2ms_c(
}
template
<
typename
T
>
pyarr
<
complex
<
T
>>
Pygrid2ms
(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
uint32
_t
>
&
idx_
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
idx
_t
>
&
idx_
,
const
pyarr
<
T
>
&
grid_
,
py
::
object
&
ms_in
,
const
py
::
object
&
wgt_
)
{
auto
grid2_
=
makeArray
<
complex
<
T
>>
({
gconf
.
Nu
(),
gconf
.
Nv
()});
...
...
@@ -660,7 +660,7 @@ template<typename T> pyarr<complex<T>> apply_holo2(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
py
::
array
&
idx_
,
const
py
::
array
&
grid_
,
const
py
::
object
&
wgt_
)
{
auto
idx
=
getPyarr
<
uint32
_t
>
(
idx_
,
"idx"
);
auto
idx
=
getPyarr
<
idx
_t
>
(
idx_
,
"idx"
);
auto
idx2
=
make_const_mav
<
1
>
(
idx
);
auto
grid
=
getPyarr
<
complex
<
T
>>
(
grid_
,
"grid"
);
auto
grid2
=
make_const_mav
<
2
>
(
grid
);
...
...
@@ -687,7 +687,7 @@ py::array Pyapply_holo(
template
<
typename
T
>
pyarr
<
T
>
Pyget_correlations
(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
uint32
_t
>
&
idx_
,
int
du
,
int
dv
,
const
py
::
object
&
wgt_
)
const
pyarr
<
idx
_t
>
&
idx_
,
int
du
,
int
dv
,
const
py
::
object
&
wgt_
)
{
auto
idx
=
make_const_mav
<
1
>
(
idx_
);
pyarr
<
T
>
wgt2
=
providePotentialArray
<
T
>
(
wgt_
,
"wgt"
,
{
idx
.
shape
(
0
)});
...
...
@@ -729,7 +729,7 @@ np.array((nvis,), dtype=np.uint32)
the compressed indices for all entries which match the selected criteria
and are not flagged.
)"""
;
pyarr
<
uint32
_t
>
PygetIndices
(
const
PyBaselines
&
baselines
,
pyarr
<
idx
_t
>
PygetIndices
(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
bool
>
&
flags_
,
int
chbegin
,
int
chend
,
double
wmin
,
double
wmax
)
{
...
...
@@ -739,7 +739,7 @@ pyarr<uint32_t> PygetIndices(const PyBaselines &baselines,
py
::
gil_scoped_release
release
;
nidx
=
getIdxSize
(
baselines
,
flags
,
chbegin
,
chend
,
wmin
,
wmax
,
gconf
.
Nthreads
());
}
auto
res
=
makeArray
<
uint32
_t
>
({
nidx
});
auto
res
=
makeArray
<
idx
_t
>
({
nidx
});
auto
res2
=
make_mav
<
1
>
(
res
);
{
py
::
gil_scoped_release
release
;
...
...
@@ -753,7 +753,7 @@ template<typename T> pyarr<T> vis2dirty2(const PyBaselines &baselines,
const
py
::
array
&
vis_
,
const
py
::
object
&
wgt_
,
bool
do_wstacking
,
size_t
verbosity
)
{
auto
idx
=
getPyarr
<
uint32
_t
>
(
idx_
,
"idx"
);
auto
idx
=
getPyarr
<
idx
_t
>
(
idx_
,
"idx"
);
auto
idx2
=
make_const_mav
<
1
>
(
idx
);
auto
dirty
=
makeArray
<
T
>
({
gconf
.
Nxdirty
(),
gconf
.
Nydirty
()});
auto
dirty2
=
make_mav
<
2
>
(
dirty
);
...
...
@@ -816,11 +816,11 @@ py::array Pyvis2dirty(const PyBaselines &baselines,
}
template
<
typename
T
>
pyarr
<
complex
<
T
>>
dirty2vis2
(
const
PyBaselines
&
baselines
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
uint32
_t
>
&
idx_
,
const
PyGridderConfig
&
gconf
,
const
pyarr
<
idx
_t
>
&
idx_
,
const
pyarr
<
T
>
&
dirty_
,
const
py
::
object
&
wgt_
,
bool
do_wstacking
,
size_t
verbosity
)
{
auto
idx
=
getPyarr
<
uint32
_t
>
(
idx_
,
"idx"
);
auto
idx
=
getPyarr
<
idx
_t
>
(
idx_
,
"idx"
);
auto
idx2
=
make_const_mav
<
1
>
(
idx
);
auto
dirty
=
getPyarr
<
T
>
(
dirty_
,
"dirty"
);
auto
dirty2
=
make_const_mav
<
2
>
(
dirty_
);
...
...
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