API
 
Loading...
Searching...
No Matches
libXWCTest::modalGainOptTest::processPsdProcessorHarness Class Reference
Inheritance diagram for libXWCTest::modalGainOptTest::processPsdProcessorHarness:
Inheritance graph
Collaboration diagram for libXWCTest::modalGainOptTest::processPsdProcessorHarness:
Collaboration graph

Static Public Member Functions

static mx::error_t analyzePsd (processResults &result, const std::vector< realT > &measuredPsd, const std::vector< realT > &freq, size_t modeIndex, const processModelConfig &config, realT lpContinuumFreq=static_cast< realT >(0), realT lpContinuumWidthHz=c_defaultLpContinuumWidthHz, const std::vector< realT > *etfPsd=nullptr, const std::vector< realT > *ntfPsd=nullptr)
 Build the noise PSD, disturbance PSD, and LP continuum PSD for one mode.
 
static mx::error_t estimateNoisePsd (std::vector< realT > &noisePsd, realT &noiseFloor, const std::vector< realT > &measuredPsd, const std::vector< realT > &freq, size_t modeIndex, std::string noiseEstimateRange=c_defaultNoiseEstimateRange, std::string noiseEstimateStatistic=c_defaultNoiseEstimateStatistic, realT noiseEstimateLowFreqMaxHz=c_defaultNoiseEstimateLowFreqMaxHz)
 Estimate the flat noise PSD using the configured modalGainOpt statistic.
 
static mx::error_t applyLpContinuum (std::vector< realT > &lpProcessPsd, const std::vector< realT > &processPsd, const std::vector< realT > &freq, realT cutoffFreq, realT continuumWidthHz)
 Replace all LP content above a cutoff with a smoothed continuum.
 

Static Public Attributes

static constexpr const char * c_defaultProcessMethod = "legacy"
 The default process-method name.
 
static constexpr realT c_defaultPowerLawIndex = static_cast<realT>( 8.0 / 3.0 )
 The default 1/f^a exponent.
 
static constexpr realT c_defaultPowerLawNormFreq = static_cast<realT>( 0 )
 The default auto-selected power-law normalization frequency.
 
static constexpr realT c_defaultPowerLawMatchFreq = static_cast<realT>( 0 )
 The default disabled explicit power-law match frequency.
 
static constexpr const char * c_defaultNoiseEstimateDomain = "open-loop"
 The default domain used for noise-floor estimation.
 
static constexpr const char * c_defaultNoiseEstimateRange = "high-freq"
 The default end of the PSD used for noise-floor estimation.
 
static constexpr realT c_defaultNoiseEstimateLowFreqMaxHz = static_cast<realT>( 0 )
 The default disabled maximum frequency for low-frequency noise estimation.
 
static constexpr const char * c_defaultNoiseEstimateStatistic = "percentile"
 The default statistic used to estimate the flat noise floor.
 
static constexpr const char * c_defaultClosedLoopOlEstimateMethod = "etf-only"
 The default closed-loop to open-loop PSD reconstruction method.
 
static constexpr realT c_defaultPowerLawMatchFallbackWindowHz = static_cast<realT>( 5 )
 The default half-width of the local match-frequency fallback window.
 
static constexpr const char * c_defaultPowerLawCrossoverMode = "manual"
 The default crossover-selection mode for the power-law handoff.
 
static constexpr realT c_defaultPowerLawAutoSmoothWidthHz = static_cast<realT>( 50 )
 The default median-smoothing width used by the automatic crossover finder.
 
static constexpr realT c_defaultPowerLawAutoMaxFreqFraction = static_cast<realT>( 0.4 )
 
static constexpr bool c_defaultFitPowerLawIndex = false
 The default choice to keep the power-law exponent fixed.
 
static constexpr bool c_defaultPowerLawFitIncludesMatchPoint = true
 The default choice to include the match point in the exponent fit.
 
static constexpr realT c_defaultPowerLawFitMinFreqHz = static_cast<realT>( 100 )
 The default low edge of the power-law exponent fit range.
 
static constexpr realT c_defaultPowerLawFitMaxFreqHz = static_cast<realT>( 1000 )
 The default high edge of the power-law exponent fit range.
 
static constexpr realT c_defaultPowerLawFitBinWidthHz = static_cast<realT>( 100 )
 The default width of each exponent-fit median bin.
 
static constexpr int c_defaultPowerLawBlendBins = 5
 
static constexpr realT c_defaultPeakDetectWidthHz = static_cast<realT>( 50 )
 The default wide smoothing width used by peak detection.
 
static constexpr realT c_defaultPeakDetectFactor = static_cast<realT>( 5 )
 The default strong-peak detection factor.
 
static constexpr realT c_defaultPeakDetectBroadFactor = static_cast<realT>( 3 )
 The default broad-peak detection factor.
 
static constexpr realT c_defaultPeakDetectMinWidthLog = static_cast<realT>( 0.02 )
 The default minimum accepted broad-peak width in dex.
 
static constexpr realT c_defaultPeakMoffatBeta = static_cast<realT>( 6 )
 The default lower bound on the Moffat beta parameter.
 
static constexpr int c_defaultPeakDetectPasses = 2
 The default number of subtract-and-redetect peak passes.
 
static constexpr realT c_defaultDropoutGapFactor = static_cast<realT>( 0.2 )
 The default dropout-detection threshold factor.
 
static constexpr realT c_defaultDropoutTinyFactor = static_cast<realT>( 1e-6 )
 
static constexpr size_t c_defaultDropoutMaxBins = 4
 The default maximum repaired dropout-run length in bins.
 
static constexpr realT c_defaultClSignificanceThreshold = static_cast<realT>( 1.1 )
 The default raw-CL significance threshold multiplier.
 
static constexpr realT c_defaultClMinSignificantFraction = static_cast<realT>( 0.05 )
 
static constexpr realT c_defaultLpContinuumWidthHz = static_cast<realT>( 25 )
 The default LP-continuum smoothing width.
 
static constexpr realT c_defaultPowerLawOnlyAboveFreq = static_cast<realT>( 0 )
 

Static Protected Member Functions

static size_t firstPositiveFreqIndex (const std::vector< realT > &freq)
 Return the index of the first strictly-positive frequency bin.
 
static std::string normalizeNoiseEstimateDomain (std::string domain)
 Normalize a noise-estimation-domain name to lowercase hyphenated form.
 
static std::string normalizeNoiseEstimateRange (std::string range)
 Normalize a noise-estimation-range name to lowercase hyphenated form.
 
