- Timestamp:
- 10/11/12 17:24:12 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external-alma/atnf/PKSIO/NROFITSDataset.cc
r2442 r2664 620 620 } 621 621 // DEBUG 622 //nro_debug_output( "RX", ARYNM, RX ) ;622 //nro_debug_output( "RX", ARYNM, RX ) ; 623 623 // 624 624 if ( readColumn( HPBW, "HPBW", sameEndian ) != 0 ) { … … 1022 1022 strcpy( record_->ARRYT, str4.c_str() ) ; 1023 1023 status = readTable( record_->ARRYT, "ARRYT", strlen(record_->ARRYT), i ) ; 1024 record_->ARRYT[3] = '\0' ; 1024 for (int j = strlen(record_->ARRYT)-1 ; j >= 0 ; j--) { 1025 if (record_->ARRYT[j] == ' ') record_->ARRYT[j] = '\0'; 1026 else break; 1027 } 1025 1028 if ( status ) { 1026 1029 os << LogIO::WARN << "Error while reading ARRYT." << LogIO::POST ; … … 1549 1552 string arry3 ; 1550 1553 string arry4 ; 1554 char arytp[4]; 1551 1555 if ( readHeader( arry, "ARRY1" ) == 0 ) 1552 1556 arry1 = arry ; … … 1555 1559 for ( int i = 0 ; i < 20 ; i++ ) { 1556 1560 if ( arry1[i] == '1' ) { 1557 char arytp[4];1561 for (int j = 0 ; j < 4 ; j++) arytp[j] = '\0'; 1558 1562 sprintf( arytp, "H%d", i+1 ) ; 1559 1563 ARYTP[count++] = string( arytp ) ; 1560 //cout << "ARYTP[" << count-1 << "] = " << ARYTP[count-1] << endl ;1561 1564 } 1562 1565 } … … 1565 1568 else 1566 1569 arry2 = "00000000000000000000" ; 1567 for ( int i = 0 ; i < 20 ; i++ ) {1570 for ( int i = 0 ; i < 10 ; i++ ) { 1568 1571 if ( arry2[i] == '1' ) { 1569 if ( i < 10 ) { 1570 char arytp[4] ; 1571 sprintf( arytp, "W%d", i+1 ) ; 1572 ARYTP[count++] = string( arytp ) ; 1573 //cout << "ARYTP[" << count-1 << "] = " << ARYTP[count-1] << endl ; 1574 } 1575 else if ( i < 15 ) { 1576 char arytp[4] ; 1577 sprintf( arytp, "U%d", i-9 ) ; 1578 ARYTP[count++] = string( arytp ) ; 1579 //cout << "ARYTP[" << count-1 << "] = " << ARYTP[count-1] << endl ; 1580 } 1581 else { 1582 char arytp[4] ; 1583 sprintf( arytp, "X%d", i-14 ) ; 1584 ARYTP[count++] = string( arytp ) ; 1585 //cout << "ARYTP[" << count-1 << "] = " << ARYTP[count-1] << endl ; 1586 } 1572 for (int j = 0 ; j < 4 ; j++) arytp[j] = '\0'; 1573 sprintf( arytp, "W%d", i+1 ) ; 1574 ARYTP[count++] = string( arytp ) ; 1575 } 1576 } 1577 for ( int i = 10 ; i < 15 ; i++ ) { 1578 if ( arry2[i] == '1' ) { 1579 for (int j = 0 ; j < 4 ; j++) arytp[j] = '\0'; 1580 sprintf( arytp, "U%d", i-9 ) ; 1581 ARYTP[count++] = string( arytp ) ; 1582 } 1583 } 1584 for ( int i = 15 ; i < 20 ; i++ ) { 1585 if ( arry2[i] == '1' ) { 1586 for (int j = 0 ; j < 4 ; j++) arytp[j] = '\0'; 1587 sprintf( arytp, "X%d", i-14 ) ; 1588 ARYTP[count++] = string( arytp ) ; 1587 1589 } 1588 1590 } … … 1593 1595 for ( int i = 0 ; i < 20 ; i++ ) { 1594 1596 if ( arry3[i] == '1' ) { 1595 char arytp[4];1597 for (int j = 0 ; j < 4 ; j++) arytp[j] = '\0'; 1596 1598 sprintf( arytp, "A%d", i+1 ) ; 1597 1599 ARYTP[count++] = string( arytp ) ; 1598 //cout << "ARYTP[" << count-1 << "] = " << ARYTP[count-1] << endl ;1599 1600 } 1600 1601 } … … 1605 1606 for ( int i = 0 ; i < 20 ; i++ ) { 1606 1607 if ( arry4[i] == '1' ) { 1607 char arytp[4];1608 for (int j = 0 ; j < 4 ; j++) arytp[j] = '\0'; 1608 1609 sprintf( arytp, "A%d", i+21 ) ; 1609 1610 ARYTP[count++] = string( arytp ) ; 1610 //cout << "ARYTP[" << count-1 << "] = " << ARYTP[count-1] << endl ;1611 1611 } 1612 1612 } 1613 //nro_debug_output("ARYTP", ARYTP.size(), ARYTP); 1613 1614 } 1614 1615 … … 2234 2235 uInt NROFITSDataset::getArrayId( string type ) 2235 2236 { 2236 uInt ib = 99 ; 2237 for ( uInt i = 0 ; i < arrayid_.size() ; i++ ) { 2238 uInt len = ARYTP[i].size() ; 2239 if ( type.compare( 0, len, ARYTP[i], 0, len ) == 0 ) { 2237 uInt ib = 99; 2238 uInt len0 = type.size(); 2239 for (uInt i = 0 ; i < arrayid_.size() ; i++) { 2240 uInt len = ARYTP[i].size(); 2241 if ( len0 == len && type.compare( 0, len, ARYTP[i], 0, len ) == 0 ) { 2240 2242 ib = i ; 2241 2243 break ;
Note:
See TracChangeset
for help on using the changeset viewer.