PURIFY
Next-generation radio interferometric imaging
Public Types | Public Member Functions | List of all members
purify::casa::MeasurementSet::ChannelWrapper Class Reference

#include <casacore.h>

Public Types

enum class  Sigma { OVERALL , SPECTRUM }
 Possible locations for SIGMA. More...
 

Public Member Functions

 ChannelWrapper (t_uint channel, MeasurementSet const &ms, std::string const &filter="")
 
t_uint channel () const
 Channel this object is associated with. More...
 
 PURIFY_MACRO (u, 0)
 
 PURIFY_MACRO (v, 1)
 
 PURIFY_MACRO (w, 2)
 
t_uint size () const
 Number of rows in a channel. More...
 
Vector< t_int > field_ids () const
 FIELD_ID from table MAIN. More...
 
Vector< t_int > data_desc_id () const
 DATA_DESC_ID from table MAIN. More...
 
Direction direction (t_real tolerance=1e-8) const
 Direction (RA, DEC) in radian. More...
 
Direction::Scalar right_ascension (t_real tolerance=1e-8) const
 
Direction::Scalar declination (t_real tolerance=1e-8) const
 
Vector< t_real > raw_frequencies () const
 Frequencies from SPECTRAL_WINDOW for a this channel. More...
 
 PURIFY_MACRO (I)
 
 PURIFY_MACRO (Q)
 
 PURIFY_MACRO (U)
 
 PURIFY_MACRO (V)
 
 PURIFY_MACRO (LL)
 
 PURIFY_MACRO (RR)
 
 PURIFY_MACRO (LR)
 
 PURIFY_MACRO (RL)
 
 PURIFY_MACRO (XX)
 
 PURIFY_MACRO (YY)
 
 PURIFY_MACRO (XY)
 
 PURIFY_MACRO (YX)
 
Vector< t_real > frequencies () const
 Frequencies for each valid measurement. More...
 
Vector< t_real > width () const
 Channel width for each valid measurement. More...
 
Vector< t_real > effective_noise_bandwidth () const
 Effective noise band-width width for each valid measurement. More...
 
Vector< t_real > resolution () const
 Effective spectral resolution for each valid measurement. More...
 
bool is_valid () const
 Check if channel has any data. More...
 

Detailed Description

Definition at line 209 of file casacore.h.

Member Enumeration Documentation

◆ Sigma

Possible locations for SIGMA.

Enumerator
OVERALL 
SPECTRUM 

Definition at line 212 of file casacore.h.

212 { OVERALL, SPECTRUM };

Constructor & Destructor Documentation

◆ ChannelWrapper()

purify::casa::MeasurementSet::ChannelWrapper::ChannelWrapper ( t_uint  channel,
MeasurementSet const &  ms,
std::string const &  filter = "" 
)
inline

Definition at line 213 of file casacore.h.

214  : ms_(ms), filter_(filter), channel_(channel) {}
t_uint channel() const
Channel this object is associated with.
Definition: casacore.h:217

Member Function Documentation

◆ channel()

t_uint purify::casa::MeasurementSet::ChannelWrapper::channel ( ) const
inline

Channel this object is associated with.

Definition at line 217 of file casacore.h.

217 { return channel_; }

◆ data_desc_id()

Vector<t_int> purify::casa::MeasurementSet::ChannelWrapper::data_desc_id ( ) const
inline

DATA_DESC_ID from table MAIN.

Definition at line 237 of file casacore.h.

237 { return ms_.column<t_int>("DATA_DESC_ID", filter()); }
Matrix< T > column(std::string const &column, std::string const &filter="") const
Data from a column.
Definition: casacore.h:68

References purify::casa::MeasurementSet::column().

◆ declination()

Direction::Scalar purify::casa::MeasurementSet::ChannelWrapper::declination ( t_real  tolerance = 1e-8) const
inline

Definition at line 244 of file casacore.h.

244  {
245  return ms_.declination(tolerance, filter());
246  }
Direction::Scalar declination(t_real tolerance=1e-8, std::string const &filter="") const
Declination in radians.
Definition: casacore.h:90

References purify::casa::MeasurementSet::declination().

◆ direction()

Direction purify::casa::MeasurementSet::ChannelWrapper::direction ( t_real  tolerance = 1e-8) const
inline

Direction (RA, DEC) in radian.

Definition at line 240 of file casacore.h.

240 { return ms_.direction(tolerance, filter()); }
Direction direction(t_real tolerance=1e-8, std::string const &filter="") const
Direction (RA, DEC) in radians.
Definition: casacore.cc:102

References purify::casa::MeasurementSet::direction().

◆ effective_noise_bandwidth()