static std::string normalizeNoiseEstimateStatistic (std::string statistic)
 Normalize a noise-estimation-statistic name to lowercase hyphenated form.
 
static std::string normalizeClosedLoopOlEstimateMethod (std::string method)
 
static std::string normalizePowerLawCrossoverMode (std::string mode)
 Normalize a power-law crossover mode name to lowercase hyphenated form.
 
static realT resolvePowerLawNormFreq (const std::vector< realT > &freq, realT requestedNormFreq)
 
static mx::error_t buildSmoothedProcessPsd (std::vector< realT > &smoothedProcessPsd, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &freq, realT smoothWidthHz)
 
static mx::error_t findAutoPowerLawCrossoverFreq (realT &crossoverFreq, const std::vector< realT > &smoothedProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, realT maxFreqFraction)
 
static mx::error_t resolvePowerLawCrossoverFrequencies (realT &powerLawMatchFreq, realT &powerLawOnlyAboveFreq, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &smoothedProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, std::string powerLawCrossoverMode, realT powerLawAutoMaxFreqFraction)
 
static realT powerLawContinuum (realT extrapolation, const std::vector< realT > &freq, size_t index, realT powerLawIndex, realT powerLawNormFreq)
 Evaluate the extrapolated power-law continuum at one frequency bin.
 
static realT interpolatePsdAtFreq (const std::vector< realT > &psd, const std::vector< realT > &freq, realT targetFreq)
 Linearly interpolate a sampled PSD onto an arbitrary frequency.
 
static mx::error_t matchPowerLawAtFreq (realT &extrapolation, const std::vector< realT > &anchorProcessPsd, const std::vector< realT > &freq, realT powerLawIndex, realT powerLawNormFreq, realT powerLawMatchFreq, realT powerLawMatchFallbackWindowHz)
 
static realT moffatAlphaFromFwhm (realT fwhm, realT beta)
 Invert the Moffat FWHM relation to recover the alpha parameter.
 
static realT moffatValueFromFwhm (realT radius, realT peakHeight, realT fwhm, realT beta)
 Evaluate a zero-background Moffat profile from its height, FWHM, and beta.
 
static realT fitMoffatBetaToBoundary (realT peakHeight, realT fwhm, realT radius, realT target, realT betaFloor)
 
static realT interpolateCrossing (realT x0, realT y0, realT x1, realT y1, realT target)
 
static mx::error_t fitPowerLawIndexFromBinnedMedians (realT &powerLawIndex, size_t &nBinsUsed, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &freq, realT fitMinFreqHz, realT fitMaxFreqHz, realT fitBinWidthHz, realT includeMatchFreqHz=static_cast< realT >(0))
 
static mx::error_t estimatePowerLawContinuum (std::vector< realT > &continuumPsd, realT &extrapolation, size_t &anchorIndex, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &anchorProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, realT powerLawIndex, realT powerLawNormFreq, realT powerLawMatchFreq, realT powerLawMatchFallbackWindowHz, bool fitPowerLawIndex=false, realT powerLawFitMinFreqHz=c_defaultPowerLawFitMinFreqHz, realT powerLawFitMaxFreqHz=c_defaultPowerLawFitMaxFreqHz, realT powerLawFitBinWidthHz=c_defaultPowerLawFitBinWidthHz, bool powerLawFitIncludesMatchPoint=c_defaultPowerLawFitIncludesMatchPoint, realT *usedPowerLawIndex=nullptr, size_t *fitBinsUsed=nullptr)
 
static mx::error_t buildPowerLawContinuum (std::vector< realT > &continuumPsd, realT extrapolation, const std::vector< realT > &freq, realT powerLawIndex, realT powerLawNormFreq)
 Populate a sampled power-law continuum from a resolved normalization.
 
static mx::error_t blendContinuumAtAnchor (std::vector< realT > &processPsd, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &continuumPsd, size_t anchorIndex, int blendBins)
 
static mx::error_t identifyMoffatPeaks (std::vector< identifiedPeak1D > &peaks, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &continuumPsd, const std::vector< realT > &freq, realT peakDetectWidthHz, realT peakDetectFactor, realT peakDetectBroadFactor, realT peakDetectMinWidthLog)
 
static mx::error_t addClippedMoffatPeakExcess (std::vector< realT > &peakModel, const identifiedPeak1D &peak, const std::vector< realT > &sourcePsd, const std::vector< realT > &continuumPsd, const std::vector< realT > &freq, realT peakMoffatBeta)
 Add one clipped Moffat peak excess to a PSD model.
 
static mx::error_t identifyMoffatPeaksMultiPass (std::vector< identifiedPeak1D > &peaks, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &continuumPsd, const std::vector< realT > &freq, realT peakDetectWidthHz, realT peakDetectFactor, realT peakDetectBroadFactor, realT peakDetectMinWidthLog, int peakDetectPasses, realT peakMoffatBeta)
 
static mx::error_t buildMoffatProcessFromContinuum (std::vector< realT > &processPsd, std::vector< identifiedPeak1D > &peaks, std::vector< unsigned char > &repairMask, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &continuumPsd, const std::vector< realT > &freq, size_t anchorIndex, const processModelConfig &config)
 Build the full Moffat-peak disturbance model from a fixed continuum.
 
static mx::error_t buildPowerLawOnlyProcessFromContinuum (std::vector< realT > &processPsd, std::vector< unsigned char > &repairMask, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &continuumPsd, const std::vector< realT > &freq, size_t anchorIndex, const processModelConfig &config)
 Build the power-law-only disturbance model from a fixed continuum.
 
static mx::error_t estimateProcessPsdPowerLawOnly (std::vector< realT > &processPsd, realT &extrapolation, size_t &anchorIndex, std::vector< unsigned char > &repairMask, const std::vector< realT > &measuredPsd, const std::vector< realT > &anchorProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, const processModelConfig &config, realT *usedPowerLawIndex=nullptr, size_t *fitBinsUsed=nullptr)
 Build a disturbance PSD from only the extrapolated 1/f^a continuum.
 
static mx::error_t estimateProcessPsdMoffatPeaks (std::vector< realT > &processPsd, realT &extrapolation, std::vector< identifiedPeak1D > &peaks, std::vector< unsigned char > &repairMask, const std::vector< realT > &measuredPsd, const std::vector< realT > &anchorProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, const processModelConfig &config)
 
