Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
PeakIntegrationService.hpp
Go to the documentation of this file.
1
8
9#pragma once
10
11#include "math/Precision.hpp"
12
13#include <optional>
14#include <span>
15#include <string>
16
17namespace correlation::analysis {
18
33
39public:
51 [[nodiscard]] static PeakIntegralResult
52 integrateRange(std::span<const real_t> x_bins, std::span<const real_t> y_vals, real_t r_min,
53 real_t r_max, std::optional<real_t> number_density = std::nullopt,
54 bool is_radial = false);
55
66 [[nodiscard]] static std::optional<PeakIntegralResult>
67 autoDetectPeakNear(std::span<const real_t> x_bins, std::span<const real_t> y_vals,
68 real_t target_x, std::optional<real_t> number_density = std::nullopt,
69 bool is_radial = false);
70
81 [[nodiscard]] static real_t calculateFWHM(std::span<const real_t> x_bins,
82 std::span<const real_t> y_vals, std::size_t peak_idx,
83 std::size_t min_idx, std::size_t max_idx) noexcept;
84};
85
86} // namespace correlation::analysis
Floating point precision type definitions for Correlation.
High-performance numerical integration and automated peak feature detection.
Definition PeakIntegrationService.hpp:38
static real_t calculateFWHM(std::span< const real_t > x_bins, std::span< const real_t > y_vals, std::size_t peak_idx, std::size_t min_idx, std::size_t max_idx) noexcept
Calculates Full Width at Half Maximum (FWHM) around a identified peak index.
Definition PeakIntegrationService.cpp:66
static std::optional< PeakIntegralResult > autoDetectPeakNear(std::span< const real_t > x_bins, std::span< const real_t > y_vals, real_t target_x, std::optional< real_t > number_density=std::nullopt, bool is_radial=false)
Detects the nearest peak maximum to a clicked coordinate and integrates its shell.
Definition PeakIntegrationService.cpp:160
static PeakIntegralResult integrateRange(std::span< const real_t > x_bins, std::span< const real_t > y_vals, real_t r_min, real_t r_max, std::optional< real_t > number_density=std::nullopt, bool is_radial=false)
Numerically integrates a distribution across a specified domain range.
Definition PeakIntegrationService.cpp:96
Definition AnalysisTypes.hpp:11
double real_t
Definition Precision.hpp:18
Quantitative metrics resulting from peak detection and integration.
Definition PeakIntegrationService.hpp:23
std::optional< real_t > coordination_number
4πρ ∫ r² g(r) dr for radial distributions.
Definition PeakIntegrationService.hpp:29
real_t r_max
Upper integration boundary (Å or unit).
Definition PeakIntegrationService.hpp:26
real_t fwhm
Full width at half maximum.
Definition PeakIntegrationService.hpp:30
real_t r_peak
Coordinate of peak maximum (Å or unit).
Definition PeakIntegrationService.hpp:24
real_t centroid
Weighted center of mass: ∫ x y(x) dx / ∫ y(x) dx.
Definition PeakIntegrationService.hpp:31
real_t peak_height
Amplitude/intensity at peak maximum.
Definition PeakIntegrationService.hpp:27
real_t r_min
Lower integration boundary (Å or unit).
Definition PeakIntegrationService.hpp:25
real_t area
Standard trapezoidal integral: ∫ y(x) dx.
Definition PeakIntegrationService.hpp:28