Changeset 2952 for trunk/src/STMath.cpp
- Timestamp:
- 06/24/14 19:59:46 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STMath.cpp
r2950 r2952 618 618 float val, 619 619 const std::string& mode, 620 bool tsys ) 620 bool tsys, 621 bool skip_flaggedrow ) 621 622 { 622 623 CountedPtr< Scantable > out = getScantable(in, false); … … 624 625 ArrayColumn<Float> specCol(tab,"SPECTRA"); 625 626 ArrayColumn<Float> tsysCol(tab,"TSYS"); 627 ScalarColumn<uInt> flagrowCol(tab, "FLAGROW"); 626 628 if (mode=="DIV") val = 1.0/val ; 627 629 else if (mode=="SUB") val *= -1.0 ; … … 629 631 Vector<Float> spec; 630 632 Vector<Float> ts; 633 uInt flagrow; 631 634 specCol.get(i, spec); 632 635 tsysCol.get(i, ts); 636 flagrowCol.get(i, flagrow); 637 if (skip_flaggedrow && (flagrow > 0)) continue; 633 638 if (mode == "MUL" || mode == "DIV") { 634 639 //if (mode == "DIV") val = 1.0/val; … … 656 661 const std::string& mode, 657 662 const std::string& opmode, 658 bool tsys ) 663 bool tsys, 664 bool skip_flaggedrow ) 659 665 { 660 666 CountedPtr< Scantable > out ; 661 667 if ( opmode == "channel" ) { 662 out = arrayOperateChannel( in, val, mode, tsys ) ;668 out = arrayOperateChannel( in, val, mode, tsys, skip_flaggedrow ) ; 663 669 } 664 670 else if ( opmode == "row" ) { 665 out = arrayOperateRow( in, val, mode, tsys ) ;671 out = arrayOperateRow( in, val, mode, tsys, skip_flaggedrow ) ; 666 672 } 667 673 else { … … 674 680 const std::vector<float> val, 675 681 const std::string& mode, 676 bool tsys ) 682 bool tsys, 683 bool skip_flaggedrow ) 677 684 { 678 685 if ( val.size() == 1 ){ … … 721 728 ArrayColumn<Float> specCol(tab,"SPECTRA"); 722 729 ArrayColumn<Float> tsysCol(tab,"TSYS"); 730 ScalarColumn<uInt> flagrowCol(tab, "FLAGROW"); 723 731 if (mode == "DIV") fact = (float)1.0 / fact; 724 732 else if (mode == "SUB") fact *= (float)-1.0 ; … … 726 734 Vector<Float> spec; 727 735 Vector<Float> ts; 736 uInt flagrow; 728 737 specCol.get(i, spec); 729 738 tsysCol.get(i, ts); 739 flagrowCol.get(i, flagrow); 740 if (skip_flaggedrow && (flagrow > 0)) continue; 730 741 if (mode == "MUL" || mode == "DIV") { 731 742 //if (mode == "DIV") fact = (float)1.0 / fact; … … 752 763 const std::vector<float> val, 753 764 const std::string& mode, 754 bool tsys ) 765 bool tsys, 766 bool skip_flaggedrow ) 755 767 { 756 768 if ( val.size() == 1 ) { … … 788 800 ArrayColumn<Float> specCol(tab,"SPECTRA"); 789 801 ArrayColumn<Float> tsysCol(tab,"TSYS"); 802 ScalarColumn<uInt> flagrowCol(tab, "FLAGROW"); 790 803 if (mode == "DIV") fact = (float)1.0 / fact; 791 804 if (mode == "SUB") fact *= (float)-1.0 ; … … 793 806 Vector<Float> spec; 794 807 Vector<Float> ts; 808 uInt flagrow; 795 809 specCol.get(i, spec); 796 810 tsysCol.get(i, ts); 811 flagrowCol.get(i, flagrow); 812 if (skip_flaggedrow && (flagrow > 0)) continue; 797 813 if (mode == "MUL" || mode == "DIV") { 798 814 spec *= fact[i];
Note: See TracChangeset
for help on using the changeset viewer.