static mx::error_t estimateProcessPsd (std::vector< realT > &processPsd, realT &extrapolation, const std::vector< realT > &measuredPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, realT powerLawNormFreq, realT powerLawMatchFreq, realT powerLawMatchFallbackWindowHz)
 
static mx::error_t fillProcessPsdDropouts (std::vector< realT > &processPsd, const std::vector< realT > &freq, const std::vector< unsigned char > &repairMask, realT gapFactor, realT tinyFactor, size_t maxGapBins, realT powerLawIndex)
 Fill isolated or short dropout runs in a disturbance PSD.
 

Detailed Description

Definition at line 29 of file modalGainOpt_test.cpp.

Member Function Documentation

◆ addClippedMoffatPeakExcess()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::addClippedMoffatPeakExcess ( std::vector< realT > &  peakModel,
const identifiedPeak1D peak,
const std::vector< realT > &  sourcePsd,
const std::vector< realT > &  continuumPsd,
const std::vector< realT > &  freq,
realT  peakMoffatBeta 
)
staticprotectedinherited

Add one clipped Moffat peak excess to a PSD model.

Parameters
peakModel[in.out] the accumulated peak model
[in]peakthe detected peak
[in]sourcePsdthe source PSD used to bound the peak
[in]continuumPsdthe continuum PSD
[in]freqthe one-sided frequency grid
[in]peakMoffatBetathe minimum Moffat beta

Definition at line 2417 of file modalPsdProcessor.hpp.

References MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_centerFreq, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_end, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_fwhm, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_peakHeight, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_peakIndex, and MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_start.

◆ analyzePsd()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::analyzePsd ( processResults result,
const std::vector< realT > &  measuredPsd,
const std::vector< realT > &  freq,
size_t  modeIndex,
const processModelConfig config,
realT  lpContinuumFreq = static_cast<realT>( 0 ),
realT  lpContinuumWidthHz = c_defaultLpContinuumWidthHz,
const std::vector< realT > *  etfPsd = nullptr,
const std::vector< realT > *  ntfPsd = nullptr 
)
staticinherited

Build the noise PSD, disturbance PSD, and LP continuum PSD for one mode.

Parameters
[out]resultthe populated process-model results
[in]measuredPsdthe measured one-sided PSD
[in]freqthe one-sided frequency grid
[in]modeIndexthe zero-based mode index
[in]configthe disturbance-PSD configuration
[in]lpContinuumFreqthe LP continuum cutoff
[in]lpContinuumWidthHzLP smoothing width
[in]etfPsdoptional CL ETF^2 correction
[in]ntfPsdoptional CL NTF^2 correction

Definition at line 739 of file modalPsdProcessor.hpp.

References MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_closedLoopOlEstimateMethod, MagAOX::app::modalPsdProcessor< realT >::processResults::m_closedLoopOlEstimateMethod, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_dropoutGapFactor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_dropoutGapFactor, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_dropoutMaxBins, MagAOX::app::modalPsdProcessor< realT >::processResults::m_dropoutMaxBins, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_dropoutTinyFactor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_dropoutTinyFactor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_extrapolation, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_fitPowerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processResults::m_fitPowerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processResults::m_lpContinuumFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_lpContinuumWidthHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_lpProcessPsd, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_method, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_noiseEstimateDomain, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noiseEstimateDomain, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_noiseEstimateLowFreqMaxHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noiseEstimateLowFreqMaxHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_noiseEstimateRange, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noiseEstimateRange, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_noiseEstimateStatistic, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noiseEstimateStatistic, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noiseFloor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noisePsd, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectBroadFactor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakDetectBroadFactor, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectFactor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakDetectFactor, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectMinWidthLog, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakDetectMinWidthLog, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectPasses, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakDetectPasses, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectWidthHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakDetectWidthHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakMoffatBeta, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakMoffatBeta, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peaks, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawAnchorFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawAnchorIndex, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawAutoMaxFreqFraction, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawAutoMaxFreqFraction, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawAutoSmoothWidthHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawAutoSmoothWidthHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawBlendBins, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawBlendBins, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawCrossoverMode, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawCrossoverMode, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawFitBinsUsed, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitBinWidthHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawFitBinWidthHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitIncludesMatchPoint, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawFitIncludesMatchPoint, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitMaxFreqHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawFitMaxFreqHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitMinFreqHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawFitMinFreqHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawIndexFitSucceeded, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFallbackWindowHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawMatchFallbackWindowHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawMatchFreq, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawNormFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawNormFreq, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawOnlyAboveFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawOnlyAboveFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_processMethod, MagAOX::app::modalPsdProcessor< realT >::processResults::m_processPsd, MagAOX::app::modalPsdProcessor< realT >::processResults::m_rawProcessPsd, and MagAOX::app::modalPsdProcessor< realT >::processResults::m_smoothedProcessPsd.

Referenced by MagAOX::app::modalGainOpt::goptThreadExec(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), and libXWCTest::modalGainOptTest::TEST_CASE().

◆ applyLpContinuum()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::applyLpContinuum ( std::vector< realT > &  lpProcessPsd,
const std::vector< realT > &  processPsd,
const std::vector< realT > &  freq,
realT  cutoffFreq,
realT  continuumWidthHz 
)
staticinherited

Replace all LP content above a cutoff with a smoothed continuum.

Parameters
[out]lpProcessPsdthe LP disturbance PSD
[in]processPsdthe nominal disturbance PSD
[in]freqthe one-sided frequency grid
[in]cutoffFreqthe continuum cutoff frequency
[in]continuumWidthHzthe smoothing width

Definition at line 3327 of file modalPsdProcessor.hpp.

◆ blendContinuumAtAnchor()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::blendContinuumAtAnchor ( std::vector< realT > &  processPsd,
const std::vector< realT > &  rawProcessPsd,
const std::vector< realT > &  continuumPsd,
size_t  anchorIndex,
int  blendBins 
)
staticprotectedinherited

Blend from a continuum model to the measured disturbance PSD at the anchor point.

Parameters
[out]processPsdthe blended disturbance PSD
[in]rawProcessPsdmeasured disturbance PSD
[in]continuumPsdextrapolated continuum PSD
[in]anchorIndexthe last bin where the continuum anchors
[in]blendBinsthe number of handoff bins

Definition at line 2175 of file modalPsdProcessor.hpp.

◆ buildMoffatProcessFromContinuum()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::buildMoffatProcessFromContinuum ( std::vector< realT > &  processPsd,
std::vector< identifiedPeak1D > &  peaks,
std::vector< unsigned char > &  repairMask,
const std::vector< realT > &  rawProcessPsd,
const std::vector< realT > &  noisePsd,
const std::vector< realT > &  continuumPsd,
const std::vector< realT > &  freq,
size_t  anchorIndex,
const processModelConfig config 
)
staticprotectedinherited