Vector<t_real> purify::casa::MeasurementSet::ChannelWrapper::effective_noise_bandwidth ( ) const
inline

Effective noise band-width width for each valid measurement.

Definition at line 285 of file casacore.h.

285  {
286  return joined_spectral_window("EFFECTIVE_BW");
287  }

◆ field_ids()

Vector<t_int> purify::casa::MeasurementSet::ChannelWrapper::field_ids ( ) const
inline

FIELD_ID from table MAIN.

Definition at line 235 of file casacore.h.

235 { return ms_.column<t_int>("FIELD_ID", filter()); }

References purify::casa::MeasurementSet::column().

◆ frequencies()

Vector<t_real> purify::casa::MeasurementSet::ChannelWrapper::frequencies ( ) const
inline

Frequencies for each valid measurement.

Definition at line 281 of file casacore.h.

281 { return joined_spectral_window("CHAN_FREQ"); }

◆ is_valid()

bool purify::casa::MeasurementSet::ChannelWrapper::is_valid ( ) const

Check if channel has any data.

Definition at line 80 of file casacore.cc.

80  {
81  std::ostringstream sstr;
82  sstr << "USING STYLE PYTHON SELECT FLAG[" << channel_ << ",] as R FROM $1 WHERE NOT any(FLAG["
83  << channel_ << ",])";
84  if (not filter_.empty()) sstr << "AND " << filter_;
85  auto const taql_table = ::casacore::tableCommand(sstr.str(), ms_.table());
86  return taql_table.table().nrow() > 0;
87 }
::casacore::Table const & table(std::string const &name="") const
Gets table or subtable.
Definition: casacore.cc:18

◆ PURIFY_MACRO() [1/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( )

◆ PURIFY_MACRO() [2/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( LL  )

◆ PURIFY_MACRO() [3/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( LR  )

◆ PURIFY_MACRO() [4/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( )

◆ PURIFY_MACRO() [5/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( RL  )

◆ PURIFY_MACRO() [6/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( RR  )

◆ PURIFY_MACRO() [7/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( )

◆ PURIFY_MACRO() [8/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( ,
 
)

◆ PURIFY_MACRO() [9/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( )

◆ PURIFY_MACRO() [10/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( ,
 
)

◆ PURIFY_MACRO() [11/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( ,
 
)

◆ PURIFY_MACRO() [12/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( XX  )

◆ PURIFY_MACRO() [13/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( XY  )

◆ PURIFY_MACRO() [14/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( YX  )

◆ PURIFY_MACRO() [15/15]

purify::casa::MeasurementSet::ChannelWrapper::PURIFY_MACRO ( YY  )

◆ raw_frequencies()

Vector<t_real> purify::casa::MeasurementSet::ChannelWrapper::raw_frequencies ( ) const
inline

Frequencies from SPECTRAL_WINDOW for a this channel.

Definition at line 249 of file casacore.h.

249 { return raw_spectral_window("CHAN_FREQ"); }

◆ resolution()

Vector<t_real> purify::casa::MeasurementSet::ChannelWrapper::resolution ( ) const
inline

Effective spectral resolution for each valid measurement.

Definition at line 289 of file casacore.h.

289 { return joined_spectral_window("RESOLUTION"); }

◆ right_ascension()

Direction::Scalar purify::casa::MeasurementSet::ChannelWrapper::right_ascension ( t_real  tolerance = 1e-8) const
inline

Definition at line 241 of file casacore.h.

241  {
242  return ms_.right_ascension(tolerance, filter());
243  }
Direction::Scalar right_ascension(t_real tolerance=1e-8, std::string const &filter="") const
Right ascention in radians.
Definition: casacore.h:86

References purify::casa::MeasurementSet::right_ascension().

◆ size()

t_uint purify::casa::MeasurementSet::ChannelWrapper::size ( ) const

Number of rows in a channel.

Definition at line 368 of file casacore.cc.

368  {
369  if (ms_.table().nrow() == 0) return 0;
370  std::ostringstream sstr;
371  sstr << "USING STYLE PYTHON SELECT FLAG[" << channel_ << ",] as R FROM $1 WHERE NOT any(FLAG["
372  << channel_ << ",])";
373  if (not filter_.empty()) sstr << "AND " << filter_;
374  auto const taql_table = ::casacore::tableCommand(sstr.str(), ms_.table());
375  auto const vtable = taql_table.table();
376  return vtable.nrow();
377 }

◆ width()

Vector<t_real> purify::casa::MeasurementSet::ChannelWrapper::width ( ) const
inline

Channel width for each valid measurement.

Definition at line 283 of file casacore.h.

283 { return joined_spectral_window("CHAN_WIDTH"); }

The documentation for this class was generated from the following files: