Merge pull request #1005 from srcejon/anttools_aeff

Antenna Tools update
This commit is contained in:
Edouard Griffiths 2021-10-05 23:11:32 +02:00 committed by GitHub
commit c53313c985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 164 additions and 116 deletions

View File

@ -163,6 +163,7 @@ void AntennaToolsGUI::displaySettings()
calcDishFocalLength();
calcDishBeamwidth();
calcDishGain();
calcDishEffectiveArea();
}
void AntennaToolsGUI::leaveEvent(QEvent*)
@ -410,7 +411,10 @@ void AntennaToolsGUI::calcDishFocalLength()
void AntennaToolsGUI::calcDishBeamwidth()
{
double beamwidth = 70.0 * dishLambda() / dishDiameterMetres();
// The constant here depends on the illumination tapering.
// 1.15 equals about 10dB: (4.14) in Fundamentals of Radio Astronomy
// 1.2 is also a commonly used value: https://www.cv.nrao.edu/~sransom/web/Ch3.html#E96
double beamwidth = Units::radiansToDegrees(1.15 * dishLambda() / dishDiameterMetres());
ui->dishBeamwidth->setValue(beamwidth);
}
@ -424,12 +428,22 @@ void AntennaToolsGUI::calcDishGain()
ui->dishGain->setValue(gainDB);
}
void AntennaToolsGUI::calcDishEffectiveArea()
{
double gainDB = ui->dishGain->value();
double g = pow(10.0, gainDB/10.0);
double lambda = dishLambda();
double ae = g * lambda * lambda / (4.0 * M_PI);
ui->dishEffectiveArea->setValue(ae);
}
void AntennaToolsGUI::on_dishFrequency_valueChanged(double value)
{
m_settings.m_dishFrequencyMHz = value;
applySettings();
calcDishBeamwidth();
calcDishGain();
calcDishEffectiveArea();
}
void AntennaToolsGUI::on_dishFrequencySelect_currentIndexChanged(int index)
@ -453,6 +467,7 @@ void AntennaToolsGUI::on_dishDiameter_valueChanged(double value)
calcDishFocalLength();
calcDishBeamwidth();
calcDishGain();
calcDishEffectiveArea();
}
void AntennaToolsGUI::on_dishLengthUnits_currentIndexChanged(int index)
@ -462,6 +477,7 @@ void AntennaToolsGUI::on_dishLengthUnits_currentIndexChanged(int index)
calcDishFocalLength();
calcDishBeamwidth();
calcDishGain();
calcDishEffectiveArea();
}
void AntennaToolsGUI::on_dishDepth_valueChanged(double value)
@ -476,6 +492,7 @@ void AntennaToolsGUI::on_dishEfficiency_valueChanged(int value)
m_settings.m_dishEfficiency = value;
applySettings();
calcDishGain();
calcDishEffectiveArea();
}
void AntennaToolsGUI::on_dishSurfaceError_valueChanged(double value)
@ -483,6 +500,7 @@ void AntennaToolsGUI::on_dishSurfaceError_valueChanged(double value)
m_settings.m_dishSurfaceError= value;
applySettings();
calcDishGain();
calcDishEffectiveArea();
}
double AntennaToolsGUI::getDeviceSetFrequencyMHz(int index)

View File