Build the full Moffat-peak disturbance model from a fixed continuum.

Parameters
[out]processPsdthe disturbance PSD
[out]peaksdetected peaks
[out]repairMaskrepair-eligible bins
[in]rawProcessPsdraw disturbance PSD
[in]noisePsdthe flat noise PSD
[in]continuumPsdthe continuum PSD
[in]freqthe one-sided frequency grid
[in]anchorIndexthe continuum handoff bin
[in]configthe process configuration

Definition at line 2595 of file modalPsdProcessor.hpp.

References MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectBroadFactor, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectFactor, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectMinWidthLog, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectPasses, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectWidthHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakMoffatBeta, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawBlendBins, and MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawOnlyAboveFreq.

◆ buildPowerLawContinuum()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::buildPowerLawContinuum ( std::vector< realT > &  continuumPsd,
realT  extrapolation,
const std::vector< realT > &  freq,
realT  powerLawIndex,
realT  powerLawNormFreq 
)
staticprotectedinherited

Populate a sampled power-law continuum from a resolved normalization.

Parameters
[out]continuumPsdthe sampled continuum PSD
[in]extrapolationthe continuum normalization
[in]freqthe one-sided frequency grid
[in]powerLawIndexthe power-law exponent
[in]powerLawNormFreqthe normalization frequency

Definition at line 2156 of file modalPsdProcessor.hpp.

◆ buildPowerLawOnlyProcessFromContinuum()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::buildPowerLawOnlyProcessFromContinuum ( std::vector< realT > &  processPsd,
std::vector< unsigned char > &  repairMask,
const std::vector< realT > &  rawProcessPsd,
const std::vector< realT > &  noisePsd,
const std::vector< realT > &  continuumPsd,
const std::vector< realT > &  freq,
size_t  anchorIndex,
const processModelConfig config 
)
staticprotectedinherited

Build the power-law-only disturbance model from a fixed continuum.

Parameters
[out]processPsdthe disturbance PSD
[out]repairMaskrepair-eligible bins
[in]rawProcessPsdraw disturbance PSD
[in]noisePsdthe flat noise PSD
[in]continuumPsdthe continuum PSD
[in]freqthe one-sided frequency grid
[in]anchorIndexthe continuum handoff bin
[in]configthe process configuration

Definition at line 2721 of file modalPsdProcessor.hpp.

References MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawBlendBins, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawCrossoverMode, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFreq, and MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawOnlyAboveFreq.

◆ buildSmoothedProcessPsd()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::buildSmoothedProcessPsd ( std::vector< realT > &  smoothedProcessPsd,
const std::vector< realT > &  rawProcessPsd,
const std::vector< realT > &  freq,
realT  smoothWidthHz 
)
staticprotectedinherited

Median-smooth a disturbance PSD in log space while preserving the original sampling.

Parameters
[out]smoothedProcessPsdthe smoothed disturbance PSD
[in]rawProcessPsdthe raw disturbance PSD
[in]freqthe one-sided frequency grid
[in]smoothWidthHzthe median-smoothing width in Hz

Definition at line 1461 of file modalPsdProcessor.hpp.

◆ estimateNoisePsd()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::estimateNoisePsd ( std::vector< realT > &  noisePsd,
realT &  noiseFloor,
const std::vector< realT > &  measuredPsd,
const std::vector< realT > &  freq,
size_t  modeIndex,
std::string  noiseEstimateRange = c_defaultNoiseEstimateRange,
std::string  noiseEstimateStatistic = c_defaultNoiseEstimateStatistic,
realT  noiseEstimateLowFreqMaxHz = c_defaultNoiseEstimateLowFreqMaxHz 
)
staticinherited

Estimate the flat noise PSD using the configured modalGainOpt statistic.

Parameters
[out]noisePsdthe flat noise PSD estimate
[out]noiseFloorthe fitted noise floor
[in]measuredPsdthe measured one-sided PSD
[in]freqthe one-sided frequency grid
[in]modeIndexthe zero-based mode index
[in]noiseEstimateRangewhich PSD end to use
[in]noiseEstimateStatistichow to summarize the selected bins
[in]noiseEstimateLowFreqMaxHzoptional low-frequency upper limit

Definition at line 1259 of file modalPsdProcessor.hpp.

Referenced by MagAOX::app::modalGainOpt::goptThreadExec(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), and libXWCTest::modalGainOptTest::TEST_CASE().

◆ estimatePowerLawContinuum()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::estimatePowerLawContinuum ( std::vector< realT > &  continuumPsd,
realT &  extrapolation,
size_t &  anchorIndex,
const std::vector< realT > &  rawProcessPsd,
const std::vector< realT > &  anchorProcessPsd,
const std::vector< realT > &  noisePsd,
const std::vector< realT > &  freq,
realT  powerLawIndex,
realT  powerLawNormFreq,
realT  powerLawMatchFreq,
realT  powerLawMatchFallbackWindowHz,
bool  fitPowerLawIndex = false,
realT  powerLawFitMinFreqHz = c_defaultPowerLawFitMinFreqHz,
realT  powerLawFitMaxFreqHz = c_defaultPowerLawFitMaxFreqHz,
realT  powerLawFitBinWidthHz = c_defaultPowerLawFitBinWidthHz,
bool  powerLawFitIncludesMatchPoint = c_defaultPowerLawFitIncludesMatchPoint,
realT *  usedPowerLawIndex = nullptr,
size_t *  fitBinsUsed = nullptr 
)
staticprotectedinherited

Estimate the 1/f^a continuum used by the power-law and Moffat extrapolators.

Parameters
[out]continuumPsdthe continuum PSD
[out]extrapolationthe continuum normalization
[out]anchorIndexthe last bin used to anchor the fit
[in]rawProcessPsdraw disturbance PSD
[in]anchorProcessPsdsmoothed disturbance PSD used for anchoring
[in]noisePsdthe flat noise PSD
[in]freqthe one-sided frequency grid
[in]powerLawIndexthe power-law exponent
[in]powerLawNormFreqthe normalization frequency
[in]powerLawMatchFreqthe optional match frequency
[in]powerLawMatchFallbackWindowHzthe match fallback half-width
[in]fitPowerLawIndexwhether to fit the exponent
[in]powerLawFitMinFreqHzfit low edge
[in]powerLawFitMaxFreqHzfit high edge
[in]powerLawFitBinWidthHzfit bin width
[in]powerLawFitIncludesMatchPointinclude match point
[out]usedPowerLawIndexthe exponent actually used
[out]fitBinsUsedthe number of populated fit bins

