1 #ifndef _CASA_SAKURA_ARRAY_CONVERTER_H_
2 #define _CASA_SAKURA_ARRAY_CONVERTER_H_
29 if (!(pol_index < max_pol)) {
30 throw std::invalid_argument(
31 "pol_index must less than input_matrix.nrow()");
33 if (!(num_data == input_matrix.
ncolumn())) {
34 throw std::invalid_argument(
35 "num_data must equal to input_matrix.ncolumn()");
38 const T* pin = input_matrix.
getStorage(deleteIn);
40 CASAToSakura(max_pol * i + pol_index, i, pin, output_data);
48 if (!(pol_index < max_pol)) {
49 throw std::invalid_argument(
50 "pol_index must less than input_matrix.nrow()");
52 if (!(num_data == output_matrix.
ncolumn())) {
53 throw std::invalid_argument(
54 "num_data must equal to output_matrix.ncolumn()");
59 SakuraToCASA(i, max_pol * i + pol_index, input_data, pout);
67 output_data[index_out] = pin[index_in];
71 pout[index_out] = input_data[index_in];
75 template<>
void SakuraArrayConverter::CASAToSakura<casacore::Complex, float>(
78 template<>
void SakuraArrayConverter::SakuraToCASA<float, casacore::Complex>(
81 template<>
void SakuraArrayConverter::CASAToSakura<casacore::Bool, bool>(
84 template<>
void SakuraArrayConverter::SakuraToCASA<bool, casacore::Bool>(
void putStorage(T *&storage, Bool deleteAndCopy)
putStorage() is normally called after a call to getStorage() (cf).
size_t nrow() const
The number of rows in the Matrix, i.e.
std::complex< Float > Complex
static void ConvertSakuraToCASA(casacore::uInt const pol_index, casacore::uInt const num_data, S const *input_data, casacore::Matrix< T > &output_matrix)
A 2-D Specialization of the Array class.
static void CASAToSakura(casacore::uInt const index_in, casacore::uInt const index_out, const T *pin, S *output_data)
T * getStorage(Bool &deleteIt)
Generally use of this should be shunned, except to use a FORTRAN routine or something similar...
static void SakuraToCASA(casacore::uInt const index_in, casacore::uInt const index_out, S const *input_data, T *pout)
bool Bool
Define the standard types used by Casacore.
size_t ncolumn() const
The number of columns in the Matrix, i.e.
void freeStorage(const T *&storage, Bool deleteIt) const
If deleteIt is set, delete "storage".
static void ConvertCASAToSakura(casacore::uInt const pol_index, casacore::uInt const num_data, const casacore::Matrix< T > &input_matrix, S *output_data)