casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
casa::ScantableSourceIterator Class Reference

#include <ScantableIterator.h>

Inheritance diagram for casa::ScantableSourceIterator:
casa::ScantableIteratorInterface

Public Types

typedef void * Product
 

Public Member Functions

 ScantableSourceIterator (casacore::Table const &table)
 
virtual ~ScantableSourceIterator ()
 
void getEntry (sdfiller::SourceRecord &record)
 
virtual void getProduct (Product *)
 
- Public Member Functions inherited from casa::ScantableIteratorInterface
 ScantableIteratorInterface (casacore::Table const &table)
 
virtual ~ScantableIteratorInterface ()
 
void initialize (size_t num_iter)
 
bool moreData () const
 
void next ()
 

Private Attributes

casacore::ScalarColumn
< casacore::String
name_column_
 
casacore::ArrayColumn
< casacore::Double
direction_column_
 
casacore::ArrayColumn
< casacore::Double
proper_motion_column_
 
casacore::ScalarColumn
< casacore::Double
sysvel_column_
 
casacore::ScalarColumn
< casacore::uInt
molecule_id_column_
 
casacore::ScalarColumn
< casacore::uInt
ifno_column_
 
casacore::ScalarColumn
< casacore::Double
time_column_
 
casacore::ScalarColumn
< casacore::Double
interval_column_
 
casacore::ArrayColumn
< casacore::Double
restfrequency_column_
 
casacore::ArrayColumn
< casacore::String
molecule_name_column_
 
casacore::Table molecules_table_
 
casacore::Vector< casacore::uIntrow_list_
 
std::map< casacore::String,
casacore::Int
source_id_map_
 
std::map< casacore::uInt,
casacore::uInt
molecule_id_map_
 
std::map< casacore::String,
std::map< casacore::uInt,
casacore::Block
< casacore::Double > > > 
time_range_
 

Additional Inherited Members

- Protected Attributes inherited from casa::ScantableIteratorInterface
size_t current_iter_
 
casacore::Table const main_table_
 

Detailed Description

Definition at line 278 of file ScantableIterator.h.

Member Typedef Documentation

Definition at line 280 of file ScantableIterator.h.

Constructor & Destructor Documentation

casa::ScantableSourceIterator::ScantableSourceIterator ( casacore::Table const &  table)
inline