Definition at line 2030 of file modalPsdProcessor.hpp.

Referenced by libXWCTest::modalGainOptTest::TEST_CASE().

◆ estimateProcessPsd()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::estimateProcessPsd ( std::vector< realT > &  processPsd,
realT &  extrapolation,
const std::vector< realT > &  measuredPsd,
const std::vector< realT > &  noisePsd,
const std::vector< realT > &  freq,
realT  powerLawNormFreq,
realT  powerLawMatchFreq,
realT  powerLawMatchFallbackWindowHz 
)
staticprotectedinherited

Build the disturbance PSD used for optimization from the measured PSD and the flat noise estimate.

Parameters
[out]processPsdthe disturbance PSD
[out]extrapolationthe low-frequency extrapolation anchor
[in]measuredPsdthe measured one-sided PSD
[in]noisePsdthe flat noise PSD estimate
[in]freqthe one-sided frequency grid
[in]powerLawNormFreqthe power-law normalization frequency
[in]powerLawMatchFreqthe optional power-law match frequency
[in]powerLawMatchFallbackWindowHzthe local match fallback half-width

Definition at line 2946 of file modalPsdProcessor.hpp.

◆ estimateProcessPsdMoffatPeaks()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::estimateProcessPsdMoffatPeaks ( std::vector< realT > &  processPsd,
realT &  extrapolation,
std::vector< identifiedPeak1D > &  peaks,
std::vector< unsigned char > &  repairMask,
const std::vector< realT > &  measuredPsd,
const std::vector< realT > &  anchorProcessPsd,
const std::vector< realT > &  noisePsd,
const std::vector< realT > &  freq,
const processModelConfig config 
)
staticprotectedinherited

◆ estimateProcessPsdPowerLawOnly()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::estimateProcessPsdPowerLawOnly ( std::vector< realT > &  processPsd,
realT &  extrapolation,
size_t &  anchorIndex,
std::vector< unsigned char > &  repairMask,
const std::vector< realT > &  measuredPsd,
const std::vector< realT > &  anchorProcessPsd,
const std::vector< realT > &  noisePsd,
const std::vector< realT > &  freq,
const processModelConfig config,
realT *  usedPowerLawIndex = nullptr,
size_t *  fitBinsUsed = nullptr 
)
staticprotectedinherited

Build a disturbance PSD from only the extrapolated 1/f^a continuum.

Parameters
[out]processPsdthe disturbance PSD
[out]extrapolationthe power-law continuum anchor
[out]anchorIndexthe last frequency bin used to anchor the fit
[out]repairMaskbins eligible for repair
[in]measuredPsdthe measured one-sided PSD
[in]anchorProcessPsdthe smoothed disturbance PSD used for anchoring
[in]noisePsdthe flat noise PSD
[in]freqthe one-sided frequency grid
[in]configthe disturbance-PSD configuration
[out]usedPowerLawIndexthe exponent actually used
[out]fitBinsUsedthe number of populated fit bins

Definition at line 2787 of file modalPsdProcessor.hpp.

References MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_fitPowerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawCrossoverMode, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitBinWidthHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitIncludesMatchPoint, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitMaxFreqHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitMinFreqHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFallbackWindowHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFreq, and MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawNormFreq.

Referenced by libXWCTest::modalGainOptTest::TEST_CASE().

◆ fillProcessPsdDropouts()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::fillProcessPsdDropouts ( std::vector< realT > &  processPsd,
const std::vector< realT > &  freq,
const std::vector< unsigned char > &  repairMask,
realT  gapFactor,
realT  tinyFactor,
size_t  maxGapBins,
realT  powerLawIndex 
)
staticprotectedinherited

Fill isolated or short dropout runs in a disturbance PSD.

Parameters
processPsd[in.out] the disturbance PSD
[in]freqthe one-sided frequency grid
[in]repairMaskrepair-eligible bins
[in]gapFactorthe threshold used to identify dropout bins
[in]tinyFactorthe factor below the local good-bin scale required for a true dropout
[in]maxGapBinsthe maximum repaired gap length
[in]powerLawIndexthe power-law exponent used to continue a trailing gap

Definition at line 3059 of file modalPsdProcessor.hpp.

Referenced by libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), and libXWCTest::modalGainOptTest::TEST_CASE().

◆ findAutoPowerLawCrossoverFreq()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::findAutoPowerLawCrossoverFreq ( realT &  crossoverFreq,
const std::vector< realT > &  smoothedProcessPsd,
const std::vector< realT > &  noisePsd,
const std::vector< realT > &  freq,
realT  maxFreqFraction 
)
staticprotectedinherited

Determine the automatic power-law crossover from a median-smoothed disturbance PSD.

Parameters
[out]crossoverFreqthe resolved crossover frequency
[in]smoothedProcessPsdthe smoothed disturbance PSD
[in]noisePsdthe flat noise PSD
[in]freqthe one-sided frequency grid
[in]maxFreqFractionthe maximum searched frequency as a fraction of the sampled maximum

Definition at line 1530 of file modalPsdProcessor.hpp.

Referenced by libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), and libXWCTest::modalGainOptTest::TEST_CASE().

◆ firstPositiveFreqIndex()

template<typename realT >
size_t MagAOX::app::modalPsdProcessor< realT >::firstPositiveFreqIndex ( const std::vector< realT > &  freq)
staticprotectedinherited

Return the index of the first strictly-positive frequency bin.

Parameters
[in]freqthe one-sided frequency grid

Definition at line 1447 of file modalPsdProcessor.hpp.

◆ fitMoffatBetaToBoundary()

template<typename realT >
realT MagAOX::app::modalPsdProcessor< realT >::fitMoffatBetaToBoundary ( realT  peakHeight,
realT  fwhm,
realT  radius,
realT  target,
realT  betaFloor 
)
staticprotectedinherited

Find the smallest beta that drives a Moffat wing down to a target level at a target radius.

Parameters
[in]peakHeightthe peak height above the continuum
[in]fwhmthe full-width at half maximum
[in]radiusthe target boundary radius
[in]targetthe desired level at that boundary
[in]betaFloorthe minimum allowed beta

Definition at line 1828 of file modalPsdProcessor.hpp.

References MagAOX::app::target.

