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/NROOTFDataset.cc

    r1868 r2436  
    535535    c18[16] = '\0' ;
    536536    RX[i] = string( c18 ) ;
    537     // DEBUG
    538 //     if ( i == 0 ) {
    539 //       cout << "RX      " ;
    540 //     }
    541 //     else if ( ( i % 5 ) == 0 ) {
    542 //       cout << endl << "        " ;
    543 //     }
    544 //     cout << RX[i] << " " ;
    545     //
    546   }
    547   //cout << endl ;
     537  }
     538  // DEBUG
     539//   nro_debug_output( "RX", NRO_ARYMAX, RX ) ;
     540  //
    548541  for ( int i = 0 ; i < NRO_ARYMAX ; i++ ) {
    549542    if ( readHeader( HPBW[i], sameEndian ) == -1 ) {
     
    551544      return -1 ;
    552545    }
    553     // DEBUG
    554 //     if ( i == 0 ) {
    555 //       cout << "HPBW    " ;
    556 //     }
    557 //     else if ( ( i % 5 ) == 0 ) {
    558 //       cout << endl << "        " ;
    559 //     }
    560 //     cout << HPBW[i] << " " ;
    561     //
    562   }
    563   //cout << endl ;
     546  }
     547  // DEBUG
     548//   nro_debug_output( "HPBW", NRO_ARYMAX, HPBW ) ;
     549  //
    564550  for ( int i = 0 ; i < NRO_ARYMAX ; i++ ) {
    565551    if ( readHeader( EFFA[i], sameEndian ) == -1 ) {
     
    567553      return -1 ;
    568554    }
    569     // DEBUG
    570 //     if ( i == 0 ) {
    571 //       cout << "EFFA    " ;
    572 //     }
    573 //     else if ( ( i % 5 ) == 0 ) {
    574 //       cout << endl << "        " ;
    575 //     }
    576 //     cout << EFFA[i] << " " ;
    577     //
    578   }
    579   //cout << endl ;
     555  }
     556  // DEBUG
     557//   nro_debug_output( "EFFA", NRO_ARYMAX, EFFA ) ;
     558  //
    580559  for ( int i = 0 ; i < NRO_ARYMAX ; i++ ) {
    581560    if ( readHeader( EFFB[i], sameEndian ) == -1 ) {
     
    583562      return -1 ;
    584563    }
    585     // DEBUG
    586 //     if ( i == 0 ) {
    587 //       cout << "EFFB    " ;
    588 //     }
    589 //     else if ( ( i % 5 ) == 0 ) {
    590 //       cout << endl << "        " ;
    591 //     }
    592 //     cout << EFFB[i] << " " ;
    593     //
    594   }
    595   //cout << endl ;
     564  }
     565  // DEBUG
     566//   nro_debug_output( "EFFB", NRO_ARYMAX, EFFB ) ;
     567  //
    596568  for ( int i = 0 ; i < NRO_ARYMAX ; i++ ) {
    597569    if ( readHeader( EFFL[i], sameEndian ) == -1 ) {
     
    599571      return -1 ;
    600572    }
    601     // DEBUG
    602 //     if ( i == 0 ) {
    603 //       cout << "EFFL    " ;
    604 //     }
    605 //     else if ( ( i % 5 ) == 0 ) {
    606 //       cout << endl << "        " ;
    607 //     }
    608 //     cout << EFFL[i] << " " ;
    609     //
    610   }
    611   //cout << endl ;
     573  }
     574  // DEBUG
     575//   nro_debug_output( "EFFL", NRO_ARYMAX, EFFL ) ;
     576  //
    612577  for ( int i = 0 ; i < NRO_ARYMAX ; i++ ) {
    613578    if ( readHeader( EFSS[i], sameEndian ) == -1 ) {
     
    615580      return -1 ;
    616581    }
    617     // DEBUG
    618 //     if ( i == 0 ) {
    619 //       cout << "EFSS    " ;
    620 //     }
    621 //     else if ( ( i % 5 ) == 0 ) {
    622 //       cout << endl << "        " ;
    623 //     }
    624 //     cout << EFSS[i] << " " ;
    625     //
    626   }
    627   //cout << endl ;
     582  }
     583  // DEBUG
     584//   nro_debug_output( "EFSS", NRO_ARYMAX, EFSS ) ;
     585  //
    628586  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    629587    if ( readHeader( GAIN[i], sameEndian ) == -1 ) {
     
    631589      return -1 ;
    632590    }
    633     // DEBUG
    634 //     if ( i == 0 ) {
    635 //       cout << "GAIN    " ;
    636 //     }
    637 //     else if ( ( i % 5 ) == 0 ) {
    638 //       cout << endl << "        " ;
    639 //     }
    640 //     cout << GAIN[i] << " " ;
    641     //
    642   }
    643   //cout << endl ;
     591  }
     592  // DEBUG
     593//   nro_debug_output( "GAIN", NRO_ARYMAX, GAIN ) ;
     594  //
    644595  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    645596    strcpy( c4, str4.c_str() ) ;
     
    649600    }
    650601    HORN[i] = string( c4 ) ;
    651     // DEBUG
    652 //     if ( i == 0 ) {
    653 //       cout << "HORN    " ;
    654 //     }
    655 //     else if ( ( i % 5 ) == 0 ) {
    656 //       cout << endl << "        " ;
    657 //     }
    658 //     cout << HORN[i] << " " ;
    659     //
    660   }
    661   //cout << endl ;
     602  }
     603  // DEBUG
     604//   nro_debug_output( "HORN", NRO_ARYMAX, HORN ) ;
     605  //
    662606  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    663607    strcpy( c4, str4.c_str() ) ;
     
    667611    }
    668612    POLTP[i] = string( c4 ) ;
    669     // DEBUG
    670 //     if ( i == 0 ) {
    671 //       cout << "POLTP   " ;
    672 //     }
    673 //     else if ( ( i % 5 ) == 0 ) {
    674 //       cout << endl << "        " ;
    675 //     }
    676 //     cout << POLTP[i] << " " ;
    677     //
    678   }
    679   //cout << endl ;
     613  }
     614  // DEBUG
     615//   nro_debug_output( "POLTP", NRO_ARYMAX, POLTP ) ;
     616  //
    680617  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    681618    if ( readHeader( POLDR[i], sameEndian ) == -1 ) {
     
    683620      return -1 ;
    684621    }
    685     // DEBUG
    686 //     if ( i == 0 ) {
    687 //       cout << "POLDR   " ;
    688 //     }
    689 //     else if ( ( i % 5 ) == 0 ) {
    690 //       cout << endl << "        " ;
    691 //     }
    692 //     cout << POLDR[i] << " " ;
    693     //
    694   }
    695   //cout << endl ;
     622  }
     623  // DEBUG
     624//   nro_debug_output( "POLDR", NRO_ARYMAX, POLDR ) ;
     625  //
    696626  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    697627    if ( readHeader( POLAN[i], sameEndian ) == -1 ) {
     
    699629      return -1 ;
    700630    }
    701     // DEBUG
    702 //     if ( i == 0 ) {
    703 //       cout << "POLAN   " ;
    704 //     }
    705 //     else if ( ( i % 5 ) == 0 ) {
    706 //       cout << endl << "        " ;
    707 //     }
    708 //     cout << POLAN[i] << " " ;
    709     //
    710   }
    711   //cout << endl ;
     631  }
     632  // DEBUG
     633//   nro_debug_output( "POLAN", NRO_ARYMAX, POLAN ) ;
     634  //
    712635  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    713636    if ( readHeader( DFRQ[i], sameEndian ) == -1 ) {
     
    715638      return -1 ;
    716639    }
    717     // DEBUG
    718 //     if ( i == 0 ) {
    719 //       cout << "DFRQ    " ;
    720 //     }
    721 //     else if ( ( i % 5 ) == 0 ) {
    722 //       cout << endl << "        " ;
    723 //     }
    724 //     cout << DFRQ[i] << " " ;
    725     //
    726   }
    727   //cout << endl ;
     640  }
     641  // DEBUG
     642//   nro_debug_output( "DFRQ", NRO_ARYMAX, DFRQ ) ;
     643  //
    728644  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    729645    strcpy( c4, str4.c_str() ) ;
     
    733649    }
    734650    SIDBD[i] = string( c4 ) ;
    735     // DEBUG
    736 //     if ( i == 0 ) {
    737 //       cout << "SIDBD   " ;
    738 //     }
    739 //     else if ( ( i % 5 ) == 0 ) {
    740 //       cout << endl << "        " ;
    741 //     }
    742 //     cout << SIDBD[i] << " " ;
    743     //
    744   }
    745   //cout << endl ;
     651  }
     652  // DEBUG
     653//   nro_debug_output( "SIDBD", NRO_ARYMAX, SIDBD ) ;
     654  //
    746655  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    747656    if ( readHeader( REFN[i], sameEndian ) == -1 ) {
     
    749658      return -1 ;
    750659    }
    751     // DEBUG
    752 //     if ( i == 0 ) {
    753 //       cout << "REFN    " ;
    754 //     }
    755 //     else if ( ( i % 5 ) == 0 ) {
    756 //       cout << endl << "        " ;
    757 //     }
    758 //     cout << REFN[i] << " " ;
    759     //
    760   }
    761   //cout << endl ;
     660  }
     661  // DEBUG
     662//   nro_debug_output( "REFN", NRO_ARYMAX, REFN ) ;
     663  //
    762664  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    763665    if ( readHeader( IPINT[i], sameEndian ) == -1 ) {
     
    765667      return -1 ;
    766668    }
    767     // DEBUG
    768 //     if ( i == 0 ) {
    769 //       cout << "IPINT   " ;
    770 //     }
    771 //     else if ( ( i % 5 ) == 0 ) {
    772 //       cout << endl << "        " ;
    773 //     }
    774 //     cout << IPINT[i] << " " ;
    775     //
    776   }
    777   //cout << endl ;
     669  }
     670  // DEBUG
     671//   nro_debug_output( "IPINT", NRO_ARYMAX, IPINT ) ;
     672  //
    778673  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    779674    if ( readHeader( MULTN[i], sameEndian ) == -1 ) {
     
    781676      return -1 ;
    782677    }
    783     // DEBUG
    784 //     if ( i == 0 ) {
    785 //       cout << "MULTN   " ;
    786 //     }
    787 //     else if ( ( i % 5 ) == 0 ) {
    788 //       cout << endl << "        " ;
    789 //     }
    790 //     cout << MULTN[i] << " " ;
    791     //
    792   }
    793   //cout << endl ;
     678  }
     679  // DEBUG
     680//   nro_debug_output( "MULTN", NRO_ARYMAX, MULTN ) ;
     681  //
    794682  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    795683    if ( readHeader( MLTSCF[i], sameEndian ) == -1 ) {
     
    797685      return -1 ;
    798686    }
    799     // DEBUG
    800 //     if ( i == 0 ) {
    801 //       cout << "MLTSCF  " ;
    802 //     }
    803 //     else if ( ( i % 5 ) == 0 ) {
    804 //       cout << endl << "        " ;
    805 //     }
    806 //     cout << MLTSCF[i] << " " ;
    807     //
    808   }
    809   //cout << endl ;
     687  }
     688  // DEBUG
     689//   nro_debug_output( "MLTSCF", NRO_ARYMAX, MLTSCF ) ;
     690  //
    810691  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    811692    strcpy( c8, str8.c_str() ) ;
     
    815696    }
    816697    LAGWIND[i] = string( c8 ) ;
    817     // DEBUG
    818 //     if ( i == 0 ) {
    819 //       cout << "LAGWIND " ;
    820 //     }
    821 //     else if ( ( i % 5 ) == 0 ) {
    822 //       cout << endl << "        " ;
    823 //     }
    824 //     cout << LAGWIND[i] << " " ;
    825     //
    826   }
    827   //cout << endl ;
     698  }
     699  // DEBUG
     700//   nro_debug_output( "LAGWIND", NRO_ARYMAX, LAGWIND ) ;
     701  //
    828702  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    829703    if ( readHeader( BEBW[i], sameEndian ) == -1 ) {
     
    831705      return -1 ;
    832706    }
    833     // DEBUG
    834 //     if ( i == 0 ) {
    835 //       cout << "BEBW    " ;
    836 //     }
    837 //     else if ( ( i % 5 ) == 0 ) {
    838 //       cout << endl << "        " ;
    839 //     }
    840 //     cout << BEBW[i] << " " ;
    841     //
    842   }
    843   //cout << endl ;
     707  }
     708  // DEBUG
     709//   nro_debug_output( "BEBW", NRO_ARYMAX, BEBW ) ;
     710  //
    844711  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    845712    if ( readHeader( BERES[i], sameEndian ) == -1 ) {
     
    847714      return -1 ;
    848715    }
    849     // DEBUG
    850 //     if ( i == 0 ) {
    851 //       cout << "BERES   " ;
    852 //     }
    853 //     else if ( ( i % 5 ) == 0 ) {
    854 //       cout << endl << "        " ;
    855 //     }
    856 //     cout << BERES[i] << " " ;
    857     //
    858   }
    859   //cout << endl ;
     716  }
     717  // DEBUG
     718//   nro_debug_output( "BERES", NRO_ARYMAX, BERES ) ;
     719  //
    860720  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    861721    if ( readHeader( CHWID[i], sameEndian ) == -1 ) {
     
    863723      return -1 ;
    864724    }
    865     // DEBUG
    866 //     if ( i == 0 ) {
    867 //       cout << "CHWID   " ;
    868 //     }
    869 //     else if ( ( i % 5 ) == 0 ) {
    870 //       cout << endl << "        " ;
    871 //     }
    872 //     cout << CHWID[i] << " " ;
    873     //
    874   }
    875   //cout << endl ;
     725  }
     726  // DEBUG
     727//   nro_debug_output( "CHWID", NRO_ARYMAX, CHWID ) ;
     728  //
    876729  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    877730    if ( readHeader( ARRY[i], sameEndian ) == -1 ) {
     
    879732      return -1 ;
    880733    }
    881     // DEBUG
    882 //     if ( i == 0 ) {
    883 //       cout << "ARRY    " ;
    884 //     }
    885 //     else if ( ( i % 5 ) == 0 ) {
    886 //       cout << endl << "        " ;
    887 //     }
    888 //     cout << ARRY[i] << " " ;
    889     //
    890   }
    891   //cout << endl ;
     734  }
     735  // DEBUG
     736//   nro_debug_output( "ARRY", NRO_ARYMAX, ARRY ) ;
     737  //
    892738  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    893739    if ( readHeader( NFCAL[i], sameEndian ) == -1 ) {
     
    895741      return -1 ;
    896742    }
    897     // DEBUG
    898 //     if ( i == 0 ) {
    899 //       cout << "NFCAL   " ;
    900 //     }
    901 //     else if ( ( i % 5 ) == 0 ) {
    902 //       cout << endl << "        " ;
    903 //     }
    904 //     cout << NFCAL[i] << " " ;
    905     //
    906   }
    907   //cout << endl ;
     743  }
     744  // DEBUG
     745//   nro_debug_output( "NFCAL", NRO_ARYMAX, NFCAL ) ;
     746  //
    908747  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    909748    if ( readHeader( F0CAL[i], sameEndian ) == -1 ) {
     
    911750      return -1 ;
    912751    }
    913     // DEBUG
    914 //     if ( i == 0 ) {
    915 //       cout << "F0CAL   " ;
    916 //     }
    917 //     else if ( ( i % 5 ) == 0 ) {
    918 //       cout << endl << "        " ;
    919 //     }
    920 //     cout << F0CAL[i] << " " ;
    921     //
    922   }
    923   //cout << endl ;
     752  }
     753  // DEBUG
     754//   nro_debug_output( "F0CAL", NRO_ARYMAX, F0CAL ) ;
     755  //
    924756  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    925757    for ( int j = 0 ; j < 10 ; j++ ) {
     
    928760        return -1 ;
    929761      }
    930       // DEBUG
    931 //       if ( j == 0 ) {
    932 //         if ( i < 10 )
    933 //           cout << "FQCAL0" << i << " " ;
    934 //         else
    935 //           cout << "FQCAL" << i << " " ;
    936 //       }
    937 //       else if ( ( j % 5 ) == 0 ) {
    938 //         cout << endl << "        " ;
    939 //       }
    940 //       cout << FQCAL[i][j] << " " ;
    941       //
    942     }
    943     //cout << endl ;
    944   }
     762    }
     763  }
     764  // DEBUG
     765//   nro_debug_output( "FQCAL", NRO_ARYMAX, 10, FQCAL ) ;
     766  // 
    945767  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    946768    for ( int j = 0 ; j < 10 ; j++ ) {
     
    949771        return -1 ;
    950772      }
    951      // DEBUG
    952 //       if ( j == 0 ) {
    953 //         if ( i < 10 )
    954 //           cout << "CHCAL0" << i << " " ;
    955 //         else
    956 //           cout << "CHCAL" << i << " " ;
    957 //       }
    958 //       else if ( ( j % 5 ) == 0 ) {
    959 //         cout << endl << "        " ;
    960 //       }
    961 //       cout << CHCAL[i][j] << " " ;
    962      //
    963     }
    964     //cout << endl ;
    965   }
     773    }
     774  }
     775  // DEBUG
     776//   nro_debug_output( "CHCAL", NRO_ARYMAX, 10, CHCAL ) ;
     777  // 
    966778  for ( int i = 0 ; i < NRO_ARYMAX ; i++) {
    967779    for ( int j = 0 ; j < 10 ; j++ ) {
     
    970782        return -1 ;
    971783      }
    972       // DEBUG
    973 //       if ( j == 0 ) {
    974 //         if ( i < 10 )
    975 //           cout << "CWCAL0" << i << " " ;
    976 //         else
    977 //           cout << "CWCAL" << i << " " ;
    978 //       }
    979 //       else if ( ( j % 5 ) == 0 ) {
    980 //         cout << endl << "        " ;
    981 //       }
    982 //       cout << CWCAL[i][j] << " " ;
    983       //
    984     }
    985     //cout << endl ;
    986   }
     784    }
     785  }
     786  // DEBUG
     787//   nro_debug_output( "CWCAL", NRO_ARYMAX, 10, CWCAL ) ;
     788  // 
    987789  if ( readHeader( SCNLEN, sameEndian ) == -1 ) {
    988790    os << LogIO::WARN << "Error while reading data SCNLEN." << LogIO::POST ;
Note: See TracChangeset for help on using the changeset viewer.