Changeset 837


Ignore:
Timestamp:
02/20/06 14:44:25 (18 years ago)
Author:
mar637
Message:

Reworked nchan and nrow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r805 r837  
    188188}
    189189
    190 void asap::Scantable::setupHistoryTable( )
     190void Scantable::setupHistoryTable( )
    191191{
    192192  TableDesc tdh("", "1", TableDesc::Scratch);
     
    293293}
    294294
    295 int Scantable::nScan() const {
     295int Scantable::nscan() const {
    296296  int n = 0;
    297297  int previous = -1; int current = 0;
     
    379379}
    380380
    381 int asap::Scantable::nbeam( int scanno ) const
     381int Scantable::nbeam( int scanno ) const
    382382{
    383383  if ( scanno < 0 ) {
     
    397397}
    398398
    399 int asap::Scantable::nif( int scanno ) const
     399int Scantable::nif( int scanno ) const
    400400{
    401401  if ( scanno < 0 ) {
     
    415415}
    416416
    417 int asap::Scantable::npol( int scanno ) const
     417int Scantable::npol( int scanno ) const
    418418{
    419419  if ( scanno < 0 ) {
     
    433433}
    434434
    435 int asap::Scantable::nrow( int scanno ) const
     435int Scantable::nrow( int scanno ) const
    436436{
    437437  if ( scanno < 0 ) {
    438     return int(table_.nrow());
     438    Block<String> cols(2);
     439    cols[0] = "SCANNO";
     440    cols[1] = "CYCLENO";
     441    TableIterator it(table_, cols);
     442    int n = 0;
     443    while ( !it.pastEnd() ) {
     444      ++n;
     445    }
     446    return n;
    439447  } else {
    440448    // take the first POLNO,IFNO,CYCLENO as nbeam shouldn't vary with these
     
    449457
    450458
    451 int asap::Scantable::nchan( int scanno, int ifno ) const
    452 {
    453   if ( scanno < 0 && ifno < 0 ) {
     459int Scantable::nchan( int scanno, int ifno ) const
     460{
     461  if ( scanno < 0 || ifno < 0 ) {
    454462    Int n;
    455463    table_.keywordSet().get("nChan",n);
     
    463471                       && table_.col("CYCLENO") == 0 );
    464472    ROArrayColumn<Float> v(tab, "SPECTRA");
    465     cout << v.shape(0) << endl;
    466     return 0;
     473    return v(0).nelements();
    467474  }
    468475  return 0;
     
    614621}
    615622
    616 std::string asap::Scantable::summary( bool verbose )
     623std::string Scantable::summary( bool verbose )
    617624{
    618625  // Format header info
Note: See TracChangeset for help on using the changeset viewer.