◆ fitPowerLawIndexFromBinnedMedians()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::fitPowerLawIndexFromBinnedMedians ( realT &  powerLawIndex,
size_t &  nBinsUsed,
const std::vector< realT > &  rawProcessPsd,
const std::vector< realT > &  freq,
realT  fitMinFreqHz,
realT  fitMaxFreqHz,
realT  fitBinWidthHz,
realT  includeMatchFreqHz = static_cast<realT>( 0 ) 
)
staticprotectedinherited

Fit the power-law exponent from binned median log PSD values over a selected frequency range.

Parameters
[out]powerLawIndexthe fitted exponent
[out]nBinsUsedthe number of populated bins
[in]rawProcessPsddisturbance PSD
[in]freqthe one-sided frequency grid
[in]fitMinFreqHzthe low edge of the fit range
[in]fitMaxFreqHzthe high edge of the fit range
[in]fitBinWidthHzthe width of the median bins
[in]includeMatchFreqHzoptional explicit match point

Definition at line 1892 of file modalPsdProcessor.hpp.

◆ identifyMoffatPeaks()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::identifyMoffatPeaks ( std::vector< identifiedPeak1D > &  peaks,
const std::vector< realT > &  rawProcessPsd,
const std::vector< realT > &  continuumPsd,
const std::vector< realT > &  freq,
realT  peakDetectWidthHz,
realT  peakDetectFactor,
realT  peakDetectBroadFactor,
realT  peakDetectMinWidthLog 
)
staticprotectedinherited

Identify peaks using strong-threshold or broad-but-wide discriminants above a smoothed PSD.

Parameters
[out]peaksthe detected peaks
[in]rawProcessPsdthe raw disturbance PSD
[in]continuumPsdthe continuum PSD model
[in]freqthe one-sided frequency grid
[in]peakDetectWidthHzthe wide smoothing width
[in]peakDetectFactorthe factor above smooth for strong peaks
[in]peakDetectBroadFactorthe lower factor for broad candidates
[in]peakDetectMinWidthLogthe minimum accepted broad-peak width

Definition at line 2226 of file modalPsdProcessor.hpp.

References MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_centerFreq, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_end, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_fwhm, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_peakHeight, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_peakIndex, and MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_start.

◆ identifyMoffatPeaksMultiPass()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::identifyMoffatPeaksMultiPass ( std::vector< identifiedPeak1D > &  peaks,
const std::vector< realT > &  rawProcessPsd,
const std::vector< realT > &  continuumPsd,
const std::vector< realT > &  freq,
realT  peakDetectWidthHz,
realT  peakDetectFactor,
realT  peakDetectBroadFactor,
realT  peakDetectMinWidthLog,
int  peakDetectPasses,
realT  peakMoffatBeta 
)
staticprotectedinherited

Identify peaks iteratively, subtracting each pass's modeled peaks from the residual.

Parameters
[out]peaksthe detected peaks
[in]rawProcessPsdthe raw disturbance PSD
[in]continuumPsdthe continuum PSD model
[in]freqthe one-sided frequency grid
[in]peakDetectWidthHzthe wide smoothing width
[in]peakDetectFactorthe factor above smooth
[in]peakDetectBroadFactorthe broad-peak factor
[in]peakDetectMinWidthLogthe minimum log-width
[in]peakDetectPassesthe number of iterative passes
[in]peakMoffatBetathe minimum Moffat beta

Definition at line 2500 of file modalPsdProcessor.hpp.

References a(), and b().

◆ interpolateCrossing()

template<typename realT >
realT MagAOX::app::modalPsdProcessor< realT >::interpolateCrossing ( realT  x0,
realT  y0,
realT  x1,
realT  y1,
realT  target 
)
staticprotectedinherited

Linearly interpolate the x-position where a profile crosses a target level.

Parameters
[in]x0the first x-coordinate
[in]y0the first y-coordinate
[in]x1the second x-coordinate
[in]y1the second y-coordinate
[in]targetthe y-level to interpolate

Definition at line 1871 of file modalPsdProcessor.hpp.

References MagAOX::app::target.

◆ interpolatePsdAtFreq()

template<typename realT >
realT MagAOX::app::modalPsdProcessor< realT >::interpolatePsdAtFreq ( const std::vector< realT > &  psd,
const std::vector< realT > &  freq,
realT  targetFreq 
)
staticprotectedinherited

Linearly interpolate a sampled PSD onto an arbitrary frequency.

Parameters
[in]psdthe sampled PSD values
[in]freqthe sampled frequencies
[in]targetFreqthe desired interpolation frequency

Definition at line 1697 of file modalPsdProcessor.hpp.

◆ matchPowerLawAtFreq()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::matchPowerLawAtFreq ( realT &  extrapolation,
const std::vector< realT > &  anchorProcessPsd,
const std::vector< realT > &  freq,
realT  powerLawIndex,
realT  powerLawNormFreq,
realT  powerLawMatchFreq,
realT  powerLawMatchFallbackWindowHz 
)
staticprotectedinherited

Force the power-law normalization so the model matches the disturbance PSD at a chosen frequency.

Parameters
extrapolation[in.out] the continuum normalization
[in]anchorProcessPsdthe PSD used for continuum anchoring
[in]freqthe one-sided frequency grid
[in]powerLawIndexthe power-law exponent
[in]powerLawNormFreqthe continuum normalization frequency
[in]powerLawMatchFreqthe desired match frequency
[in]powerLawMatchFallbackWindowHzthe local fallback half-width

Definition at line 1734 of file modalPsdProcessor.hpp.

◆ moffatAlphaFromFwhm()

template<typename realT >
realT MagAOX::app::modalPsdProcessor< realT >::moffatAlphaFromFwhm ( realT  fwhm,
realT  beta 
)
staticprotectedinherited

Invert the Moffat FWHM relation to recover the alpha parameter.

Parameters
[in]fwhmthe desired full-width at half-maximum
[in]betathe Moffat beta parameter

Definition at line 1809 of file modalPsdProcessor.hpp.

◆ moffatValueFromFwhm()

template<typename realT >
realT MagAOX::app::modalPsdProcessor< realT >::moffatValueFromFwhm ( realT  radius,
realT  peakHeight,
realT  fwhm,
realT  beta 
)
staticprotectedinherited

Evaluate a zero-background Moffat profile from its height, FWHM, and beta.

Parameters
[in]radiusthe distance from the peak center
[in]peakHeightthe peak height above the continuum
[in]fwhmthe full-width at half maximum
[in]betathe Moffat beta parameter

