Commit 089b6fc8 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

more consistent naming

parent 4df633ac
......@@ -147,7 +147,7 @@ size_t get_w(double epsilon)
throw runtime_error("requested epsilon too small - minimum is 2e-13");
}
void checkarray(const py::array &arr, const char *aname,
void checkArray(const py::array &arr, const char *aname,
const vector<size_t> &shape)
{
if (size_t(arr.ndim())!=shape.size())
......@@ -168,7 +168,7 @@ void checkarray(const py::array &arr, const char *aname,
template<typename T> pyarr_c<T> complex2hartley
(const pyarr_c<complex<T>> &grid_)
{
checkarray(grid_, "grid", {0,0});
checkArray(grid_, "grid", {0,0});
size_t nu = size_t(grid_.shape(0)), nv = size_t(grid_.shape(1));
auto grid = grid_.data();
......@@ -193,7 +193,7 @@ template<typename T> pyarr_c<T> complex2hartley
template<typename T> pyarr_c<complex<T>> hartley2complex
(const pyarr_c<T> &grid_)
{
checkarray(grid_, "grid", {0, 0});
checkArray(grid_, "grid", {0, 0});
size_t nu = size_t(grid_.shape(0)), nv = size_t(grid_.shape(1));
auto grid = grid_.data();
......@@ -283,8 +283,8 @@ template<typename T> class Baselines
public:
Baselines(const pyarr_c<T> &coord_, const pyarr_c<T> &scaling_)
{
checkarray(coord_, "coord", {0, 3});
checkarray(scaling_, "scaling", {0});
checkArray(coord_, "coord", {0, 3});
checkArray(scaling_, "scaling", {0});
nrows = coord_.shape(0);
nchan = scaling_.shape(0);
scaling.resize(nchan);
......@@ -311,8 +311,8 @@ template<typename T> class Baselines
template<typename T2> pyarr_c<T2> ms2vis(const pyarr_c<T2> &ms_,
const pyarr_c<uint32_t> &idx_) const
{
checkarray(idx_, "idx", {0});
checkarray(ms_, "ms", {nrows, nchan});
checkArray(idx_, "idx", {0});
checkArray(ms_, "ms", {nrows, nchan});
size_t nvis = size_t(idx_.shape(0));
auto idx = idx_.data();
auto ms = ms_.data();
......@@ -328,9 +328,9 @@ template<typename T> class Baselines
template<typename T2> pyarr_c<T2> vis2ms(const pyarr_c<T2> &vis_,
const pyarr_c<uint32_t> &idx_) const
{
checkarray(vis_, "vis", {0});
checkArray(vis_, "vis", {0});
size_t nvis = size_t(vis_.shape(0));
checkarray(idx_, "idx", {nvis});
checkArray(idx_, "idx", {nvis});
auto idx = idx_.data();
auto vis = vis_.data();
......@@ -347,10 +347,10 @@ template<typename T> class Baselines
template<typename T2> pyarr_c<T2> add_vis_to_ms(const pyarr_c<T2> &vis_,
const pyarr_c<uint32_t> &idx_, pyarr_c<T2> &ms_) const
{
checkarray(vis_, "vis", {0});
checkArray(vis_, "vis", {0});
size_t nvis = size_t(vis_.shape(0));
checkarray(idx_, "idx", {nvis});
checkarray(ms_, "ms", {nrows, nchan});
checkArray(idx_, "idx", {nvis});
checkArray(ms_, "ms", {nrows, nchan});
auto idx = idx_.data();
auto vis = vis_.data();
auto ms = ms_.mutable_data();
......@@ -407,7 +407,7 @@ template<typename T> class GridderConfig
T Beta() const { return beta; }
pyarr_c<T> grid2dirty(const pyarr_c<T> &grid) const
{
checkarray(grid, "grid", {nu, nv});
checkArray(grid, "grid", {nu, nv});
auto tmp = makearray<T>({nu, nv});
auto ptmp = tmp.mutable_data();
hartley2_2D<T>(grid, tmp);
......@@ -426,7 +426,7 @@ template<typename T> class GridderConfig
}
pyarr_c<complex<T>> grid2dirty_c(const pyarr_c<complex<T>> &grid) const
{
checkarray(grid, "grid", {nu, nv});
checkArray(grid, "grid", {nu, nv});
auto tmp = makearray<complex<T>>({nu, nv});
auto ptmp = tmp.mutable_data();
pocketfft::c2c({nu,nv},{grid.strides(0),grid.strides(1)},
......@@ -447,7 +447,7 @@ template<typename T> class GridderConfig
}
pyarr_c<T> dirty2grid(const pyarr_c<T> &dirty) const
{
checkarray(dirty, "dirty", {nx_dirty, ny_dirty});
checkArray(dirty, "dirty", {nx_dirty, ny_dirty});
auto pdirty = dirty.data();
auto tmp = makearray<T>({nu, nv});
auto ptmp = tmp.mutable_data();
......@@ -467,7 +467,7 @@ template<typename T> class GridderConfig
}
pyarr_c<complex<T>> dirty2grid_c(const pyarr_c<complex<T>> &dirty) const
{
checkarray(dirty, "dirty", {nx_dirty, ny_dirty});
checkArray(dirty, "dirty", {nx_dirty, ny_dirty});
auto pdirty = dirty.data();
auto tmp = makearray<complex<T>>({nu, nv});
auto ptmp = tmp.mutable_data();
......@@ -597,9 +597,9 @@ template<typename T> pyarr_c<complex<T>> vis2grid_c(const Baselines<T> &baseline
const GridderConfig<T> &gconf, const pyarr_c<uint32_t> &idx_,
const pyarr_c<complex<T>> &vis_)
{
checkarray(vis_, "vis", {0});
checkArray(vis_, "vis", {0});
size_t nvis = size_t(vis_.shape(0));
checkarray(idx_, "idx", {nvis});
checkArray(idx_, "idx", {nvis});
auto vis=vis_.data();
auto idx = idx_.data();
......@@ -647,9 +647,9 @@ template<typename T> pyarr_c<complex<T>> grid2vis_c(const Baselines<T> &baseline
const pyarr_c<complex<T>> &grid_)
{
size_t nu=gconf.Nu(), nv=gconf.Nv();
checkarray(idx_, "idx", {0});
checkArray(idx_, "idx", {0});
auto grid = grid_.data();
checkarray(grid_, "grid", {nu, nv});
checkArray(grid_, "grid", {nu, nv});
size_t nvis = size_t(idx_.shape(0));
auto idx = idx_.data();
......@@ -701,7 +701,7 @@ template<typename T> pyarr_c<uint32_t> getIndices(const Baselines<T> &baselines,
nsafe=gconf.Nsafe();
if (chbegin<0) chbegin=0;
if (chend<0) chend=nchan;
checkarray(flags_, "flags", {nrow, nchan});
checkArray(flags_, "flags", {nrow, nchan});
auto flags = flags_.data();
constexpr int side=1<<logsquare;
size_t nbu = (gconf.Nu()+1+side-1) >> logsquare,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment