Changeset 845 for trunk


Ignore:
Timestamp:
02/23/06 11:25:32 (18 years ago)
Author:
mar637
Message:

changed getSDHeader -> getHeader
changed nrow interface
added ncycle()

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r837 r845  
    244244}
    245245
    246 void Scantable::putSDHeader(const SDHeader& sdh)
     246void Scantable::setHeader(const SDHeader& sdh)
    247247{
    248248  table_.rwKeywordSet().define("nIF", sdh.nif);
     
    264264}
    265265
    266 SDHeader Scantable::getSDHeader() const
     266SDHeader Scantable::getHeader() const
    267267{
    268268  SDHeader sdh;
     
    286286}
    287287
     288bool Scantable::conformant( const Scantable& other )
     289{
     290  return this->getHeader().conformant(other.getHeader());
     291}
     292
     293
    288294int Scantable::rowToScanIndex( int therow )
    289295{
     
    433439}
    434440
    435 int Scantable::nrow( int scanno ) const
     441int Scantable::ncycle( int scanno ) const
    436442{
    437443  if ( scanno < 0 ) {
     
    457463
    458464
    459 int Scantable::nchan( int scanno, int ifno ) const
    460 {
    461   if ( scanno < 0 || ifno < 0 ) {
     465int Scantable::nrow( int scanno ) const
     466{
     467  return int(table_.nrow());
     468}
     469
     470int Scantable::nchan( int ifno ) const
     471{
     472  if ( ifno < 0 ) {
    462473    Int n;
    463474    table_.keywordSet().get("nChan",n);
    464475    return int(n);
    465476  } else {
    466     // take the first POLNO,IFNO,CYCLENO as nbeam shouldn't vary with these
    467     Table tab = table_(table_.col("SCANNO") == scanno
     477    // take the first SCANNO,POLNO,BEAMNO,CYCLENO as nbeam shouldn't vary with these
     478    Table tab = table_(table_.col("SCANNO") == 0
    468479                       && table_.col("IFNO") == ifno
    469480                       && table_.col("BEAMNO") == 0
  • trunk/src/Scantable.h

    r824 r845  
    8585  /**
    8686   * get a const reference to the underlying casa::Table
    87    * @return const casa::Table reference
     87   * @return consantcasa::Table reference
    8888   */
    8989  const casa::Table& table() const;
     
    9696  casa::Table& table();
    9797
     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   */
    98109  void setSelection(const STSelector& selection);
     110
     111  /**
     112   * unset the selection of the data
     113   */
    99114  void unsetSelection();
    100115  /**
     
    102117   * @param[in] sdh an SDHeader object
    103118   */
    104   void putSDHeader( const SDHeader& sdh );
     119  void setHeader( const SDHeader& sdh );
    105120
    106121  /**
     
    108123   * @return an SDHeader object
    109124   */
    110   SDHeader getSDHeader( ) const;
    111 
    112 
     125  SDHeader getHeader( ) const;
    113126  /**
    114127   * Checks if the "other" Scantable is conformant with this,
     
    123136   * @return number of scans in the table
    124137   */
    125   int nScan() const;
     138  int nscan() const;
    126139
    127140  //casa::MDirection::Types getDirectionReference() const;
     
    130143  /**
    131144   * 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.
    132213   * @return
    133214   */
    134   casa::MPosition getAntennaPosition() const;
    135 
    136   /**
    137    *
    138    * @return
    139    */
    140 
    141   std::string getFluxUnit() const;
    142 
    143   /**
    144    *
    145    * @param unit
    146    */
    147   void setFluxUnit( const std::string& unit );
    148 
    149   /**
    150    *
    151    * @param instrument
    152    */
    153   void setInstrument( const std::string& instrument );
    154 
    155   void calculateAZEL();
    156 
    157   /**
    158    * "hard" flags
    159    * @param[in] whichrow
    160    */
    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 
    168215  int nrow(int scanno=-1) const;
    169216
    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;
    173222
    174223  std::vector<bool> getMask(int whichrow=0) const;
     
    181230                                   int polidx=-1) const;
    182231
     232  /**
     233   * Write the Scantable to disk
     234   * @param filename the output file name
     235   */
    183236  void makePersistent(const std::string& filename);
    184 
    185 
    186   void select(const STSelector& sel);
    187 
    188   const STSelector& selection() const { return selector_; }
    189237
    190238  std::vector<std::string> getHistory() const;
Note: See TracChangeset for help on using the changeset viewer.