当前位置: 首页>>代码示例>>C++>>正文


C++ Mask2DPtr::Invert方法代码示例

本文整理汇总了C++中Mask2DPtr::Invert方法的典型用法代码示例。如果您正苦于以下问题:C++ Mask2DPtr::Invert方法的具体用法?C++ Mask2DPtr::Invert怎么用?C++ Mask2DPtr::Invert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mask2DPtr的用法示例。


在下文中一共展示了Mask2DPtr::Invert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PlotPowerSNR

void RFIGuiController::PlotPowerSNR()
{
	Image2DCPtr
		image = ActiveData().GetSingleImage(),
		model = RevisedData().GetSingleImage();
	if(IsImageLoaded())
	{
		Plot2D &plot = _plotManager->NewPlot2D("SNR spectrum");
		plot.SetLogarithmicYAxis(true);

		Mask2DPtr mask =
			Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
		Plot2DPointSet &totalPlot = plot.StartLine("Total");
		RFIPlots::MakeSNRSpectrumPlot(totalPlot, image, model, mask);

		mask = Mask2D::CreateCopy(ActiveData().GetSingleMask());
		if(!mask->AllFalse())
		{
			Plot2DPointSet &uncontaminatedPlot = plot.StartLine("Uncontaminated");
			RFIPlots::MakeSNRSpectrumPlot(uncontaminatedPlot, image, model, mask);
	
			mask->Invert();
			Plot2DPointSet &rfiPlot = plot.StartLine("RFI");
			RFIPlots::MakeSNRSpectrumPlot(rfiPlot, image, model, mask);
		}

		_plotManager->Update();
	}
}
开发者ID:pkgw,项目名称:aoflagger,代码行数:29,代码来源:rfiguicontroller.cpp

示例2: PlotPowerTime

void RFIGuiController::PlotPowerTime()
{
	if(IsImageLoaded())
	{
		Plot2D &plot = _plotManager->NewPlot2D("Power over time");
		plot.SetLogarithmicYAxis(true);

		TimeFrequencyData activeData = ActiveData();
		Image2DCPtr image = activeData.GetSingleImage();
		Mask2DPtr mask =
			Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
		Plot2DPointSet &totalPlot = plot.StartLine("Total");
		RFIPlots::MakePowerTimePlot(totalPlot, image, mask, MetaData());

		mask = Mask2D::CreateCopy(activeData.GetSingleMask());
		if(!mask->AllFalse())
		{
			Plot2DPointSet &uncontaminatedPlot = plot.StartLine("Uncontaminated");
			RFIPlots::MakePowerTimePlot(uncontaminatedPlot, image, mask, MetaData());
	
			mask->Invert();
			Plot2DPointSet &rfiPlot = plot.StartLine("RFI");
			RFIPlots::MakePowerTimePlot(rfiPlot, image, mask, MetaData());
		}

		_plotManager->Update();
	}
}
开发者ID:pkgw,项目名称:aoflagger,代码行数:28,代码来源:rfiguicontroller.cpp

示例3: PlotDist

void RFIGuiController::PlotDist()
{
	if(IsImageLoaded())
	{
		Plot2D &plot = _plotManager->NewPlot2D("Distribution");

		TimeFrequencyData activeData = ActiveData();
		Image2DCPtr image = activeData.GetSingleImage();
		Mask2DPtr mask =
			Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
		Plot2DPointSet &totalSet = plot.StartLine("Total");
		RFIPlots::MakeDistPlot(totalSet, image, mask);

		Plot2DPointSet &uncontaminatedSet = plot.StartLine("Uncontaminated");
		mask = Mask2D::CreateCopy(activeData.GetSingleMask());
		RFIPlots::MakeDistPlot(uncontaminatedSet, image, mask);

		mask->Invert();
		Plot2DPointSet &rfiSet = plot.StartLine("RFI");
		RFIPlots::MakeDistPlot(rfiSet, image, mask);

		_plotManager->Update();
	}
}
开发者ID:pkgw,项目名称:aoflagger,代码行数:24,代码来源:rfiguicontroller.cpp

示例4: onPlotPressed

