Changeset 2143
- Timestamp:
- 04/18/11 12:13:08 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STMath.cpp
r2135 r2143 492 492 ArrayColumn<Float> specCol(tab,"SPECTRA"); 493 493 ArrayColumn<Float> tsysCol(tab,"TSYS"); 494 if (mode=="DIV") val = 1.0/val ; 495 else if (mode=="SUB") val *= -1.0 ; 494 496 for (uInt i=0; i<tab.nrow(); ++i) { 495 497 Vector<Float> spec; … … 498 500 tsysCol.get(i, ts); 499 501 if (mode == "MUL" || mode == "DIV") { 500 if (mode == "DIV") val = 1.0/val;502 //if (mode == "DIV") val = 1.0/val; 501 503 spec *= val; 502 504 specCol.put(i, spec); … … 506 508 } 507 509 } else if ( mode == "ADD" || mode == "SUB") { 508 if (mode == "SUB") val *= -1.0;510 //if (mode == "SUB") val *= -1.0; 509 511 spec += val; 510 512 specCol.put(i, spec); … … 587 589 ArrayColumn<Float> specCol(tab,"SPECTRA"); 588 590 ArrayColumn<Float> tsysCol(tab,"TSYS"); 591 if (mode == "DIV") fact = (float)1.0 / fact; 592 else if (mode == "SUB") fact *= (float)-1.0 ; 589 593 for (uInt i=0; i<tab.nrow(); ++i) { 590 594 Vector<Float> spec; … … 593 597 tsysCol.get(i, ts); 594 598 if (mode == "MUL" || mode == "DIV") { 595 if (mode == "DIV") fact = (float)1.0 / fact;599 //if (mode == "DIV") fact = (float)1.0 / fact; 596 600 spec *= fact; 597 601 specCol.put(i, spec); … … 601 605 } 602 606 } else if ( mode == "ADD" || mode == "SUB") { 603 if (mode == "SUB") fact *= (float)-1.0 ;607 //if (mode == "SUB") fact *= (float)-1.0 ; 604 608 spec += fact; 605 609 specCol.put(i, spec);
Note:
See TracChangeset
for help on using the changeset viewer.