Commit 6e7e6690 authored by Martin Reinecke's avatar Martin Reinecke

lessons learned from yet another broken MacOS installation

parent 4282d380
......@@ -143,6 +143,41 @@ coord: np.array((nrows, 3), dtype=np.float64)
freq: np.array((nchannels,), dtype=np.float64)
frequency for each individual channel (in Hz)
)""";
constexpr auto ms2vis_DS = R"""(
Extracts visibility data from a measurement for the provided indices.
Parameters
==========
ms: np.array((nrows, nchannels), dtype=np.complex)
the measurement set's visibility data
idx: np.array((nvis,), dtype=np.uint32)
the indices to be extracted
Returns
=======
np.array((nvis,), dtype=np.complex)
The visibility data for the index array
)""";
constexpr auto vis2ms_DS = R"""(
Produces a new MS with the provided visibilities set.
Parameters
==========
vis: np.array((nvis,), dtype=np.complex)
The visibility data for the index array
idx: np.array((nvis,), dtype=np.uint32)
the indices to be inserted
ms_in: np.array((nrows, nchannels), dtype=np.complex), optional
input measurement set to which the visibilities are added.
Returns
=======
np.array((nrows, nchannels), dtype=np.complex)
the measurement set's visibility data (0 where not covered by idx)
)""";
class PyBaselines: public Baselines
{
public:
......@@ -151,22 +186,6 @@ class PyBaselines: public Baselines
: Baselines(make_const_mav<2>(coord), make_const_mav<1>(freq))
{}
static constexpr auto ms2vis_DS = R"""(
Extracts visibility data from a measurement for the provided indices.
Parameters
==========
ms: np.array((nrows, nchannels), dtype=np.complex)
the measurement set's visibility data
idx: np.array((nvis,), dtype=np.uint32)
the indices to be extracted
Returns
=======
np.array((nvis,), dtype=np.complex)
The visibility data for the index array
)""";
template<typename T> pyarr<T> effectiveuvw(const pyarr<idx_t> &idx_) const
{
size_t nvis = size_t(idx_.shape(0));
......@@ -195,23 +214,6 @@ class PyBaselines: public Baselines
return res;
}
static constexpr auto vis2ms_DS = R"""(
Produces a new MS with the provided visibilities set.
Parameters
==========
vis: np.array((nvis,), dtype=np.complex)
The visibility data for the index array
idx: np.array((nvis,), dtype=np.uint32)
the indices to be inserted
ms_in: np.array((nrows, nchannels), dtype=np.complex), optional
input measurement set to which the visibilities are added.
Returns
=======
np.array((nrows, nchannels), dtype=np.complex)
the measurement set's visibility data (0 where not covered by idx)
)""";
template<typename T> pyarr<T> vis2ms(const pyarr<T> &vis_,
const pyarr<idx_t> &idx_, py::object &ms_in, size_t nthreads) const
{
......@@ -1039,10 +1041,10 @@ PYBIND11_MODULE(nifty_gridder, m)
.def ("Nrows",&PyBaselines::Nrows)
.def ("Nchannels",&PyBaselines::Nchannels)
.def ("ms2vis",&PyBaselines::ms2vis<complex<double>>,
PyBaselines::ms2vis_DS, "ms"_a, "idx"_a, "nthreads"_a=1)
ms2vis_DS, "ms"_a, "idx"_a, "nthreads"_a=1)
.def ("effectiveuvw",&PyBaselines::effectiveuvw<double>, "idx"_a)
.def ("vis2ms",&PyBaselines::vis2ms<complex<double>>,
PyBaselines::vis2ms_DS, "vis"_a, "idx"_a, "ms_in"_a=None, "nthreads"_a=1);
vis2ms_DS, "vis"_a, "idx"_a, "ms_in"_a=None, "nthreads"_a=1);
py::class_<PyGridderConfig> (m, "GridderConfig", GridderConfig_DS)
.def(py::init<size_t, size_t, double, double, double, size_t>(),"nxdirty"_a,
"nydirty"_a, "epsilon"_a, "pixsize_x"_a, "pixsize_y"_a, "nthreads"_a=1)
......@@ -1056,8 +1058,8 @@ PYBIND11_MODULE(nifty_gridder, m)
.def("Supp", &PyGridderConfig::Supp)
.def("apply_taper", &PyGridderConfig::apply_taper, apply_taper_DS,
"img"_a, "divide"_a=false)
.def("grid2dirty", &PyGridderConfig::grid2dirty,
grid2dirty_DS, "grid"_a)
.def("grid2dirty", &PyGridderConfig::grid2dirty,
grid2dirty_DS, "grid"_a)
.def("grid2dirty_c", &PyGridderConfig::grid2dirty_c, "grid"_a)
.def("dirty2grid", &PyGridderConfig::dirty2grid,
dirty2grid_DS, "dirty"_a)
......
Markdown is supported
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