Commit 601993e3 authored by Martin Reinecke's avatar Martin Reinecke

add optinal negate_v parameter

parent 31f59aa7
......@@ -496,7 +496,7 @@ class Baselines
public:
template<typename T> Baselines(const const_mav<T,2> &coord_,
const const_mav<T,1> &freq)
const const_mav<T,1> &freq, bool negate_v=false)
{
constexpr double speedOfLight = 299792458.;
myassert(coord_.shape(1)==3, "dimension mismatch");
......@@ -517,8 +517,12 @@ class Baselines
f_over_c[i] = freq(i)/speedOfLight;
}
coord.resize(nrows);
for (size_t i=0; i<coord.size(); ++i)
coord[i] = UVW(coord_(i,0), coord_(i,1), coord_(i,2));
if (negate_v)
for (size_t i=0; i<coord.size(); ++i)
coord[i] = UVW(coord_(i,0), -coord_(i,1), coord_(i,2));
else
for (size_t i=0; i<coord.size(); ++i)
coord[i] = UVW(coord_(i,0), coord_(i,1), coord_(i,2));
}
RowChan getRowChan(idx_t index) const
......@@ -1779,9 +1783,10 @@ template<typename T> vector<idx_t> getWgtIndices(const Baselines &baselines,
template<typename T> void ms2dirty_general(const const_mav<double,2> &uvw,
const const_mav<double,1> &freq, const const_mav<complex<T>,2> &ms,
const const_mav<T,2> &wgt, double pixsize_x, double pixsize_y, size_t nu, size_t nv, double epsilon,
bool do_wstacking, size_t nthreads, const mav<T,2> &dirty, size_t verbosity)
bool do_wstacking, size_t nthreads, const mav<T,2> &dirty, size_t verbosity,
bool negate_v=false)
{
Baselines baselines(uvw, freq);
Baselines baselines(uvw, freq, negate_v);
GridderConfig gconf(dirty.shape(0), dirty.shape(1), nu, nv, epsilon, pixsize_x, pixsize_y, nthreads);
auto idx = getWgtIndices(baselines, gconf, wgt, ms);
auto idx2 = const_mav<idx_t,1>(idx.data(),{idx.size()});
......@@ -1800,9 +1805,10 @@ template<typename T> void ms2dirty(const const_mav<double,2> &uvw,
template<typename T> void dirty2ms_general(const const_mav<double,2> &uvw,
const const_mav<double,1> &freq, const const_mav<T,2> &dirty,
const const_mav<T,2> &wgt, double pixsize_x, double pixsize_y, size_t nu, size_t nv,double epsilon,
bool do_wstacking, size_t nthreads, const mav<complex<T>,2> &ms, size_t verbosity)
bool do_wstacking, size_t nthreads, const mav<complex<T>,2> &ms,
size_t verbosity, bool negate_v=false)
{
Baselines baselines(uvw, freq);
Baselines baselines(uvw, freq, negate_v);
GridderConfig gconf(dirty.shape(0), dirty.shape(1), nu, nv, epsilon, pixsize_x, pixsize_y, nthreads);
const_mav<complex<T>,2> null_ms(nullptr, {0,0});
auto idx = getWgtIndices(baselines, gconf, wgt, null_ms);
......
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