Changeset 1757 for branches/alma/src/STFocus.cpp
- Timestamp:
- 06/09/10 19:03:06 (14 years ago)
- Location:
- branches/alma
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma
-
Property
svn:ignore
set to
.sconf_temp
.sconsign.dblite
-
Property
svn:mergeinfo
set to
/branches/asap-3.x merged eligible
-
Property
svn:ignore
set to
-
branches/alma/src/STFocus.cpp
r957 r1757 34 34 } 35 35 36 asap::STFocus::STFocus( casa::Table tab ) : STSubTable(tab, name_) 36 STFocus::STFocus( casa::Table tab ) : 37 STSubTable(tab, name_) 37 38 { 39 parangleCol_.attach(table_,"PARANGLE"); 38 40 rotationCol_.attach(table_,"ROTATION"); 39 41 axisCol_.attach(table_,"AXIS"); … … 50 52 } 51 53 52 STFocus& asap::STFocus::operator =( const STFocus & other )54 STFocus& STFocus::operator =( const STFocus & other ) 53 55 { 54 56 if (this != &other) { 55 57 static_cast<STSubTable&>(*this) = other; 58 parangleCol_.attach(table_,"PARANGLE"); 56 59 rotationCol_.attach(table_,"ROTATION"); 57 60 axisCol_.attach(table_,"AXIS"); … … 65 68 return *this; 66 69 } 67 void asap::STFocus::setup( )70 void STFocus::setup( ) 68 71 { 69 72 // add to base class table 73 table_.addColumn(ScalarColumnDesc<Float>("PARANGLE")); 70 74 table_.addColumn(ScalarColumnDesc<Float>("ROTATION")); 71 75 table_.addColumn(ScalarColumnDesc<Float>("AXIS")); … … 76 80 table_.addColumn(ScalarColumnDesc<Float>("XYPHASE")); 77 81 table_.addColumn(ScalarColumnDesc<Float>("XYPHASEOFFSET")); 82 table_.rwKeywordSet().define("PARALLACTIFY", False); 78 83 79 84 // new cached columns 85 parangleCol_.attach(table_,"PARANGLE"); 80 86 rotationCol_.attach(table_,"ROTATION"); 81 87 axisCol_.attach(table_,"AXIS"); … … 88 94 } 89 95 90 uInt STFocus::addEntry(Float fax, Float ftan, Float frot, Float hand,91 Float user, Float mount,92 Float xyphase, Float xyphaseoffset)96 uInt STFocus::addEntry( Float pa, Float fax, Float ftan, Float frot, Float hand, 97 Float user, Float mount, 98 Float xyphase, Float xyphaseoffset) 93 99 { 94 Table result = table_( near(table_.col("ROTATION"), frot) 95 && near(table_.col("AXIS"), fax) 96 && near(table_.col("TAN"), ftan) 97 && near(table_.col("HAND"), hand) 98 && near(table_.col("USERPHASE"), user) 99 && near(table_.col("MOUNT"), mount) 100 && near(table_.col("XYPHASE"), xyphase) 101 && near(table_.col("XYPHASEOFFSET"), xyphaseoffset) 102 ); 100 Table result = table_( near(table_.col("PARANGLE"), pa) 101 && near(table_.col("ROTATION"), frot) 102 && near(table_.col("AXIS"), fax) 103 && near(table_.col("TAN"), ftan) 104 && near(table_.col("HAND"), hand) 105 && near(table_.col("USERPHASE"), user) 106 && near(table_.col("MOUNT"), mount) 107 && near(table_.col("XYPHASE"), xyphase) 108 && near(table_.col("XYPHASEOFFSET"), xyphaseoffset) 109 ); 103 110 uInt resultid = 0; 104 111 if ( result.nrow() > 0) { … … 113 120 resultid++; 114 121 } 122 parangleCol_.put(rno, pa); 115 123 rotationCol_.put(rno, frot); 116 124 axisCol_.put(rno, fax); … … 126 134 } 127 135 128 void asap::STFocus::getEntry(Float& rotation, Float& angle, Float& ftan,129 Float& hand, Float& user, Float& mount,130 Float& xyphase, Float& xyphaseoffset,131 uInt id) const136 void STFocus::getEntry( Float& pa, Float& rotation, Float& angle, Float& ftan, 137 Float& hand, Float& user, Float& mount, 138 Float& xyphase, Float& xyphaseoffset, 139 uInt id) const 132 140 { 133 141 Table t = table_(table_.col("ID") == Int(id) ); … … 138 146 // get first row - there should only be one matching id 139 147 const TableRecord& rec = row.get(0); 148 pa = rec.asFloat("PARANGLE"); 140 149 rotation = rec.asFloat("ROTATION"); 141 150 angle = rec.asFloat("AXIS"); … … 149 158 150 159 151 casa::Float asap::STFocus::getTotalFeedAngle( casa::uInt id ) const160 casa::Float STFocus::getTotalAngle( casa::uInt id ) const 152 161 { 153 162 Float total = 0.0f; 154 163 Table t = table_(table_.col("ID") == Int(id) ); 155 164 if (t.nrow() == 0 ) { 156 throw(AipsError("STFocus::getEntry - id out of range")); 165 throw(AipsError("STFocus::getTotalAngle - id out of range")); 166 } 167 if (table_.keywordSet().asBool("PARALLACTIFY")) { 168 return 0.0f; 157 169 } 158 170 ROTableRow row(t); 159 171 // get first row - there should only be one matching id 160 172 const TableRecord& rec = row.get(0); 173 total += rec.asFloat("PARANGLE"); 161 174 total += rec.asFloat("ROTATION"); 162 175 total += rec.asFloat("USERPHASE"); … … 164 177 return total; 165 178 } 166 }167 179 168 casa::Float asap::STFocus::getFeedHand( casa::uInt id ) const 180 181 casa::Float STFocus::getFeedHand( casa::uInt id ) const 169 182 { 170 183 Table t = table_(table_.col("ID") == Int(id) ); … … 177 190 } 178 191 192 void STFocus::setParallactify(bool istrue) { 193 table_.rwKeywordSet().define("PARALLACTIFY", Bool(istrue)); 194 } 195 196 }
Note: See TracChangeset
for help on using the changeset viewer.