Definition at line 1816 of file modalPsdProcessor.hpp.

◆ normalizeClosedLoopOlEstimateMethod()

template<typename realT >
std::string MagAOX::app::modalPsdProcessor< realT >::normalizeClosedLoopOlEstimateMethod ( std::string  method)
staticprotectedinherited

Normalize a CL-to-OL PSD reconstruction method name to lowercase hyphenated form.

Parameters
[in]methodthe requested CL-to-OL method

Definition at line 1404 of file modalPsdProcessor.hpp.

◆ normalizeNoiseEstimateDomain()

template<typename realT >
std::string MagAOX::app::modalPsdProcessor< realT >::normalizeNoiseEstimateDomain ( std::string  domain)
staticprotectedinherited

Normalize a noise-estimation-domain name to lowercase hyphenated form.

Parameters
[in]domainthe requested domain name

Definition at line 1347 of file modalPsdProcessor.hpp.

◆ normalizeNoiseEstimateRange()

template<typename realT >
std::string MagAOX::app::modalPsdProcessor< realT >::normalizeNoiseEstimateRange ( std::string  range)
staticprotectedinherited

Normalize a noise-estimation-range name to lowercase hyphenated form.

Parameters
[in]rangethe requested PSD-end selector

Definition at line 1366 of file modalPsdProcessor.hpp.

◆ normalizeNoiseEstimateStatistic()

template<typename realT >
std::string MagAOX::app::modalPsdProcessor< realT >::normalizeNoiseEstimateStatistic ( std::string  statistic)
staticprotectedinherited

Normalize a noise-estimation-statistic name to lowercase hyphenated form.

Parameters
[in]statisticthe requested noise-fit statistic

Definition at line 1385 of file modalPsdProcessor.hpp.

◆ normalizePowerLawCrossoverMode()

template<typename realT >
std::string MagAOX::app::modalPsdProcessor< realT >::normalizePowerLawCrossoverMode ( std::string  mode)
staticprotectedinherited

Normalize a power-law crossover mode name to lowercase hyphenated form.

Parameters
[in]modethe requested crossover mode

Definition at line 1423 of file modalPsdProcessor.hpp.

◆ powerLawContinuum()

template<typename realT >
realT MagAOX::app::modalPsdProcessor< realT >::powerLawContinuum ( realT  extrapolation,
const std::vector< realT > &  freq,
size_t  index,
realT  powerLawIndex,
realT  powerLawNormFreq 
)
staticprotectedinherited

Evaluate the extrapolated power-law continuum at one frequency bin.

Parameters
[in]extrapolationthe continuum normalization
[in]freqthe one-sided frequency grid
[in]indexthe bin index to evaluate
[in]powerLawIndexthe power-law exponent
[in]powerLawNormFreqthe continuum normalization frequency

Definition at line 1687 of file modalPsdProcessor.hpp.

◆ resolvePowerLawCrossoverFrequencies()

template<typename realT >
mx::error_t MagAOX::app::modalPsdProcessor< realT >::resolvePowerLawCrossoverFrequencies ( realT &  powerLawMatchFreq,
realT &  powerLawOnlyAboveFreq,
const std::vector< realT > &  rawProcessPsd,
const std::vector< realT > &  smoothedProcessPsd,
const std::vector< realT > &  noisePsd,
const std::vector< realT > &  freq,
std::string  powerLawCrossoverMode,
realT  powerLawAutoMaxFreqFraction 
)
staticprotectedinherited

Resolve effective power-law match and cutoff frequencies for manual or automatic crossover modes.

Parameters
powerLawMatchFreq[in.out] match frequency
powerLawOnlyAboveFreq[in.out] cutoff frequency
[in]rawProcessPsdraw OL disturbance PSD
[in]smoothedProcessPsdsmoothed OL disturbance PSD
[in]noisePsdOL noise PSD
[in]freqfrequency grid
[in]powerLawCrossoverModemode
[in]powerLawAutoMaxFreqFractionthe maximum searched frequency as a fraction of the sampled maximum

Definition at line 1629 of file modalPsdProcessor.hpp.

Referenced by libXWCTest::modalGainOptTest::TEST_CASE().

◆ resolvePowerLawNormFreq()

template<typename realT >
realT MagAOX::app::modalPsdProcessor< realT >::resolvePowerLawNormFreq ( const std::vector< realT > &  freq,
realT  requestedNormFreq 
)
staticprotectedinherited

Resolve the power-law normalization frequency, defaulting to the first positive bin.

Parameters
[in]freqthe one-sided frequency grid
[in]requestedNormFreqthe requested normalization frequency

Definition at line 1670 of file modalPsdProcessor.hpp.

Member Data Documentation

◆ c_defaultClMinSignificantFraction

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultClMinSignificantFraction = static_cast<realT>( 0.05 )
staticconstexprinherited

The default minimum fraction of significant raw-CL bins required to keep processing a mode.

Definition at line 125 of file modalPsdProcessor.hpp.

◆ c_defaultClosedLoopOlEstimateMethod

template<typename realT >
constexpr const char* MagAOX::app::modalPsdProcessor< realT >::c_defaultClosedLoopOlEstimateMethod = "etf-only"
staticconstexprinherited

The default closed-loop to open-loop PSD reconstruction method.

Definition at line 58 of file modalPsdProcessor.hpp.

◆ c_defaultClSignificanceThreshold

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultClSignificanceThreshold = static_cast<realT>( 1.1 )
staticconstexprinherited

The default raw-CL significance threshold multiplier.

Definition at line 121 of file modalPsdProcessor.hpp.

◆ c_defaultDropoutGapFactor

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultDropoutGapFactor = static_cast<realT>( 0.2 )
staticconstexprinherited

The default dropout-detection threshold factor.

Definition at line 111 of file modalPsdProcessor.hpp.

◆ c_defaultDropoutMaxBins

template<typename realT >
constexpr size_t MagAOX::app::modalPsdProcessor< realT >::c_defaultDropoutMaxBins = 4
staticconstexprinherited

The default maximum repaired dropout-run length in bins.

Definition at line 118 of file modalPsdProcessor.hpp.

◆ c_defaultDropoutTinyFactor

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultDropoutTinyFactor = static_cast<realT>( 1e-6 )
staticconstexprinherited

The default factor below the local good-bin scale that a candidate run must reach to be considered a true dropout.

Definition at line 115 of file modalPsdProcessor.hpp.

◆ c_defaultFitPowerLawIndex