void ComplexPlanePlotWindow::onPlotPressed()
{
	if(_msWindow.HasImage())
	{
		try {
			Plot2D &plot = _plotManager.NewPlot2D("Complex plane");
			size_t x = (size_t) _xPositionScale.get_value();
			size_t y = (size_t) _yPositionScale.get_value();
			size_t length = (size_t) _lengthScale.get_value();
			size_t avgSize = (size_t) _ySumLengthScale.get_value();
			bool realVersusImaginary = _realVersusImaginaryButton.get_active();
			const TimeFrequencyData &data = _msWindow.GetActiveData();

			if(_allValuesButton.get_active())
			{
				Plot2DPointSet *pointSet;
				if(realVersusImaginary)
					pointSet = &plot.StartLine("Data", Plot2DPointSet::DrawPoints);
				else
					pointSet = &plot.StartLine("Data (real)", Plot2DPointSet::DrawPoints);
				Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(_msWindow.AltMask()->Width(), _msWindow.AltMask()->Height());
				RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, mask, realVersusImaginary, false);
	
				if(!realVersusImaginary)
				{
					pointSet = &plot.StartLine("Data (imaginary)", Plot2DPointSet::DrawPoints);
					RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, mask, realVersusImaginary, true);
				}
			}

			if(_unmaskedValuesButton.get_active())
			{
				Plot2DPointSet *pointSet = &plot.StartLine("Without RFI");
				RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, _msWindow.AltMask(), realVersusImaginary, false);
				if(!realVersusImaginary)
				{
					pointSet = &plot.StartLine("Without RFI (I)");
					RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, _msWindow.AltMask(), realVersusImaginary, true);
				}
			}
	
			if(_maskedValuesButton.get_active())
			{
				Plot2DPointSet *pointSet = &plot.StartLine("Only RFI");
				Mask2DPtr mask = Mask2D::CreateCopy(_msWindow.AltMask());
				mask->Invert();
				RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, mask, realVersusImaginary, false);
				if(!realVersusImaginary)
				{
					pointSet = &plot.StartLine("Only RFI (I)");
					RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, mask, realVersusImaginary, true);
				}
			}
	
			if(_fittedValuesButton.get_active())
			{
				Plot2DPointSet *pointSet;
				if(realVersusImaginary)
					pointSet = &plot.StartLine("Fit");
				else
					pointSet = &plot.StartLine("Fit (real)");
				size_t middleY = (2*y + avgSize) / 2;
				Baseline baseline(_msWindow.TimeFrequencyMetaData()->Antenna1(), _msWindow.TimeFrequencyMetaData()->Antenna2());
				long double fringeCount =
					UVImager::GetFringeCount(x, x+length, middleY, _msWindow.TimeFrequencyMetaData());
				long double fringeFrequency = fringeCount / length;
				Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(_msWindow.AltMask()->Width(), _msWindow.AltMask()->Height());
				RFIPlots::MakeFittedComplexPlot(*pointSet, data, x, length, y, avgSize, mask, fringeFrequency, realVersusImaginary, false);
				if(!realVersusImaginary)
				{
					pointSet = &plot.StartLine("Fit (imaginary)");
					RFIPlots::MakeFittedComplexPlot(*pointSet, data, x, length, y, avgSize, mask, fringeFrequency, realVersusImaginary, true);
				}
			}

			if(_individualSampleFitButton.get_active())
			{
				FringeStoppingFitter fitter;
				fitter.Initialize(data);
				fitter.SetFitChannelsIndividually(true);
				fitter.SetFringesToConsider(1.0L);
				fitter.SetMaxWindowSize(256);
				fitter.SetReturnFittedValue(true);
				fitter.SetReturnMeanValue(false);
				
				fitter.SetMetaData(_msWindow.TimeFrequencyMetaData());
				fitter.PerformStaticFrequencyFitOnOneChannel(y);

				Plot2DPointSet *pointSet;
				if(realVersusImaginary)
					pointSet = &plot.StartLine("Fit");
				else
					pointSet = &plot.StartLine("Fit (real)");
				Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(_msWindow.AltMask()->Width(), _msWindow.AltMask()->Height());
				RFIPlots::MakeComplexPlanePlot(*pointSet, fitter.Background(), x, length, y, avgSize, mask, realVersusImaginary, false);
	
				fitter.SetReturnFittedValue(false);
				fitter.SetReturnMeanValue(true);
				if(!realVersusImaginary)
				{
//.........这里部分代码省略.........
开发者ID:jjdmol,项目名称:LOFAR,代码行数:101,代码来源:complexplaneplotwindow.cpp


注:本文中的Mask2DPtr::Invert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。