Changeset 845
- Timestamp:
- 02/23/06 11:25:32 (19 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Scantable.cpp
r837 r845 244 244 } 245 245 246 void Scantable:: putSDHeader(const SDHeader& sdh)246 void Scantable::setHeader(const SDHeader& sdh) 247 247 { 248 248 table_.rwKeywordSet().define("nIF", sdh.nif); … … 264 264 } 265 265 266 SDHeader Scantable::get SDHeader() const266 SDHeader Scantable::getHeader() const 267 267 { 268 268 SDHeader sdh; … … 286 286 } 287 287 288 bool Scantable::conformant( const Scantable& other ) 289 { 290 return this->getHeader().conformant(other.getHeader()); 291 } 292 293 288 294 int Scantable::rowToScanIndex( int therow ) 289 295 { … … 433 439 } 434 440 435 int Scantable::n row( int scanno ) const441 int Scantable::ncycle( int scanno ) const 436 442 { 437 443 if ( scanno < 0 ) { … … 457 463 458 464 459 int Scantable::nchan( int scanno, int ifno ) const 460 { 461 if ( scanno < 0 || ifno < 0 ) { 465 int Scantable::nrow( int scanno ) const 466 { 467 return int(table_.nrow()); 468 } 469 470 int Scantable::nchan( int ifno ) const 471 { 472 if ( ifno < 0 ) { 462 473 Int n; 463 474 table_.keywordSet().get("nChan",n); 464 475 return int(n); 465 476 } else { 466 // take the first POLNO,IFNO,CYCLENO as nbeam shouldn't vary with these467 Table tab = table_(table_.col("SCANNO") == scanno477 // take the first SCANNO,POLNO,BEAMNO,CYCLENO as nbeam shouldn't vary with these 478 Table tab = table_(table_.col("SCANNO") == 0 468 479 && table_.col("IFNO") == ifno 469 480 && table_.col("BEAMNO") == 0 -
trunk/src/Scantable.h
r824 r845 85 85 /** 86 86 * get a const reference to the underlying casa::Table 87 * @return cons tcasa::Table reference87 * @return consantcasa::Table reference 88 88 */ 89 89 const casa::Table& table() const; … … 96 96 casa::Table& table(); 97 97 98 99 /** 100 * Get a handle to the selection object 101 * @return constant STSelector reference 102 */ 103 const STSelector& getSelection() const { return selector_; } 104 105 /** 106 * Set the data to be a subset as defined by the STSelector 107 * @param selection a STSelector object 108 */ 98 109 void setSelection(const STSelector& selection); 110 111 /** 112 * unset the selection of the data 113 */ 99 114 void unsetSelection(); 100 115 /** … … 102 117 * @param[in] sdh an SDHeader object 103 118 */ 104 void putSDHeader( const SDHeader& sdh );119 void setHeader( const SDHeader& sdh ); 105 120 106 121 /** … … 108 123 * @return an SDHeader object 109 124 */ 110 SDHeader getSDHeader( ) const; 111 112 125 SDHeader getHeader( ) const; 113 126 /** 114 127 * Checks if the "other" Scantable is conformant with this, … … 123 136 * @return number of scans in the table 124 137 */ 125 int n Scan() const;138 int nscan() const; 126 139 127 140 //casa::MDirection::Types getDirectionReference() const; … … 130 143 /** 131 144 * Get global antenna position 145 * @return casa::MPosition 146 */ 147 casa::MPosition getAntennaPosition() const; 148 149 /** 150 * Return the Flux unit of the data, e.g. "Jy" or "K" 151 * @return string 152 */ 153 std::string getFluxUnit() const; 154 155 /** 156 * Set the Flux unit of the data 157 * @param unit a string representing the unit, e.g "Jy" or "K" 158 */ 159 void setFluxUnit( const std::string& unit ); 160 161 /** 162 * 163 * @param instrument a string representing an insturment. see xxx 164 */ 165 void setInstrument( const std::string& instrument ); 166 167 /** 168 * (Re)calculate the azimuth and elevationnfor all rows 169 */ 170 void calculateAZEL(); 171 172 /** 173 * "hard" flag the data, this flags everything selected in setSelection() 174 */ 175 void flag(); 176 177 178 /** 179 * Get the number of beams in the data or a specific scan 180 * @param scanno the scan number to get the number of beams for. 181 * If scanno<0 the number is retrieved from the header. 182 * @return an integer number 183 */ 184 int nbeam(int scanno=-1) const; 185 /** 186 * Get the number of IFs in the data or a specific scan 187 * @param scanno the scan number to get the number of IFs for. 188 * If scanno<0 the number is retrieved from the header. 189 * @return an integer number 190 */ 191 int nif(int scanno=-1) const; 192 /** 193 * Get the number of polarizations in the data or a specific scan 194 * @param scanno the scan number to get the number of polarizations for. 195 * If scanno<0 the number is retrieved from the header. 196 * @return an integer number 197 */ 198 int npol(int scanno=-1) const; 199 200 /** 201 * Get the number of channels in the data or a specific IF. This currently 202 * varies only with IF number 203 * @param ifno the IF number to get the number of channels for. 204 * If ifno<0 the number is retrieved from the header. 205 * @return an integer number 206 */ 207 int nchan(int ifno=-1) const; 208 209 /** 210 * Get the number of integartion cycles 211 * @param scanno the scan number to get the number of rows for. 212 * If scanno<0 the number is retrieved from the header. 132 213 * @return 133 214 */ 134 casa::MPosition getAntennaPosition() const;135 136 /**137 *138 * @return139 */140 141 std::string getFluxUnit() const;142 143 /**144 *145 * @param unit146 */147 void setFluxUnit( const std::string& unit );148 149 /**150 *151 * @param instrument152 */153 void setInstrument( const std::string& instrument );154 155 void calculateAZEL();156 157 /**158 * "hard" flags159 * @param[in] whichrow160 */161 void flag();162 163 int nbeam(int scanno=-1) const;164 int nif(int scanno=-1) const;165 int npol(int scanno=-1) const;166 int nchan(int scanno=-1, int ifno=-1) const;167 168 215 int nrow(int scanno=-1) const; 169 216 170 double getInterval(int whichrow=0) const; 171 172 float getTsys(int whichrow=0) const; 217 int ncycle(int scanno=-1) const; 218 219 double getInterval(int scanno=0) const; 220 221 float getTsys(int scanno=0) const; 173 222 174 223 std::vector<bool> getMask(int whichrow=0) const; … … 181 230 int polidx=-1) const; 182 231 232 /** 233 * Write the Scantable to disk 234 * @param filename the output file name 235 */ 183 236 void makePersistent(const std::string& filename); 184 185 186 void select(const STSelector& sel);187 188 const STSelector& selection() const { return selector_; }189 237 190 238 std::vector<std::string> getHistory() const;
Note:
See TracChangeset
for help on using the changeset viewer.