for (casacore::uInt i = 0; i < num_unique; ++i) { std::cout << i << ": SRCNAME \"" << name_column_(row_list_[i]) << "" IFNO " << ifno_column_(row_list_[i]) << std::endl; }

generate molecule_id_map_

generate sorted_index_

for (auto i = time_range_.begin(); i != time_range_.end(); ++i) { std::cout << "SRCNAME \"" << i->first << "": " << std::endl; for (auto j = i->second.begin(); j != i->second.end(); ++j) { std::cout << " " << j->first << ": " << j->second[0] << " " << j->second[1] << std::endl; } }

Definition at line 281 of file ScantableIterator.h.

References casacore::Sort::Ascending, casacore::TableRecord::asTable(), casacore::ScalarColumn< T >::attach(), casacore::Array< T >::data(), casacore::ScalarColumn< T >::getColumn(), casa::name(), casacore::Sort::NoDuplicates, casacore::TableColumn::nrow(), casacore::Sort::QuickSort, casacore::Vector< T >::resize(), casacore::ArrayBase::size(), casacore::Sort::sort(), and casacore::Sort::sortKey().

virtual casa::ScantableSourceIterator::~ScantableSourceIterator ( )
inlinevirtual

Definition at line 378 of file ScantableIterator.h.

Member Function Documentation

void casa::ScantableSourceIterator::getEntry ( sdfiller::SourceRecord record)
inline

2016/02/04 TN comment out the following else block since if no ID is found in molecule_id_map_ it indicates that there is no corresponding entry in MOLECULES table for given MOLECULE_ID. Serch result is always empty table. else { casacore::Table t = molecules_table_(molecules_table_.col("ID") == molecule_id, 1); if (t.nrow() == 1) { casacore::ArrayColumn<casacore::Double> rest_freq_column(t, "RESTFREQUENCY"); casacore::ArrayColumn<casacore::String> molecule_name_column(t, "NAME"); if (rest_freq_column.isDefined(0)) { record.rest_frequency = rest_freq_column(0); } if (molecule_name_column.isDefined(0)) { record.transition = molecule_name_column(0); } } }

casacore::Table t = main_table_( main_table_.col("SRCNAME") == record.name && main_table_.col("IFNO") == record.spw_id); time_column_.attach(t, "TIME"); casacore::Vector < casacore::Double > time_list = time_column_.getColumn(); casacore::Sort sorter; sorter.sortKey(time_list.data(), TpDouble); casacore::Vector < casacore::uInt > index_vector; casacore::uInt n = sorter.sort(index_vector, time_list.size()); interval_column_.attach(t, "INTERVAL"); constexpr double kDay2Sec = 86400.0; casacore::Double time_min = time_list[index_vector[0]] * kDay2Sec

  • 0.5 * interval_column_(index_vector[0]); casacore::Double time_max = time_list[index_vector[n - 1]] * kDay2Sec
  • 0.5 * interval_column_(index_vector[n - 1]);

Definition at line 381 of file ScantableIterator.h.

References casa::sdfiller::SourceRecord::direction, casa::sdfiller::SourceRecord::interval, casacore::MDirection::J2000, casa::sdfiller::SourceRecord::name, casa::sdfiller::SourceRecord::num_lines, casa::sdfiller::SourceRecord::proper_motion, casa::sdfiller::SourceRecord::rest_frequency, casacore::ArrayBase::size(), casa::sdfiller::SourceRecord::source_id, casa::sdfiller::SourceRecord::spw_id, casa::sdfiller::SourceRecord::sysvel, casa::sdfiller::SourceRecord::time, and casa::sdfiller::SourceRecord::transition.

virtual void casa::ScantableSourceIterator::getProduct ( Product )
inlinevirtual

Definition at line 445 of file ScantableIterator.h.

Member Data Documentation

casacore::ArrayColumn<casacore::Double> casa::ScantableSourceIterator::direction_column_
private

Definition at line 451 of file ScantableIterator.h.

casacore::ScalarColumn<casacore::uInt> casa::ScantableSourceIterator::ifno_column_
private

Definition at line 455 of file ScantableIterator.h.

casacore::ScalarColumn<casacore::Double> casa::ScantableSourceIterator::interval_column_
private

Definition at line 457 of file ScantableIterator.h.

casacore::ScalarColumn<casacore::uInt> casa::ScantableSourceIterator::molecule_id_column_
private

Definition at line 454 of file ScantableIterator.h.

std::map<casacore::uInt, casacore::uInt> casa::ScantableSourceIterator::molecule_id_map_
private

Definition at line 463 of file ScantableIterator.h.

casacore::ArrayColumn<casacore::String> casa::ScantableSourceIterator::molecule_name_column_
private

Definition at line 459 of file ScantableIterator.h.

casacore::Table casa::ScantableSourceIterator::molecules_table_
private

Definition at line 460 of file ScantableIterator.h.

casacore::ScalarColumn<casacore::String> casa::ScantableSourceIterator::name_column_
private

Definition at line 450 of file ScantableIterator.h.

casacore::ArrayColumn<casacore::Double> casa::ScantableSourceIterator::proper_motion_column_
private

Definition at line 452 of file ScantableIterator.h.

casacore::ArrayColumn<casacore::Double> casa::ScantableSourceIterator::restfrequency_column_
private

Definition at line 458 of file ScantableIterator.h.

casacore::Vector<casacore::uInt> casa::ScantableSourceIterator::row_list_
private

Definition at line 461 of file ScantableIterator.h.

std::map<casacore::String, casacore::Int> casa::ScantableSourceIterator::source_id_map_
private

Definition at line 462 of file ScantableIterator.h.

casacore::ScalarColumn<casacore::Double> casa::ScantableSourceIterator::sysvel_column_
private

Definition at line 453 of file ScantableIterator.h.

casacore::ScalarColumn<casacore::Double> casa::ScantableSourceIterator::time_column_
private

Definition at line 456 of file ScantableIterator.h.

std::map<casacore::String, std::map<casacore::uInt, casacore::Block<casacore::Double> > > casa::ScantableSourceIterator::time_range_
private

Definition at line 464 of file ScantableIterator.h.


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