Changeset 2890
- Timestamp:
- 01/10/14 20:26:37 (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r2889 r2890 2048 2048 2049 2049 return res 2050 #found 2051 2050 2052 2051 @asaplog_post_dec 2053 2052 def get_first_rowno_by_if(self, ifno): … … 2074 2073 2075 2074 return res 2076 # doppler2077 ##################################2078 2075 2079 2076 @asaplog_post_dec -
trunk/src/Scantable.cpp
r2888 r2890 3556 3556 for (int i = 0; i < nChan; ++i) { 3557 3557 maskArray[i] = mask[i] ? 1 : 0; 3558 if (isnan(data[i])) maskArray[i] = 0; 3559 if (isinf(data[i])) maskArray[i] = 0; 3560 3561 finalMask[i] = (maskArray[i] == 1); 3562 if (finalMask[i]) { 3563 j++; 3564 } 3565 3566 /* 3567 maskArray[i] = mask[i] ? 1 : 0; 3558 3568 if (mask[i]) { 3559 3569 j++; 3560 3570 } 3561 3571 finalMask[i] = mask[i]; 3572 */ 3562 3573 } 3563 3574 … … 3611 3622 } 3612 3623 3624 //compute inverse matrix of the left half of xMatrix 3613 3625 std::vector<double> invDiag(nDOF); 3614 3626 for (int i = 0; i < nDOF; ++i) { … … 3669 3681 double stdDev = 0.0; 3670 3682 for (int i = 0; i < nChan; ++i) { 3671 stdDev += residual[i]*residual[i]*(double)maskArray[i]; 3683 if (maskArray[i] == 0) continue; 3684 stdDev += residual[i]*residual[i]; 3672 3685 } 3673 3686 stdDev = sqrt(stdDev/(double)nData); … … 3690 3703 } 3691 3704 if (newNData == nData) { 3692 break; //no more flag to add. iteration stops.3705 break; //no more flag to add. stop iteration. 3693 3706 } else { 3694 3707 nData = newNData; … … 3712 3725 3713 3726 return result; 3714 } 3727 } //xMatrix 3715 3728 3716 3729 void Scantable::cubicSplineBaseline(const std::vector<bool>& mask, int nPiece, … … 3955 3968 for (int i = 0; i < nChan; ++i) { 3956 3969 maskArray[i] = mask[i] ? 1 : 0; 3970 if (isnan(data[i])) maskArray[i] = 0; 3971 if (isinf(data[i])) maskArray[i] = 0; 3972 3973 finalMask[i] = (maskArray[i] == 1); 3974 if (finalMask[i]) { 3975 x[j] = i; 3976 j++; 3977 } 3978 3979 /* 3980 maskArray[i] = mask[i] ? 1 : 0; 3957 3981 if (mask[i]) { 3958 3982 x[j] = i; … … 3960 3984 } 3961 3985 finalMask[i] = mask[i]; 3986 */ 3962 3987 } 3963 3988 … … 4170 4195 double stdDev = 0.0; 4171 4196 for (int i = 0; i < nChan; ++i) { 4172 stdDev += residual[i]*residual[i]*(double)maskArray[i]; 4197 if (maskArray[i] == 0) continue; 4198 stdDev += residual[i]*residual[i]; 4173 4199 } 4174 4200 stdDev = sqrt(stdDev/(double)nData);
Note:
See TracChangeset
for help on using the changeset viewer.