@ -74,6 +74,7 @@ private:
void calcDishFocalLength();
void calcDishBeamwidth();
void calcDishGain();
void calcDishEffectiveArea();
double dishLambda() const;
double dishLengthMetres(double length) const;
double dishMetresToLength(double m) const;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>377</width>
<height>499</height>
<width>394</width>
<height>523</height>
</rect>
</property>
<property name="sizePolicy">
@ -42,8 +42,8 @@
<rect>
<x>16</x>
<y>19</y>
<width>351</width>
<height>451</height>
<width>371</width>
<height>481</height>
</rect>
</property>
<property name="sizePolicy">
@ -219,10 +219,23 @@
<string>Dish</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="8" column="0">
<widget class="QLabel" name="dishBeamwidthLabel">
<item row="5" column="0">
<widget class="QLabel" name="dishFocalLengthLabel">
<property name="text">
<string>Beamwidth (°)</string>
<string>Focal length</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="dishDiameter">
<property name="toolTip">
<string>Diameter of the dish</string>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
<property name="value">
<double>100.000000000000000</double>
</property>
</widget>
</item>
@ -233,16 +246,10 @@
</property>
</widget>
</item>
<item row="11" column="0" colspan="3">
<widget class="QLabel" name="dishImage">
<item row="3" column="0">
<widget class="QLabel" name="dishDiameteLabel">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="antennatools.qrc">:/antennatools/antennatools/dish.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<string>Diameter</string>
</property>
</widget>
</item>
@ -270,10 +277,36 @@
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="dishFocalLengthLabel">
<item row="13" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="10" column="0">
<widget class="QLabel" name="dishGainLabel">
<property name="text">
<string>Focal length</string>
<string>Gain (dB)</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QDoubleSpinBox" name="dishBeamwidth">
<property name="toolTip">
<string>Halfpower (-3dB) beamwidth in degrees</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
</item>
@ -297,25 +330,22 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="dishDepthLabel">
<item row="8" column="0">
<widget class="QLabel" name="dishBeamwidthLabel">
<property name="text">
<string>Depth</string>
<string>Beamwidth (°)</string>
</property>
</widget>
</item>
<item row="12" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="dishDepth">
<property name="toolTip">
<string>Depth of the dish</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
</spacer>
</widget>
</item>
<item row="5" column="1">
<widget class="QDoubleSpinBox" name="dishFocalLength">
@ -330,33 +360,40 @@
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QDoubleSpinBox" name="dishBeamwidth">
<property name="toolTip">
<string>Halfpower (-3dB) beamwidth in degrees</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="dishDepth">
<property name="toolTip">
<string>Depth of the dish</string>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="dishGainLabel">
<item row="2" column="0">
<widget class="QLabel" name="dishSurfaceErrorLabel">
<property name="text">
<string>Gain (dB)</string>
<string>Surface error</string>
</property>
</widget>
</item>
<item row="12" column="0" colspan="3">
<widget class="QLabel" name="dishImage">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="antennatools.qrc">:/antennatools/antennatools/dish.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="dishFDLabel">
<property name="text">
<string>f/D</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="dishEfficiency">
<property name="toolTip">
<string>Dish efficiency in percent</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
@ -376,43 +413,16 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="dishDiameter">
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="dishSurfaceError">
<property name="toolTip">
<string>Diameter of the dish</string>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
<property name="value">
<double>100.000000000000000</double>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QDoubleSpinBox" name="dishFD">
<property name="toolTip">
<string>Focal length to diameter ratio</string>
<string>RMS surface error (as a length)</string>
</property>
<property name="readOnly">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="dishDiameteLabel">
<property name="text">
<string>Diameter</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="dishFDLabel">
<property name="text">
<string>f/D</string>
<double>360.000000000000000</double>
</property>
</widget>
</item>
@ -450,33 +460,43 @@
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="dishEfficiency">
<item row="6" column="1">
<widget class="QDoubleSpinBox" name="dishFD">
<property name="toolTip">
<string>Dish efficiency in percent</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="dishSurfaceErrorLabel">
<property name="text">
<string>Surface error</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="dishSurfaceError">
<property name="toolTip">
<string>RMS surface error (as a length)</string>
<string>Focal length to diameter ratio</string>
</property>
<property name="readOnly">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="maximum">
<double>360.000000000000000</double>
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="dishDepthLabel">
<property name="text">
<string>Depth</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="dishEffectiveAreaLabel">
<property name="text">
<string>Effective area (m&lt;sup&gt;2&lt;/sup&gt;)</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QDoubleSpinBox" name="dishEffectiveArea">
<property name="toolTip">
<string>Effective area</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="maximum">
<double>100000000.000000000000000</double>
</property>
</widget>
</item>
@ -511,6 +531,7 @@
<tabstop>dishFD</tabstop>
<tabstop>dishBeamwidth</tabstop>
<tabstop>dishGain</tabstop>
<tabstop>dishEffectiveArea</tabstop>
</tabstops>
<resources>
<include location="../../../sdrgui/resources/res.qrc"/>

View File

@ -30,7 +30,7 @@
const PluginDescriptor AntennaToolsPlugin::m_pluginDescriptor = {
AntennaTools::m_featureId,
QStringLiteral("Antenna Tools"),
QStringLiteral("6.16.2"),
QStringLiteral("6.16.7"),
QStringLiteral("(c) Jon Beniston, M7RCE"),
QStringLiteral("https://github.com/f4exb/sdrangel"),
true,

View File

@ -111,9 +111,11 @@ Displays the calculated focal length to diameter ratio.
<h3>16: Beamwidth</h3>
Displays the halfpower (-3dB) beamwidth.
Displays the halfpower (-3dB) beamwidth in degrees.
Beamwidth is calculated as: 70*lambda/D.
Beamwidth is calculated as: pi/180*1.15*lambda/D.
Note that the constant 1.15 is dependent upon illumination tapering, which is determined by the feed.
<h3>17: Gain</h3>
@ -122,3 +124,9 @@ Displays the calculated gain in dB.
The nominal gain is calculated as: g0=10\*log10(eff/100.0\*(pi*D/lambda)^2)
The gain is then adjusted for surface error with Ruze's equation: g=g0-685.81*(e/lambda)^2
<h3>18: Effective area</h3>
Displays the effective area in m^2.
Aeff is calculated as: g*lambda^2/(4*pi)