Commit b83841dd authored by Martin Reinecke's avatar Martin Reinecke
Browse files

more sanity checks

parent baa1ee26
......@@ -585,6 +585,9 @@ template<typename T> class GridderConfig
}
pyarr_c<T> grid2dirty(const pyarr_c<T> &grid) const
{
myassert(grid.ndim()==2, "grid must be a 2D array");
myassert(size_t(grid.shape(0))==nu, "bad 1st dimension");
myassert(size_t(grid.shape(1))==nv, "bad 2nd dimension");
auto tmp = makearray<T>({nu, nv});
auto ptmp = tmp.mutable_data();
hartley2_2D<T>(grid, tmp);
......@@ -603,6 +606,9 @@ template<typename T> class GridderConfig
}
pyarr_c<T> dirty2grid(const pyarr_c<T> &dirty) const
{
myassert(dirty.ndim()==2, "dirty must be a 2D array");
myassert(size_t(dirty.shape(0))==nx_dirty, "bad 1st dimension");
myassert(size_t(dirty.shape(1))==ny_dirty, "bad 2nd dimension");
auto pdirty = dirty.data();
auto tmp = makearray<T>({nu, nv});
auto ptmp = tmp.mutable_data();
......
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