File: iuwtmask.cpp

package info (click to toggle)
wsclean 2.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,196 kB
  • sloc: cpp: 34,504; ansic: 234; python: 174; makefile: 10
file content (34 lines) | stat: -rw-r--r-- 956 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "iuwtmask.h"
#include "iuwtdecomposition.h"

#include <boost/numeric/conversion/bounds.hpp>

std::string IUWTMask::Summary(const IUWTDecomposition& iuwt) const
{
	std::ostringstream str;
	str << "IUWTMask with " << _masks.size() << " scale masks (iuwt: " << iuwt.Summary() << ")\n";
	for(size_t i=0; i!=_masks.size(); ++i)
	{
		double maxVal = boost::numeric::bounds<double>::lowest();
		double minVal = std::numeric_limits<double>::max();
		size_t count = 0;
		for(size_t j=0; j!=_masks[i].size(); ++j)
		{
			if(_masks[i][j])
			{
				++count;
				if(iuwt[i][j] > maxVal)
					maxVal = iuwt[i][j];
				if(iuwt[i][j] < minVal)
					minVal = iuwt[i][j];
			}
		}
		if(maxVal == boost::numeric::bounds<double>::lowest())
		{
			maxVal = std::numeric_limits<double>::quiet_NaN();
			minVal = std::numeric_limits<double>::quiet_NaN();
		}
		str << "Scale " << i << ": " << count << " (" << minVal << " - " << maxVal << ")\n";
	}
	return str.str();
}