Changeset 1700 for branches/alma/src/Scantable.cpp
- Timestamp:
- 02/16/10 16:21:26 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/src/Scantable.cpp
r1656 r1700 701 701 } 702 702 pushLog(String(oss)); 703 } 704 705 void Scantable::clip(const Float uthres, const Float dthres, bool clipoutside, bool unflag) 706 { 707 for (uInt i=0; i<table_.nrow(); ++i) { 708 Vector<Float> spcs = specCol_(i); 709 Vector<uChar> flgs = flagsCol_(i); 710 if (spcs.nelements() != nchan) { 711 throw(AipsError("Data has incorrect number of channels")); 712 } 713 uChar userflag = 1 << 7; 714 if (unflag) { 715 userflag = 0 << 7; 716 } 717 if (clipoutside) { 718 for (uInt j = 0; j < nchan; ++j) { 719 Float spc = spcs(j); 720 if ((spc >= uthres) || (spc <= dthres)) { 721 flgs(j) = userflag; 722 } 723 } 724 } else { 725 for (uInt j = 0; j < nchan; ++j) { 726 Float spc = spcs(j); 727 if ((spc < uthres) && (spc > dthres)) { 728 flgs(j) = userflag; 729 } 730 } 731 } 732 flagsCol_.put(i, flgs); 733 } 703 734 } 704 735
Note: See TracChangeset
for help on using the changeset viewer.