Ignore:
Timestamp:
03/15/12 19:12:51 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

Defined template function for debug output.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/atnf/PKSIO/ASTEFXDataset.cc

    r1868 r2436  
    529529    c18[16] = '\0' ;
    530530    RX[i] = string( c18 ) ;
    531     // DEBUG
    532 //     if ( i == 0 ) {
    533 //       cout << "RX      " ;
    534 //     }
    535 //     else if ( ( i % 5 ) == 0 ) {
    536 //       cout << endl << "        " ;
    537 //     }
    538 //     cout << RX[i] << " " ;
    539     //
    540   }
    541   //cout << endl ;
     531  }
     532  // DEBUG
     533//   nro_debug_output( "RX", ASTE_ARYMAX_FX, RX ) ;
     534  //
    542535  for ( int i = 0 ; i < ASTE_ARYMAX_FX ; i++ ) {
    543536    if ( readHeader( HPBW[i], sameEndian ) == -1 ) {
     
    545538      return -1 ;
    546539    }
    547 //     // DEBUG
    548 //     if ( i == 0 ) {
    549 //       cout << "HPBW    " ;
    550 //     }
    551 //     else if ( ( i % 5 ) == 0 ) {
    552 //       cout << endl <    //cerr << "Error opening file " << filename_ << "." << endl ;< "        " ;
    553 //     }
    554 //     cout << HPBW[i] << " " ;
    555     //
    556   }
    557   //cout << endl ;
     540  }
     541  // DEBUG
     542//   nro_debug_output( "HPBW", ASTE_ARYMAX_FX, HPBW ) ;
     543  //
    558544  for ( int i = 0 ; i < ASTE_ARYMAX_FX ; i++ ) {
    559545    if ( readHeader( EFFA[i], sameEndian ) == -1 ) {
     
    561547      return -1 ;
    562548    }
    563     // DEBUG
    564 //     if ( i == 0 ) {
    565 //       cout << "EFFA    " ;
    566 //     }
    567 //     else if ( ( i % 5 ) == 0 ) {
    568 //       cout << endl << "        " ;
    569 //     }
    570 //     cout << EFFA[i] << " " ;
    571     //
    572   }
    573   //cout << endl ;
     549  }
     550  // DEBUG
     551//   nro_debug_output( "EFFA", ASTE_ARYMAX_FX, EFFA ) ;
     552  //
    574553  for ( int i = 0 ; i < ASTE_ARYMAX_FX ; i++ ) {
    575554    if ( readHeader( EFFB[i], sameEndian ) == -1 ) {
     
    577556      return -1 ;
    578557    }
    579     // DEBUG
    580 //     if ( i == 0 ) {
    581 //       cout << "EFFB    " ;
    582 //     }
    583 //     else if ( ( i % 5 ) == 0 ) {
    584 //       cout << endl << "        " ;
    585 //     }
    586 //     cout << EFFB[i] << " " ;
    587     //
    588   }
    589   //cout << endl ;
     558  }
     559  // DEBUG
     560//   nro_debug_output( "EFFB", ASTE_ARYMAX_FX, EFFB ) ;
     561  //
    590562  for ( int i = 0 ; i < ASTE_ARYMAX_FX ; i++ ) {
    591563    if ( readHeader( EFFL[i], sameEndian ) == -1 ) {
     
    593565      return -1 ;
    594566    }
    595     // DEBUG
    596 //     if ( i == 0 ) {
    597 //       cout << "EFFL    " ;
    598 //     }
    599 //     else if ( ( i % 5 ) == 0 ) {
    600 //       cout << endl << "        " ;
    601 //     }
    602 //     cout << EFFL[i] << " " ;
    603     //
    604   }
    605   //cout << endl ;
     567  }
     568  // DEBUG
     569//   nro_debug_output( "EFFL", ASTE_ARYMAX_FX, EFFL ) ;
     570  //
    606571  for ( int i = 0 ; i < ASTE_ARYMAX_FX ; i++ ) {
    607572    if ( readHeader( EFSS[i], sameEndian ) == -1 ) {
     
    609574      return -1 ;
    610575    }
    611     // DEBUG
    612 //     if ( i == 0 ) {
    613 //       cout << "EFSS    " ;
    614 //     }
    615 //     else if ( ( i % 5 ) == 0 ) {
    616 //       cout << endl << "        " ;
    617 //     }
    618 //     cout << EFSS[i] << " " ;
    619     //
    620   }
    621   //cout << endl ;
     576  }
     577  // DEBUG
     578//   nro_debug_output( "EFSS", ASTE_ARYMAX_FX, EFSS ) ;
     579  //
    622580  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    623581    if ( readHeader( GAIN[i], sameEndian ) == -1 ) {
     
    625583      return -1 ;
    626584    }
    627     // DEBUG
    628 //     if ( i == 0 ) {
    629 //       cout << "GAIN    " ;
    630 //     }
    631 //     else if ( ( i % 5 ) == 0 ) {
    632 //       cout << endl << "        " ;
    633 //     }
    634 //     cout << GAIN[i] << " " ;
    635     //
    636   }
    637   //cout << endl ;
     585  }
     586  // DEBUG
     587//   nro_debug_output( "GAIN", ASTE_ARYMAX_FX, GAIN ) ;
     588  //
    638589  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    639590    strcpy( c4, str4.c_str() ) ;
     
    643594    }
    644595    HORN[i] = string( c4 ) ;
    645     // DEBUG
    646 //     if ( i == 0 ) {
    647 //       cout << "HORN    " ;
    648 //     }
    649 //     else if ( ( i % 5 ) == 0 ) {
    650 //       cout << endl << "        " ;
    651 //     }
    652 //     cout << HORN[i] << " " ;
    653     //
    654   }
    655   //cout << endl ;
     596  }
     597  // DEBUG
     598//   nro_debug_output( "HORN", ASTE_ARYMAX_FX, HORN ) ;
     599  //
    656600  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    657601    strcpy( c4, str4.c_str() ) ;
     
    661605    }
    662606    POLTP[i] = string( c4 ) ;
    663     // DEBUG
    664 //     if ( i == 0 ) {
    665 //       cout << "POLTP   " ;
    666 //     }
    667 //     else if ( ( i % 5 ) == 0 ) {
    668 //       cout << endl << "        " ;
    669 //     }
    670 //     cout << POLTP[i] << " " ;
    671     //
    672   }
    673   //cout << endl ;
     607  }
     608  // DEBUG
     609//   nro_debug_output( "POLTP", ASTE_ARYMAX_FX, POLTP ) ;
     610  //
    674611  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    675612    if ( readHeader( POLDR[i], sameEndian ) == -1 ) {
     
    677614      return -1 ;
    678615    }
    679      // DEBUG
    680 //     if ( i == 0 ) {
    681 //       cout << "POLDR   " ;
    682 //     }
    683 //     else if ( ( i % 5 ) == 0 ) {
    684 //       cout << endl << "        " ;
    685 //     }
    686 //     cout << POLDR[i] << " " ;
    687     //
    688   }
    689   //cout << endl ;
     616  }
     617  // DEBUG
     618//   nro_debug_output( "POLDR", ASTE_ARYMAX_FX, POLDR ) ;
     619  //
    690620  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    691621    if ( readHeader( POLAN[i], sameEndian ) == -1 ) {
     
    693623      return -1 ;
    694624    }
    695     // DEBUG
    696 //     if ( i == 0 ) {
    697 //       cout << "POLAN   " ;
    698 //     }
    699 //     else if ( ( i % 5 ) == 0 ) {
    700 //       cout << endl << "        " ;
    701 //     }
    702 //     cout << POLAN[i] << " " ;
    703     //
    704   }
    705   //cout << endl ;
     625  }
     626  // DEBUG
     627//   nro_debug_output( "POLAN", ASTE_ARYMAX_FX, POLAN ) ;
     628  //
    706629  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    707630    if ( readHeader( DFRQ[i], sameEndian ) == -1 ) {
     
    709632      return -1 ;
    710633    }
    711     // DEBUG
    712 //     if ( i == 0 ) {
    713 //       cout << "DFRQ    " ;
    714 //     }
    715 //     else if ( ( i % 5 ) == 0 ) {
    716 //       cout << endl << "        " ;
    717 //     }
    718 //     cout << DFRQ[i] << " " ;
    719     //
    720   }
    721   //cout << endl ;
     634  }
     635  // DEBUG
     636//   nro_debug_output( "DFRQ", ASTE_ARYMAX_FX, DFRQ ) ;
     637  //
    722638  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    723639    strcpy( c4, str4.c_str() ) ;
     
    727643    }
    728644    SIDBD[i] = string( c4 ) ;
    729     // DEBUG
    730 //     if ( i == 0 ) {
    731 //       cout << "SIDBD   " ;
    732 //     }
    733 //     else if ( ( i % 5 ) == 0 ) {
    734 //       cout << endl << "        " ;
    735 //     }
    736 //     cout << SIDBD[i] << " " ;
    737     //
    738   }
    739   //cout << endl ;
     645  }
     646  // DEBUG
     647//   nro_debug_output( "SIDBD", ASTE_ARYMAX_FX, SIDBD ) ;
     648  //
    740649  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    741650    if ( readHeader( REFN[i], sameEndian ) == -1 ) {
     
    743652      return -1 ;
    744653    }
    745     // DEBUG
    746 //     if ( i == 0 ) {
    747 //       cout << "REFN    " ;
    748 //     }
    749 //     else if ( ( i % 5 ) == 0 ) {
    750 //       cout << endl << "        " ;
    751 //     }
    752 //     cout << REFN[i] << " " ;
    753     //
    754   }
    755   //cout << endl ;
     654  }
     655  // DEBUG
     656//   nro_debug_output( "REFN", ASTE_ARYMAX_FX, REFN ) ;
     657  //
    756658  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    757659    if ( readHeader( IPINT[i], sameEndian ) == -1 ) {
     
    759661      return -1 ;
    760662    }
    761     // DEBUG
    762 //     if ( i == 0 ) {
    763 //       cout << "IPINT   " ;
    764 //     }
    765 //     else if ( ( i % 5 ) == 0 ) {
    766 //       cout << endl << "        " ;
    767 //     }
    768 //     cout << IPINT[i] << " " ;
    769     //
    770   }
    771   //cout << endl ;
     663  }
     664  // DEBUG
     665//   nro_debug_output( "IPINT", ASTE_ARYMAX_FX, IPINT ) ;
     666  //
    772667  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    773668    if ( readHeader( MULTN[i], sameEndian ) == -1 ) {
     
    775670      return -1 ;
    776671    }
    777     // DEBUG
    778 //     if ( i == 0 ) {
    779 //       cout << "MULTN   " ;
    780 //     }
    781 //     else if ( ( i % 5 ) == 0 ) {
    782 //       cout << endl << "        " ;
    783 //     }
    784 //     cout << MULTN[i] << " " ;
    785     //
    786   }
    787   //cout << endl ;
     672  }
     673  // DEBUG
     674//   nro_debug_output( "MULTN", ASTE_ARYMAX_FX, MULTN ) ;
     675  //
    788676  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    789677    if ( readHeader( MLTSCF[i], sameEndian ) == -1 ) {
     
    791679      return -1 ;
    792680    }
    793     // DEBUG
    794 //     if ( i == 0 ) {
    795 //       cout << "MLTSCF  " ;
    796 //     }
    797 //     else if ( ( i % 5 ) == 0 ) {
    798 //       cout << endl << "        " ;
    799 //     }
    800 //     cout << MLTSCF[i] << " " ;
    801     //
    802   }
    803   //cout << endl ;
     681  }
     682  // DEBUG
     683//   nro_debug_output( "MLTSCF", ASTE_ARYMAX_FX, MLTSCF ) ;
     684  //
    804685  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    805686    strcpy( c8, str8.c_str() ) ;
     
    809690    }
    810691    LAGWIND[i] = string( c8 ) ;
    811     // DEBUG
    812 //     if ( i == 0 ) {
    813 //       cout << "LAGWIND " ;
    814 //     }
    815 //     else if ( ( i % 5 ) == 0 ) {
    816 //       cout << endl << "        " ;
    817 //     }
    818 //     cout << LAGWIND[i] << " " ;
    819     //
    820   }
    821   //cout << endl ;
     692  }
     693  // DEBUG
     694//   nro_debug_output( "LAGWIND", ASTE_ARYMAX_FX, LAGWIND ) ;
     695  //
    822696  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    823697    if ( readHeader( BEBW[i], sameEndian ) == -1 ) {
     
    825699      return -1 ;
    826700    }
    827     // DEBUG
    828 //     if ( i == 0 ) {
    829 //       cout << "BEBW    " ;
    830 //     }
    831 //     else if ( ( i % 5 ) == 0 ) {
    832 //       cout << endl << "        " ;
    833 //     }
    834 //     cout << BEBW[i] << " " ;
    835     //
    836   }
    837   //cout << endl ;
     701  }
     702  // DEBUG
     703//   nro_debug_output( "BEBW", ASTE_ARYMAX_FX, BEBW ) ;
     704  //
    838705  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    839706    if ( readHeader( BERES[i], sameEndian ) == -1 ) {
     
    841708      return -1 ;
    842709    }
    843     // DEBUG
    844 //     if ( i == 0 ) {
    845 //       cout << "BERES   " ;
    846 //     }
    847 //     else if ( ( i % 5 ) == 0 ) {
    848 //       cout << endl << "        " ;
    849 //     }
    850 //     cout << BERES[i] << " " ;
    851     //
    852   }
    853   //cout << endl ;
     710  }
     711  // DEBUG
     712//   nro_debug_output( "BERES", ASTE_ARYMAX_FX, BERES ) ;
     713  //
    854714  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    855715    if ( readHeader( CHWID[i], sameEndian ) == -1 ) {
     
    857717      return -1 ;
    858718    }
    859     // DEBUG
    860 //     if ( i == 0 ) {
    861 //       cout << "CHWID   " ;
    862 //     }
    863 //     else if ( ( i % 5 ) == 0 ) {
    864 //       cout << endl << "        " ;
    865 //     }
    866 //     cout << CHWID[i] << " " ;
    867     //
    868   }
    869   //cout << endl ;
     719  }
     720  // DEBUG
     721//   nro_debug_output( "CHWID", ASTE_ARYMAX_FX, CHWID ) ;
     722  //
    870723  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    871724    if ( readHeader( ARRY[i], sameEndian ) == -1 ) {
     
    873726      return -1 ;
    874727    }
    875     // DEBUG
    876 //     if ( i == 0 ) {
    877 //       cout << "ARRY    " ;
    878 //     }
    879 //     else if ( ( i % 5 ) == 0 ) {
    880 //       cout << endl << "        " ;
    881 //     }
    882 //     cout << ARRY[i] << " " ;
    883     //
    884   }
    885   //cout << endl ;
     728  }
     729  // DEBUG
     730//   nro_debug_output( "ARRY", ASTE_ARYMAX_FX, ARRY ) ;
     731  //
    886732  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    887733    if ( readHeader( NFCAL[i], sameEndian ) == -1 ) {
     
    889735      return -1 ;
    890736    }
    891     // DEBUG
    892 //     if ( i == 0 ) {
    893 //       cout << "NFCAL   " ;
    894 //     }
    895 //     else if ( ( i % 5 ) == 0 ) {
    896 //       cout << endl << "        " ;
    897 //     }
    898 //     cout << NFCAL[i] << " " ;
    899     //
    900   }
    901   //cout << endl ;
     737  }
     738  // DEBUG
     739//   nro_debug_output( "NFCAL", ASTE_ARYMAX_FX, NFCAL ) ;
     740  //
    902741  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    903742    if ( readHeader( F0CAL[i], sameEndian ) == -1 ) {
     
    905744      return -1 ;
    906745    }
    907     // DEBUG
    908 //     if ( i == 0 ) {
    909 //       cout << "F0CAL   " ;
    910 //     }
    911 //     else if ( ( i % 5 ) == 0 ) {
    912 //       cout << endl << "        " ;
    913 //     }
    914 //     cout << F0CAL[i] << " " ;
    915     //
    916   }
    917   //cout << endl ;
     746  }
     747  // DEBUG
     748//   nro_debug_output( "F0CAL", ASTE_ARYMAX_FX, F0CAL ) ;
     749  //
    918750  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    919751    for ( int j = 0 ; j < 10 ; j++ ) {
     
    922754        return -1 ;
    923755      }
    924       // DEBUG
    925 //       if ( j == 0 ) {
    926 //         if ( i < 10 )
    927 //           cout << "FQCAL0" << i << " " ;
    928 //         else
    929 //           cout << "FQCAL" << i << " " ;
    930 //       }
    931 //       else if ( ( j % 5 ) == 0 ) {
    932 //         cout << endl << "        " ;
    933 //       }
    934 //       cout << FQCAL[i][j] << " " ;
    935       //
    936     }
    937     //cout << endl ;
    938   }
     756    }
     757  }
     758  // DEBUG
     759//   nro_debug_output( "FQCAL", ASTE_ARYMAX_FX, 10, FQCAL ) ;
     760  //
    939761  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    940762    for ( int j = 0 ; j < 10 ; j++ ) {
     
    943765        return -1 ;
    944766      }
    945      // DEBUG
    946 //       if ( j == 0 ) {
    947 //         if ( i < 10 )
    948 //           cout << "CHCAL0" << i << " " ;
    949 //         else
    950 //           cout << "CHCAL" << i << " " ;
    951 //       }
    952 //       else if ( ( j % 5 ) == 0 ) {
    953 //         cout << endl << "        " ;
    954 //       }
    955 //      cout << CHCAL[i][j] << " " ;
    956      //
    957     }
    958     //cout << endl ;
    959   }
     767    }
     768  }
     769  // DEBUG
     770//   nro_debug_output( "CHCAL", ASTE_ARYMAX_FX, 10, CHCAL ) ;
     771  //
    960772  for ( int i= 0 ; i < ASTE_ARYMAX_FX ; i++) {
    961773    for ( int j = 0 ; j < 10 ; j++ ) {
     
    964776        return -1 ;
    965777      }
    966       // DEBUG
    967 //       if ( j == 0 ) {
    968 //         if ( i < 10 )
    969 //           cout << "CWCAL0" << i << " " ;
    970 //         else
    971 //           cout << "CWCAL" << i << " " ;
    972 //       }
    973 //       else if ( ( j % 5 ) == 0 ) {
    974 //         cout << endl << "        " ;
    975 //       }
    976 //       cout << CWCAL[i][j] << " " ;
    977       //
    978     }
    979     //cout << endl ;
    980   }
     778    }
     779  }
     780  // DEBUG
     781//   nro_debug_output( "CWCAL", ASTE_ARYMAX_FX, 10, CWCAL ) ;
     782  //
    981783  if ( readHeader( SCNLEN, sameEndian ) == -1 ) {
    982784    os << LogIO::WARN << "Error while reading data SCNLEN." << endl ;
     
    1024826      return -1 ;
    1025827    }
    1026      // DEBUG
    1027 //     if ( i == 0 ) {
    1028 //       cout << "DSBFC   " ;
    1029 //     }
    1030 //     else if ( ( i % 5 ) == 0 ) {
    1031 //       cout << endl << "        " ;
    1032 //     }
    1033 //     cout << DSBFC[i] << " " ;
    1034     //
    1035   }
    1036   //cout << endl ;
     828  }
     829  // DEBUG
     830//   nro_debug_output( "DSBFC", ASTE_ARYMAX_FX, DSBFC ) ;
     831  //
    1037832
    1038833  scanNum_ = NSCAN + 1 ; // includes ZERO scan
Note: See TracChangeset for help on using the changeset viewer.