Line data Source code
1 : /* 2 : * AntennaRecord.h 3 : * 4 : * Created on: Jan 27, 2016 5 : * Author: nakazato 6 : */ 7 : 8 : #ifndef SINGLEDISH_FILLER_ANTENNARECORD_H_ 9 : #define SINGLEDISH_FILLER_ANTENNARECORD_H_ 10 : 11 : #include <casacore/casa/BasicSL/String.h> 12 : #include <casacore/measures/Measures/MPosition.h> 13 : #include <casacore/ms/MeasurementSets/MSAntenna.h> 14 : #include <casacore/ms/MeasurementSets/MSAntennaColumns.h> 15 : 16 : namespace casa { //# NAMESPACE CASA - BEGIN 17 : namespace sdfiller { //# NAMESPACE SDFILLER - BEGIN 18 : 19 : struct AntennaRecord { 20 : typedef casacore::MSAntenna AssociatingTable; 21 : typedef casacore::MSAntennaColumns AssociatingColumns; 22 : 23 : // mandatory 24 : casacore::String name; 25 : casacore::MPosition position; 26 : casacore::String type; 27 : casacore::String mount; 28 : casacore::Double dish_diameter; 29 : 30 : // optional 31 : casacore::String station; 32 : casacore::MPosition offset; 33 : 34 : // method 35 8 : void clear() { 36 8 : name = ""; 37 8 : position = casacore::MPosition(); 38 8 : type = ""; 39 8 : mount = ""; 40 8 : dish_diameter = -1.0; 41 8 : station = ""; 42 8 : offset = casacore::MPosition(); 43 8 : } 44 : 45 : AntennaRecord &operator=(AntennaRecord const &other) { 46 : name = other.name; 47 : position = other.position; 48 : type = other.type; 49 : mount = other.mount; 50 : dish_diameter = other.dish_diameter; 51 : station = other.station; 52 : offset = other.offset; 53 : return *this; 54 : } 55 : 56 4 : void add(AssociatingTable &table, AssociatingColumns &/*columns*/) { 57 4 : table.addRow(1, true); 58 4 : } 59 : 60 4 : casacore::Bool fill(casacore::uInt irow, AssociatingColumns &columns) { 61 4 : if (columns.nrow() <= irow) { 62 0 : return false; 63 : } 64 : 65 4 : columns.name().put(irow, name); 66 4 : columns.positionMeas().put(irow, position); 67 4 : columns.type().put(irow, type); 68 4 : columns.mount().put(irow, mount); 69 4 : columns.dishDiameter().put(irow, dish_diameter); 70 4 : if (station.size() > 0) { 71 4 : columns.station().put(irow, station); 72 : } 73 4 : if (anyNE(offset.getAngle().getValue(), 0.0)) { 74 0 : columns.offsetMeas().put(irow, offset); 75 : } 76 4 : return true; 77 : } 78 : }; 79 : 80 : } //# NAMESPACE SDFILLER - END 81 : } //# NAMESPACE CASA - END 82 : 83 : #endif /* SINGLEDISH_FILLER_ANTENNARECORD_H_ */