template<typename realT >
constexpr bool MagAOX::app::modalPsdProcessor< realT >::c_defaultFitPowerLawIndex = false
staticconstexprinherited

The default choice to keep the power-law exponent fixed.

Definition at line 74 of file modalPsdProcessor.hpp.

◆ c_defaultLpContinuumWidthHz

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultLpContinuumWidthHz = static_cast<realT>( 25 )
staticconstexprinherited

The default LP-continuum smoothing width.

Definition at line 128 of file modalPsdProcessor.hpp.

Referenced by MagAOX::app::modalGainOpt::goptThreadExec().

◆ c_defaultNoiseEstimateDomain

template<typename realT >
constexpr const char* MagAOX::app::modalPsdProcessor< realT >::c_defaultNoiseEstimateDomain = "open-loop"
staticconstexprinherited

The default domain used for noise-floor estimation.

Definition at line 46 of file modalPsdProcessor.hpp.

◆ c_defaultNoiseEstimateLowFreqMaxHz

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultNoiseEstimateLowFreqMaxHz = static_cast<realT>( 0 )
staticconstexprinherited

The default disabled maximum frequency for low-frequency noise estimation.

Definition at line 52 of file modalPsdProcessor.hpp.

◆ c_defaultNoiseEstimateRange

template<typename realT >
constexpr const char* MagAOX::app::modalPsdProcessor< realT >::c_defaultNoiseEstimateRange = "high-freq"
staticconstexprinherited

The default end of the PSD used for noise-floor estimation.

Definition at line 49 of file modalPsdProcessor.hpp.

◆ c_defaultNoiseEstimateStatistic

template<typename realT >
constexpr const char* MagAOX::app::modalPsdProcessor< realT >::c_defaultNoiseEstimateStatistic = "percentile"
staticconstexprinherited

The default statistic used to estimate the flat noise floor.

Definition at line 55 of file modalPsdProcessor.hpp.

◆ c_defaultPeakDetectBroadFactor

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPeakDetectBroadFactor = static_cast<realT>( 3 )
staticconstexprinherited

The default broad-peak detection factor.

Definition at line 99 of file modalPsdProcessor.hpp.

◆ c_defaultPeakDetectFactor

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPeakDetectFactor = static_cast<realT>( 5 )
staticconstexprinherited

The default strong-peak detection factor.

Definition at line 96 of file modalPsdProcessor.hpp.

◆ c_defaultPeakDetectMinWidthLog

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPeakDetectMinWidthLog = static_cast<realT>( 0.02 )
staticconstexprinherited

The default minimum accepted broad-peak width in dex.

Definition at line 102 of file modalPsdProcessor.hpp.

◆ c_defaultPeakDetectPasses

template<typename realT >
constexpr int MagAOX::app::modalPsdProcessor< realT >::c_defaultPeakDetectPasses = 2
staticconstexprinherited

The default number of subtract-and-redetect peak passes.

Definition at line 108 of file modalPsdProcessor.hpp.

◆ c_defaultPeakDetectWidthHz

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPeakDetectWidthHz = static_cast<realT>( 50 )
staticconstexprinherited

The default wide smoothing width used by peak detection.

Definition at line 93 of file modalPsdProcessor.hpp.

◆ c_defaultPeakMoffatBeta

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPeakMoffatBeta = static_cast<realT>( 6 )
staticconstexprinherited

The default lower bound on the Moffat beta parameter.

Definition at line 105 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawAutoMaxFreqFraction

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawAutoMaxFreqFraction = static_cast<realT>( 0.4 )
staticconstexprinherited

The default fraction of the maximum sampled frequency searched by the automatic crossover finder. Set to 0 to disable the cap.

Definition at line 71 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawAutoSmoothWidthHz

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawAutoSmoothWidthHz = static_cast<realT>( 50 )
staticconstexprinherited

The default median-smoothing width used by the automatic crossover finder.

Definition at line 67 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawBlendBins

template<typename realT >
constexpr int MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawBlendBins = 5
staticconstexprinherited

The default number of bins used to blend between the raw PSD and the extrapolated continuum.

Definition at line 90 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawCrossoverMode

template<typename realT >
constexpr const char* MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawCrossoverMode = "manual"
staticconstexprinherited

The default crossover-selection mode for the power-law handoff.

Definition at line 64 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawFitBinWidthHz

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawFitBinWidthHz = static_cast<realT>( 100 )
staticconstexprinherited

The default width of each exponent-fit median bin.

Definition at line 86 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawFitIncludesMatchPoint

template<typename realT >
constexpr bool MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawFitIncludesMatchPoint = true
staticconstexprinherited

The default choice to include the match point in the exponent fit.

Definition at line 77 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawFitMaxFreqHz

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawFitMaxFreqHz = static_cast<realT>( 1000 )
staticconstexprinherited

The default high edge of the power-law exponent fit range.

Definition at line 83 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawFitMinFreqHz

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawFitMinFreqHz = static_cast<realT>( 100 )
staticconstexprinherited

The default low edge of the power-law exponent fit range.

Definition at line 80 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawIndex

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawIndex = static_cast<realT>( 8.0 / 3.0 )
staticconstexprinherited

The default 1/f^a exponent.

Definition at line 37 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawMatchFallbackWindowHz

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawMatchFallbackWindowHz = static_cast<realT>( 5 )
staticconstexprinherited

The default half-width of the local match-frequency fallback window.

Definition at line 61 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawMatchFreq

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawMatchFreq = static_cast<realT>( 0 )
staticconstexprinherited

The default disabled explicit power-law match frequency.

Definition at line 43 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawNormFreq

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawNormFreq = static_cast<realT>( 0 )
staticconstexprinherited

The default auto-selected power-law normalization frequency.

Definition at line 40 of file modalPsdProcessor.hpp.

◆ c_defaultPowerLawOnlyAboveFreq

template<typename realT >
constexpr realT MagAOX::app::modalPsdProcessor< realT >::c_defaultPowerLawOnlyAboveFreq = static_cast<realT>( 0 )
staticconstexprinherited

The default disabled cutoff above which the extrapolation is pure power law only.

Definition at line 132 of file modalPsdProcessor.hpp.

◆ c_defaultProcessMethod

template<typename realT >
constexpr const char* MagAOX::app::modalPsdProcessor< realT >::c_defaultProcessMethod = "legacy"
staticconstexprinherited

The default process-method name.

Definition at line 34 of file modalPsdProcessor.hpp.


The documentation for this class was generated from the following file: