AzimuthalIntegrationSettings: More generous Q spacing
This commit is contained in:
@@ -52,7 +52,59 @@ bool Azim_int_settings::validate(std::stringstream& msg, const std::string& path
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Azim_int_settings" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
|
||||
/* High_q_recipA */ {
|
||||
const float& value = m_High_q_recipA;
|
||||
const std::string currentValuePath = _pathPrefix + ".highQRecipA";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.000020))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.000020;";
|
||||
}
|
||||
if (value > static_cast<float>(10.0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 10.0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Low_q_recipA */ {
|
||||
const float& value = m_Low_q_recipA;
|
||||
const std::string currentValuePath = _pathPrefix + ".lowQRecipA";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.000010))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.000010;";
|
||||
}
|
||||
if (value > static_cast<float>(10))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 10;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Q_spacing */ {
|
||||
const float& value = m_Q_spacing;
|
||||
const std::string currentValuePath = _pathPrefix + ".qSpacing";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.000010))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.000010;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (azimuthalBinsIsSet())
|
||||
{
|
||||
const int64_t& value = m_Azimuthal_bins;
|
||||
@@ -64,10 +116,10 @@ bool Azim_int_settings::validate(std::stringstream& msg, const std::string& path
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 1;";
|
||||
}
|
||||
if (value > 256ll)
|
||||
if (value > 512ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 256;";
|
||||
msg << currentValuePath << ": must be less than or equal to 512;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1065,18 +1065,23 @@ components:
|
||||
default: true
|
||||
high_q_recipA:
|
||||
type: number
|
||||
minimum: 2e-5
|
||||
maximum: 10.0
|
||||
format: float
|
||||
low_q_recipA:
|
||||
type: number
|
||||
format: float
|
||||
minimum: 1e-5
|
||||
maximum: 10
|
||||
q_spacing:
|
||||
type: number
|
||||
format: float
|
||||
minimum: 1e-5
|
||||
azimuthal_bins:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 1
|
||||
maximum: 256
|
||||
maximum: 512
|
||||
default: 1
|
||||
description: Numer of azimuthal (phi) bins; 1 = standard 1D azimuthal integration
|
||||
force_cpu:
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -22,8 +22,8 @@ AzimuthalIntegrationSettings &AzimuthalIntegrationSettings::SolidAngleCorrection
|
||||
AzimuthalIntegrationSettings &AzimuthalIntegrationSettings::QRange_recipA(float low, float high) {
|
||||
check_finite("Low Q for azimuthal integration", low);
|
||||
check_finite("High Q for azimuthal integration", high);
|
||||
check_max("High Q for azimuthal integration", high, 10.0);
|
||||
check_min("Low Q for azimuthal integration", low, 0.001);
|
||||
check_max("High Q for azimuthal integration", high, maxQ_recipA);
|
||||
check_min("Low Q for azimuthal integration", low, minQ_recipA);
|
||||
if (high <= low)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"High Q must be higher than low Q");
|
||||
@@ -36,7 +36,7 @@ AzimuthalIntegrationSettings &AzimuthalIntegrationSettings::QRange_recipA(float
|
||||
|
||||
AzimuthalIntegrationSettings &AzimuthalIntegrationSettings::QSpacing_recipA(float input) {
|
||||
check_finite("Q spacing for azimuthal integration", input);
|
||||
check_min("Q spacing for azimuthal integration", input, 0.00999);
|
||||
check_min("Q spacing for azimuthal integration", input, minQ_recipA);
|
||||
q_spacing = input;
|
||||
UpdateBinCount();
|
||||
return *this;
|
||||
@@ -59,10 +59,10 @@ float AzimuthalIntegrationSettings::GetQSpacing_recipA() const {
|
||||
}
|
||||
|
||||
AzimuthalIntegrationSettings &AzimuthalIntegrationSettings::BkgEstimateQRange_recipA(float low, float high) {
|
||||
check_finite("Low Q for azimuthal integration", low);
|
||||
check_finite("High Q for azimuthal integration", high);
|
||||
check_max("High Q for azimuthal integration", high, 10.0);
|
||||
check_min("Low Q for azimuthal integration", low, 0.001);
|
||||
check_finite("Low Q for background estimation", low);
|
||||
check_finite("High Q for background estimation", high);
|
||||
check_max("High Q for background estimation", high, maxQ_recipA);
|
||||
check_min("Low Q for background estimation", low, minQ_recipA);
|
||||
if (high <= low)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"High Q must be higher than low Q");
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
#include <cstdint>
|
||||
|
||||
class AzimuthalIntegrationSettings {
|
||||
constexpr static float minQ_recipA = 1e-5;
|
||||
constexpr static float maxQ_recipA = 10.0;
|
||||
|
||||
bool solid_angle_correction = true;
|
||||
bool polarization_correction = true;
|
||||
float high_q_recipA = 5.0;
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "jungfraujoch-frontend",
|
||||
"version": "1.0.0-rc.150",
|
||||
"version": "1.0.0-rc.151",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "jungfraujoch-frontend",
|
||||
"version": "1.0.0-rc.150",
|
||||
"version": "1.0.0-rc.151",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.10.4",
|
||||
|
||||
@@ -77,7 +77,7 @@ class AzIntSettings extends React.Component<MyProps, MyState> {
|
||||
default={1.0}
|
||||
start_val={this.state.s.q_spacing}
|
||||
label={"Q spacing"}
|
||||
min={0.001}
|
||||
min={1e-5}
|
||||
units={"A-1"}
|
||||
float={true}
|
||||
counter={this.state.download_counter}
|
||||
@@ -93,7 +93,7 @@ class AzIntSettings extends React.Component<MyProps, MyState> {
|
||||
default={0.1}
|
||||
start_val={this.state.s.low_q_recipA}
|
||||
label={"Low Q"}
|
||||
min={0.001}
|
||||
min={1e-5}
|
||||
max={10.0}
|
||||
units={"A-1"}
|
||||
float={true}
|
||||
@@ -110,7 +110,7 @@ class AzIntSettings extends React.Component<MyProps, MyState> {
|
||||
default={5}
|
||||
start_val={this.state.s.high_q_recipA}
|
||||
label={"High Q"}
|
||||
min={0.001}
|
||||
min={1e-5}
|
||||
max={10.0}
|
||||
units={"A-1"}
|
||||
float={true}
|
||||
@@ -160,7 +160,7 @@ class AzIntSettings extends React.Component<MyProps, MyState> {
|
||||
}));
|
||||
}}
|
||||
>
|
||||
{[1, 2, 4, 8, 16, 32, 64].map((value) => (
|
||||
{[1, 2, 4, 8, 16, 32, 64, 128].map((value) => (
|
||||
<FormControlLabel
|
||||
key={value}
|
||||
value={value}
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <QButtonGroup>
|
||||
#include <QFormLayout>
|
||||
|
||||
#include "../widgets/SliderPlusBox.h"
|
||||
|
||||
JFJochAzIntWindow::JFJochAzIntWindow(
|
||||
const AzimuthalIntegrationSettings &settings,
|
||||
QWidget *parent)
|
||||
@@ -23,17 +25,17 @@ JFJochAzIntWindow::JFJochAzIntWindow(
|
||||
auto formLayout = new QFormLayout(group);
|
||||
|
||||
// Q spacing
|
||||
m_qSpacing = new SliderPlusBox(0.01, 1.0, 0.001, 3, this);
|
||||
m_qSpacing = new SliderPlusBox(1e-5, 1.0, 0.001, 3, this, SliderPlusBox::ScaleType::Logarithmic);
|
||||
m_qSpacing->setValue(m_settings.GetQSpacing_recipA());
|
||||
formLayout->addRow(tr("Q spacing [Å⁻¹]:"), m_qSpacing);
|
||||
|
||||
// Low Q
|
||||
m_lowQ = new SliderPlusBox(0.001, 10.0, 0.001, 3, this);
|
||||
m_lowQ = new SliderPlusBox(1e-5, 10.0, 0.001, 3, this);
|
||||
m_lowQ->setValue(m_settings.GetLowQ_recipA());
|
||||
formLayout->addRow(tr("Low Q [Å⁻¹]:"), m_lowQ);
|
||||
|
||||
// High Q
|
||||
m_highQ = new SliderPlusBox(0.001, 10.0, 0.001, 3, this);
|
||||
m_highQ = new SliderPlusBox(2e-5, 10.0, 0.001, 3, this);
|
||||
m_highQ->setValue(m_settings.GetHighQ_recipA());
|
||||
formLayout->addRow(tr("High Q [Å⁻¹]:"), m_highQ);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user