- Timestamp:
- 03/31/06 17:01:45 (19 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STFocus.cpp
r896 r957 37 37 { 38 38 rotationCol_.attach(table_,"ROTATION"); 39 a ngleCol_.attach(table_,"ANGLE");39 axisCol_.attach(table_,"AXIS"); 40 40 tanCol_.attach(table_,"TAN"); 41 handCol_.attach(table_,"HAND"); 42 userCol_.attach(table_,"USERPHASE"); 43 mountCol_.attach(table_,"MOUNT"); 44 xyphCol_.attach(table_,"XYPHASE"); 45 xyphoffCol_.attach(table_,"XYPHASEOFFSET"); 41 46 } 42 47 … … 50 55 static_cast<STSubTable&>(*this) = other; 51 56 rotationCol_.attach(table_,"ROTATION"); 52 a ngleCol_.attach(table_,"ANGLE");57 axisCol_.attach(table_,"AXIS"); 53 58 tanCol_.attach(table_,"TAN"); 59 handCol_.attach(table_,"HAND"); 60 userCol_.attach(table_,"USERPHASE"); 61 mountCol_.attach(table_,"MOUNT"); 62 xyphCol_.attach(table_,"XYPHASE"); 63 xyphoffCol_.attach(table_,"XYPHASEOFFSET"); 54 64 } 55 65 return *this; … … 59 69 // add to base class table 60 70 table_.addColumn(ScalarColumnDesc<Float>("ROTATION")); 61 table_.addColumn(ScalarColumnDesc<Float>("A NGLE"));71 table_.addColumn(ScalarColumnDesc<Float>("AXIS")); 62 72 table_.addColumn(ScalarColumnDesc<Float>("TAN")); 73 table_.addColumn(ScalarColumnDesc<Float>("HAND")); 74 table_.addColumn(ScalarColumnDesc<Float>("USERPHASE")); 75 table_.addColumn(ScalarColumnDesc<Float>("MOUNT")); 76 table_.addColumn(ScalarColumnDesc<Float>("XYPHASE")); 77 table_.addColumn(ScalarColumnDesc<Float>("XYPHASEOFFSET")); 63 78 64 79 // new cached columns 65 80 rotationCol_.attach(table_,"ROTATION"); 66 a ngleCol_.attach(table_,"ANGLE");81 axisCol_.attach(table_,"AXIS"); 67 82 tanCol_.attach(table_,"TAN"); 83 handCol_.attach(table_,"HAND"); 84 userCol_.attach(table_,"USERPHASE"); 85 mountCol_.attach(table_,"MOUNT"); 86 xyphCol_.attach(table_,"XYPHASE"); 87 xyphoffCol_.attach(table_,"XYPHASEOFFSET"); 68 88 } 69 89 70 uInt STFocus::addEntry( Float rotation, Float angle, Float ftan) 90 uInt STFocus::addEntry( Float fax, Float ftan, Float frot, Float hand, 91 Float user, Float mount, 92 Float xyphase, Float xyphaseoffset) 71 93 { 72 Table result = table_( near(table_.col("ROTATION"), rotation) 73 && near(table_.col("ANGLE"), angle) 74 && near(table_.col("TAN"), ftan) ); 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 ); 75 103 uInt resultid = 0; 76 104 if ( result.nrow() > 0) { … … 85 113 resultid++; 86 114 } 87 rotationCol_.put(rno, rotation);88 a ngleCol_.put(rno, angle);115 rotationCol_.put(rno, frot); 116 axisCol_.put(rno, fax); 89 117 tanCol_.put(rno, ftan); 118 handCol_.put(rno, hand); 119 userCol_.put(rno, user); 120 mountCol_.put(rno, mount); 121 xyphCol_.put(rno, xyphase); 122 xyphoffCol_.put(rno, xyphaseoffset); 90 123 idCol_.put(rno, resultid); 91 124 } … … 94 127 95 128 void asap::STFocus::getEntry( Float& rotation, Float& angle, Float& ftan, 129 Float& hand, Float& user, Float& mount, 130 Float& xyphase, Float& xyphaseoffset, 96 131 uInt id) const 97 132 { … … 104 139 const TableRecord& rec = row.get(0); 105 140 rotation = rec.asFloat("ROTATION"); 106 angle = rec.asFloat("A NGLE");141 angle = rec.asFloat("AXIS"); 107 142 ftan = rec.asFloat("TAN"); 143 hand = rec.asFloat("HAND"); 144 user = rec.asFloat("USERPHASE"); 145 mount = rec.asFloat("MOUNT"); 146 xyphase = rec.asFloat("XYPHASE"); 147 xyphaseoffset = rec.asFloat("XYPHASEOFFSET"); 108 148 } 109 149 110 150 151 casa::Float asap::STFocus::getTotalFeedAngle( casa::uInt id ) const 152 { 153 Float total = 0.0f; 154 Table t = table_(table_.col("ID") == Int(id) ); 155 if (t.nrow() == 0 ) { 156 throw(AipsError("STFocus::getEntry - id out of range")); 157 } 158 ROTableRow row(t); 159 // get first row - there should only be one matching id 160 const TableRecord& rec = row.get(0); 161 total += rec.asFloat("ROTATION"); 162 total += rec.asFloat("USERPHASE"); 163 total += rec.asFloat("MOUNT"); 164 return total; 111 165 } 166 } 167 168 casa::Float asap::STFocus::getFeedHand( casa::uInt id ) const 169 { 170 Table t = table_(table_.col("ID") == Int(id) ); 171 if (t.nrow() == 0 ) { 172 throw(AipsError("STFocus::getEntry - id out of range")); 173 } 174 ROTableRow row(t); 175 const TableRecord& rec = row.get(0); 176 return rec.asFloat("HAND"); 177 } 178 -
trunk/src/STFocus.h
r896 r957 37 37 STFocus& operator=(const STFocus& other); 38 38 39 casa::uInt addEntry( casa::Float rotation, casa::Float angle, 40 casa::Float ftan); 39 casa::uInt addEntry( casa::Float faxis, casa::Float ftan, 40 casa::Float frot, casa::Float hand=1.0f, 41 casa::Float mount=0.0f, casa::Float user=0.0f, 42 casa::Float xyphase=0.0f, casa::Float xyphaseoffset=0.0f); 41 43 42 void getEntry( casa::Float& rotation, casa::Float& angle, 43 casa::Float& ftan, casa::uInt id) const; 44 void getEntry( casa::Float& fax, casa::Float& ftan, 45 casa::Float& frot, casa::Float& hand, 46 casa::Float& mount, casa::Float& user, 47 casa::Float& xyphase, casa::Float& xyphaseoffset, 48 casa::uInt id) const; 49 50 casa::Float getTotalFeedAngle(casa::uInt id) const; 51 casa::Float getFeedHand(casa::uInt id) const; 44 52 45 53 const casa::String& name() const { return name_; } … … 48 56 void setup(); 49 57 static const casa::String name_; 50 //casa::Table table_;51 //casa::ScalarColumn<casa::uInt> freqidCol_;52 casa::ScalarColumn<casa::Float> rotationCol_, angleCol_,53 tanCol_;58 casa::ScalarColumn<casa::Float> rotationCol_, axisCol_, 59 tanCol_,handCol_, 60 mountCol_,userCol_, 61 xyphCol_,xyphoffCol_; 54 62 }; 55 63 -
trunk/src/STPol.h
r904 r957 52 52 else if ( mode == "linpol" ) 53 53 return getLinPol(index); 54 else if ( mode == "ci cular" )55 return get LinPol(index);54 else if ( mode == "circular" ) 55 return getCircular(index); 56 56 else 57 57 throw(casa::AipsError("Polarisation type unknown")); … … 82 82 { basespectra_.resize(); basespectra_ = spec; } 83 83 84 void setPhaseCorrections(casa::Float, casa::Float, casa::Float) {} 84 85 void setPhaseCorrections(casa::Float parangle=0.0, casa::Float totalfeed=0.0, 86 casa::Float feedhand=1.0) 87 { totalfeed_=totalfeed;parangle_=parangle;feedhand_=feedhand;} 88 89 casa::Float getTotalPhase() const { return totalfeed_+parangle_; } 90 casa::Float getFeedHand() const { return feedhand_; } 85 91 86 92 static std::pair<int, std::string> polFromString(const std::string& key); … … 93 99 static std::map<std::string, std::map<int, std::string> > labelmap_; 94 100 95 casa:: Vector<casa::Float> phaseCorrections_;101 casa::Float totalfeed_,parangle_,feedhand_; 96 102 std::string mode_; 97 103 casa::Matrix<casa::Float> basespectra_; -
trunk/src/STPolLinear.cpp
r911 r957 30 30 Vector<Float> asap::STPolLinear::getStokes( uint index ) 31 31 { 32 cout << "debug asap::STPolLinear::getStokes" << endl;33 32 if ( index < 0 || index >4 ) throw(AipsError("Stokes index out of range")); 34 33 Vector<Float> out; 35 cout << nspec() << endl; 34 Float phase = getTotalPhase(); 35 Vector<Float> q(getSpectrum(0) - getSpectrum(1)); 36 36 if ( nspec() == 4 ) { 37 37 switch(index) { 38 38 case 0: 39 out = Vector<Float>(getSpectrum(0) + getSpectrum(1)) * Float(0.5);39 out = Vector<Float>(getSpectrum(0) + getSpectrum(1)); 40 40 break; 41 41 case 1: 42 out = Vector<Float>( getSpectrum(0) - getSpectrum(1)) * Float(0.5);42 out = Vector<Float>(q * cos(phase) - getSpectrum(2) * sin(phase)); 43 43 break; 44 default: 45 out =Vector<Float>(getSpectrum(index)); 44 case 2: 45 out = Vector<Float>(q * sin(phase) + getSpectrum(2) * cos(phase)); 46 break; 47 case 3: 48 cout << getFeedHand() << endl; 49 out = getFeedHand() * Vector<Float>(getSpectrum(3)); 50 break; 46 51 } 47 52 } … … 52 57 { 53 58 if ( index < 0 || index >4 ) throw(AipsError("LinPol index out of range")); 54 Vector<Float> out,q ;59 Vector<Float> out,q,u; 55 60 if ( nspec() == 4) { 56 61 switch(index) { 57 62 case 1: 58 q = getStokes(index); 59 out = Vector<Float>(sqrt(pow(q,Float(2.0))+pow(getSpectrum(2), Float(2.0)))); 63 q = getStokes(1); 64 u = getStokes(2); 65 out = Vector<Float>(sqrt(pow(q,Float(2.0))+pow(u, Float(2.0)))); 60 66 break; 61 67 case 2: 62 68 q = getStokes(index); 63 out = Vector<Float>(Float(180.0/C::pi/2.0) * atan2(getSpectrum(2),q)); 69 u = getStokes(2); 70 out = Vector<Float>(Float(180.0/C::pi/2.0) * atan2(u,q)); 64 71 break; 65 72 default: … … 88 95 switch(index) { 89 96 case 0: 90 out = (I + V) /Float(2.0);97 out = (I + V); 91 98 break; 92 99 case 1: 93 out = (I - V) /Float(2.0);100 out = (I - V); 94 101 break; 95 102 default: -
trunk/src/STPolStokes.cpp
r910 r957 56 56 Vector<Float> asap::STPolStokes::getLinear(uInt index ) 57 57 { 58 cout << "test" << endl;59 58 Vector<Float> out; 60 59 switch(index) { … … 81 80 switch(index) { 82 81 case 0: 83 out = (getSpectrum(0) + getSpectrum(3)) /Float(2.0);82 out = (getSpectrum(0) + getSpectrum(3)); 84 83 break; 85 84 case 1: 86 out = (getSpectrum(0) - getSpectrum(3)) /Float(2.0);85 out = (getSpectrum(0) - getSpectrum(3)); 87 86 break; 88 87 default:
Note:
See TracChangeset
for help on using the changeset viewer.