diff --git a/images/dotnet/dotnet-add-nuget.png b/images/dotnet/dotnet-add-nuget.png new file mode 100644 index 0000000..fe9ac59 Binary files /dev/null and b/images/dotnet/dotnet-add-nuget.png differ diff --git a/includes/_code_examples.qmd b/includes/_code_examples.qmd index 4bbe3d8..8466195 100644 --- a/includes/_code_examples.qmd +++ b/includes/_code_examples.qmd @@ -1,3 +1,3 @@ -#### Examples +**Examples** Language-specific code examples showing the use of this function are available by following these links: \ No newline at end of file diff --git a/includes/driver/_general_usage.qmd b/includes/driver/_general_usage.qmd index 77da4ce..fdb0881 100644 --- a/includes/driver/_general_usage.qmd +++ b/includes/driver/_general_usage.qmd @@ -1,9 +1,9 @@ -# General Usage +## General Usage -## Input Files +### Input Files Inputs to the command-line driver are specified in an ASCII text file using the common `key,value` format. Each line holds a single `key,value` combination, with the `key` representing the model input variable name and the `value` representing its value. Refer to the [examples](#examples) below to see the specific keys required for this model's inputs. Note that key names are not case-sensitive. -## Output Files +### Output Files After parsing the inputs and running the software, the command-line driver will generate an output report file containing the results. This file contains a record of the input parameters along with the model outputs and human-readable supporting details. Refer to the [examples](#examples) below to see the expected format of output files generated by this model. \ No newline at end of file diff --git a/includes/driver/_intro_and_installation.qmd b/includes/driver/_intro_and_installation.qmd index dcd584e..d62423b 100644 --- a/includes/driver/_intro_and_installation.qmd +++ b/includes/driver/_intro_and_installation.qmd @@ -5,5 +5,5 @@ use the command-line driver. {{< include /includes/_link_to_model_home.qmd >}} -# Installation +## Installation diff --git a/includes/matlab/_getting_started.qmd b/includes/matlab/_getting_started.qmd index 978625d..a13721d 100644 --- a/includes/matlab/_getting_started.qmd +++ b/includes/matlab/_getting_started.qmd @@ -1,4 +1,4 @@ -There are two easy ways to install the toolbox: [from a browser](#installing-from-a-browser) or [from within MATLAB](#installing-from-within-matlab). +There are two easy ways to install the toolbox: [from a browser](#installation-from-a-browser) or [from within MATLAB](#installation-from-within-matlab). ### Installation from a Browser diff --git a/index.qmd b/index.qmd index 93791e6..16a8e86 100644 --- a/index.qmd +++ b/index.qmd @@ -1,10 +1,10 @@ --- title: "ITS Propagation Library Wiki" date: 2024-06-11 -date-modified: 2024-12-02 +date-modified: 2025-06-12 --- -The ITS Propagation Library (**"PropLib"**) is a collection of open source software developed by [ITS](about.qmd), focused on modeling radio wave propagation under a wide variety of circumstances. The library currently supports C++, .NET, MATLAB®, and Python users through exposing common functionality across multiple programming environments. One of the key benefits of this approach is that users are assured of identical results across languages, allowing researchers to work in their most efficient development environment while benefitting from common library improvements. +The ITS Propagation Library (**"PropLib"**) is a collection of open source software developed by [ITS](about.qmd), focused on modeling radio wave propagation under a wide variety of circumstances. The library currently supports C++, .NET, MATLAB®, and Python users through exposing common functionality across multiple programming environments. One of the key benefits of this approach is that users are assured of identical results across languages, allowing researchers to work in their most efficient development environment while benefitting from common library improvements. ## Packages @@ -53,10 +53,16 @@ The P.528 model has a public code repository, but documentation is not yet avail in the meantime. ::: -+-----------:+:-------------------------------------:+:---------------------:+:------------------------------------------------------------+ -| **P.528** | [Repo](https://github.com/NTIA/P528) | Docs | A propagation prediction method for aeronautical mobile and | -| | | | radionavigation services using the VHF, UHF, and SHF bands | -+------------+---------------------------------------+-----------------------+-------------------------------------------------------------+ -| **P.2108** | [Repo](https://github.com/NTIA/p2108) | [Docs](models/P2108/) | Prediction of clutter loss | -+------------+---------------------------------------+-----------------------+-------------------------------------------------------------+ ++-----------:+:-------------------------------------:+:---------------------:+:-----------------------------------------------------------------+ +| **P.528** | [Repo](https://github.com/NTIA/P528) | Docs | A propagation prediction method for aeronautical mobile and | +| | | | radionavigation services using the VHF, UHF, and SHF bands | ++------------+---------------------------------------+-----------------------+------------------------------------------------------------------+ +| **P.676** | [Repo](https://github.com/NTIA/P676) | [Docs](models/P676/) | Prediction methods for the specific attenuation, terrestrial and | +| | | | slant path gaseous attenuation due to oxygen and water vapour | ++------------+---------------------------------------+-----------------------+------------------------------------------------------------------+ +| **P.835** | [Repo](https://github.com/NTIA/P835) | [Docs](models/P835/) | Expressions and data for reference standard atmospheres required | +| | | | for the calculation of gaseous attenuation on Earth-space paths | ++------------+---------------------------------------+-----------------------+------------------------------------------------------------------+ +| **P.2108** | [Repo](https://github.com/NTIA/p2108) | [Docs](models/P2108/) | Prediction of clutter loss | ++------------+---------------------------------------+-----------------------+------------------------------------------------------------------+ : ITU-R Recommendations implemented in the ITS Propagation Library {tbl-colwidths="[15,10,10,65]"} diff --git a/models/LFMF/cpp.qmd b/models/LFMF/cpp.qmd index a473b84..0b59898 100644 --- a/models/LFMF/cpp.qmd +++ b/models/LFMF/cpp.qmd @@ -1,7 +1,7 @@ --- title: "Low Frequency / Medium Frequency Propagation Model – C++" date: 2024-12-02 -date-modified: 2025-01-24 +date-modified: 2025-06-12 --- This page details the installation and usage of the C++ version of the PropLib implementation of the Low Frequency / Medium Frequency (LF/MF) propagation model. @@ -10,8 +10,6 @@ This page details the installation and usage of the C++ version of the PropLib i ## Installation -{{< include /includes/_package_install_not_ready.qmd >}} - To use the C++ library in your code, you'll need to download the shared library (`.dll` on Windows, `.dylib` on macOS, or `.so` on Linux) and the header file. These are distributed for each supported platform as part of the [GitHub Releases](https://github.com/NTIA/LFMF/releases/) starting with v1.1. Prior to v1.1, support was only provided for Windows platforms. To use the shared library in your project, you'll need to link against it. The details for this process differ depending on your compiler and/or IDE, but generally you will need to somehow provide the path to the files you downloaded from the GitHub release. @@ -34,35 +32,35 @@ This library has no external C++ dependencies. The following code example shows how the LF/MF model can be called in a C++ program. -### Calling the Model +### Calling the LFMF Model ```cpp #include "LFMF.h" -using namespace ITS::Propagation; +using namespace ITS::Propagation::LFMF; int main() { // Define inputs - double h_tx__meter = 0.0; // Height of the transmitter - double h_rx__meter = 0.0; // Height of the receiver - double f__mhz = 0.01; // Frequency - double P_tx__watt = 1000.0; // Transmitter power - double N_s = 301.0; // Surface refractivity - double d__km = 1000.0; // Path distance - double epsilon = 15.0; // Relative permittivity - double sigma = 0.005; // Conductivity - LFMF::Polarization pol = LFMF::Polarization::HORIZONTAL; // Polarization + double h_tx__meter = 0.0; // Height of the transmitter + double h_rx__meter = 0.0; // Height of the receiver + double f__mhz = 0.01; // Frequency + double P_tx__watt = 1000.0; // Transmitter power + double N_s = 301.0; // Surface refractivity + double d__km = 1000.0; // Path distance + double epsilon = 15.0; // Relative permittivity + double sigma = 0.005; // Conductivity + Polarization pol = Polarization::HORIZONTAL; // Polarization // Create struct to store outputs - LFMF::Result result; - LFMF::ReturnCode rtn; // Return code + Result result; // LFMF result structure + ReturnCode rtn; // Return code // Call the model - rtn = LFMF::LFMF_CPP(h_tx__meter, h_rx__meter, f__mhz, P_tx__watt, N_s, d__km, epsilon, sigma, pol, &result); + rtn = LFMF_CPP(h_tx__meter, h_rx__meter, f__mhz, P_tx__watt, N_s, d__km, epsilon, sigma, pol, &result); // rtn is 0 (SUCCESS) // result.A_btl__db is 184.49 dB // result.E_dBuVm is -82.50 dB(uV/m) // result.P_rx__dbm is -114.93 dBm - // result.method is 1 (residue series) + // result.method is 1 (RESIDUE_SERIES) } ``` diff --git a/models/LFMF/dotnet.qmd b/models/LFMF/dotnet.qmd new file mode 100644 index 0000000..ce24aa9 --- /dev/null +++ b/models/LFMF/dotnet.qmd @@ -0,0 +1,79 @@ +--- +title: "Low Frequency / Medium Frequency Propagation Model – .NET" +date: 2025-01-24 +date-modified: 2025-06-12 +--- + +This page details the installation and usage of the .NET version of the PropLib implementation of the Low Frequency / Medium Frequency (LF/MF) propagation model. + +{{< include /includes/_link_to_model_home.qmd >}} + +## Installation + +This .NET package is distributed on +[NuGet](https://www.nuget.org/packages/ITS.Propagation.LFMF). + +There are two easy ways to install the NuGet package: [dotnet CLI](#installation-with-dotnet-cli) or [Visual Studio](#installation-with-visual-studio). + +### Installation with dotnet CLI + +1. Run the following command to install the package. + + ```default + dotnet add package ITS.Propagation.LFMF + ``` + +1. After the command completes, open the project csproj file to see the added NuGet package reference: + + ```default + + + + ``` + +### Installation with Visual Studio + +1. Open your project in **Visual Studio** and select **Project > Manage NuGet Packages**. + +1. In the **NuGet Package Manager** page, choose **nuget.org** as the **Package source**. + +1. From the **Browse** tab, search for **ITS.Propagation.LFMF**, select ITS.Propagation.LFMF in the list, and then select Install as shown in @fig-dotnet-add-nuget. + + ![](/images/dotnet/dotnet-add-nuget.png){#fig-dotnet-add-nuget fig-alt="A screenshot showing the 'NuGet Package Manager'" width=600 fig-align="left"} + +1. If you're prompted to verify the installation, select OK. + +## Examples + +The following code examples show how the LF/MF model can be called from .NET project. + +### Calling the LFMF Model + +```c# +using ITS.Propagation; + +// define inputs +double h_tx__meter = 0; // Height of the transmitter +double h_rx__meter = 0; // Height of the receiver +double f__mhz = 0.01; // Frequency +double P_tx__watt = 1000.0; // Transmitter power +double N_s = 301.0; // Surface refractivity +double d__km = 1000.0; // Path distance +double epsilon = 15.0; // Relative permittivity +double sigma = 0.005; // Conductivity +int pol = 0; // Polarization (enum value) +// Alternately, `pol` can be specified using the enum: +// LFMF.Polarization pol = LFMF.Polarization.Horizontal; + +// Call the LF/MF model +int rtn = LFMF.LFMFModel(h_tx__meter, h_rx__meter, f__mhz, P_tx__watt, N_s, + d__km, epsilon, sigma, pol, out LFMF.Result result); + +// rtn is 0 (SUCCESS) +// The result is a data structure containing four elements: +// result.A_btl__db is approximately 184.49 +// result.E__dBuVm is approximately -82.50 +// result.P_rx__dbm is approximately -114.93 +// result.method is ITS.Propagation.LFMF.SolutionMethod.ResidueSeries +// (SolutionMethod enum value 1) +``` diff --git a/models/LFMF/driver.qmd b/models/LFMF/driver.qmd index 02798b2..ca31a97 100644 --- a/models/LFMF/driver.qmd +++ b/models/LFMF/driver.qmd @@ -1,16 +1,22 @@ --- title: "Low Frequency / Medium Frequency Propagation Model – Command-Line Driver" date: 2025-01-10 -date-modified: 2025-01-10 +date-modified: 2025-06-12 --- This page details the usage of the cross-platform command-line driver version of the Low Frequency / Medium Frequency (LF/MF) propagation model. {{< include /includes/driver/_intro_and_installation.qmd >}} +To use the command-line driver program, you'll need to download the driver program +(`LFMFDriver-1.1.0-Windows-x64.exe` or `LFMFDriver-1.1.0-Windows-x86.exe` on Windows, `LFMFDriver-1.1.0-Darwin-universal` on macOS, or `LFMFDriver-1.1.0-Linux-x86_64` on Linux) + and the shared library (`.dll` on Windows, `.dylib` on macOS, or `.so` on Linux). + These are distributed for each supported platform as part of the [GitHub Releases](https://github.com/NTIA/LFMF/releases/) starting with v1.1. + Prior to v1.1, support was only provided for Windows platforms. + {{< include /includes/driver/_general_usage.qmd >}} -# Command-Line Arguments +## Command-Line Arguments Executing the command-line driver requires specifying input arguments, defined in @tbl-lfmf-driver-input-args below. @@ -31,7 +37,7 @@ The additional arguments are defined in @tbl-lfmf-driver-additional-args | `-v` | Display version information for the library and driver | : Additional arguments for the LF/MF command-line driver {#tbl-lfmf-driver-additional-args} -# Examples +## Examples The LF/MF model can be run by simply providing the input and output files on the command line. For example: @@ -49,7 +55,7 @@ LFMFDriver-1.1.0-Windows-x64.exe -i input.txt -o output.txt Three example sets of input/output file pairs are provided below. -## Example 1 +### Example 1 ```{.default filename="Input File Contents"} h_tx__meter,0 @@ -67,14 +73,14 @@ pol,0 Model LFMF Library Version v1.1 Driver Version v1.1.0 -Date Generated Mon Nov 18 13:56:29 2024 -Input Arguments -i i_lfmf_01.txt -o o_lfmf_01.txt +Date Generated Tue Jul 01 13:38:18 2025 +Input Arguments -i input.txt -o results.txt Inputs: -h_tx__meter 0 [meter] -h_rx__meter 0 [meter] +h_tx__meter 0 [meters] +h_rx__meter 0 [meters] f__mhz 0.01 [MHz] -p_tx__watt 1000 [Watts] +p_tx__watt 1000 [watts] n_s 301 [N-Units] d__km 1000 [km] epsilon 15 @@ -82,14 +88,14 @@ sigma 0.005 pol 0 [0 = Horizontal, 1 = Vertical] Results: -Return Code 0 [LFMF v1.0 Status: Successful execution] +Return Code 0 [LFMF v1.1 Status: Successful execution] Basic transmission loss 184.49 [dB] Electric field strength -82.50 [dB(uV/m)] Received power -114.93 [dB] Solution method 1 [0 = Flat earth with curve correction, 1 = Residue series] ``` -## Example 2 +### Example 2 ```{.default filename="Input File Contents"} h_tx__meter,5.5 @@ -129,7 +135,7 @@ Received power -84.78 [dB] Solution method 0 [0 = Flat earth with curve correction, 1 = Residue series] ``` -## Example 3 +### Example 3 ```{.default filename="Input File Contents"} h_tx__meter,1 diff --git a/models/LFMF/index.qmd b/models/LFMF/index.qmd index 2bcf526..156728d 100644 --- a/models/LFMF/index.qmd +++ b/models/LFMF/index.qmd @@ -1,7 +1,7 @@ --- title: "Low Frequency / Medium Frequency Propagation Model" date: 2024-12-02 -date-modified: 2025-01-25 +date-modified: 2025-06-12 --- The Low Frequency / Medium Frequency (LF/MF) propagation model predicts basic transmission loss in the frequency range 0.01 - 30 MHz for propagation paths over a smooth Earth and antenna heights less than 50 meters. [@ntia-tr-99-368] @@ -27,7 +27,7 @@ The model additionally outputs the predicted electric field strength of the grou ## Functions -### Low Frequency / Mid Frequency Propagation Model +### Low Frequency / Medium Frequency (LF/MF) Propagation Model This model's functionality is exposed through a single function. The inputs for this function are shown below in @tbl-lfmf-inputs. The model outputs are provided in @tbl-lfmf-outputs. @@ -73,7 +73,7 @@ The `method` output indicates the solution method used internally by the model w {{< include /includes/_code_examples.qmd >}} -[C++](cpp.qmd#calling-the-model){.btn .btn-secondary .btn role="button"} -[.NET](dotnet.qmd#calling-the-model){.btn .btn-secondary .btn role="button"} -[MATLAB](matlab.qmd#calling-the-model){.btn .btn-secondary .btn role="button"} -[Python](python.qmd#calling-the-model){.btn .btn-secondary .btn role="button"} \ No newline at end of file +[C++](cpp.qmd#calling-the-lfmf-model){.btn .btn-secondary .btn role="button"} +[.NET](dotnet.qmd#calling-the-lfmf-model){.btn .btn-secondary .btn role="button"} +[MATLAB](matlab.qmd#calling-the-lfmf-model){.btn .btn-secondary .btn role="button"} +[Python](python.qmd#calling-the-lfmf-model){.btn .btn-secondary .btn role="button"} \ No newline at end of file diff --git a/models/LFMF/matlab.qmd b/models/LFMF/matlab.qmd index 5b89b1a..c085fd9 100644 --- a/models/LFMF/matlab.qmd +++ b/models/LFMF/matlab.qmd @@ -1,34 +1,30 @@ --- title: "Low Frequency / Medium Frequency Propagation Model – MATLAB" date: 2025-01-24 -date-modified: 2025-01-25 +date-modified: 2025-06-12 --- -This page details the installation and usage of the MATLAB® version of the PropLib implementation of the Low Frequency / Medium Frequency (LF/MF) propagation model. - -{{< include /includes/_under_construction.qmd >}} +This page details the installation and usage of the MATLAB® version of the PropLib implementation of the Low Frequency / Medium Frequency (LF/MF) propagation model. {{< include /includes/_link_to_model_home.qmd >}} - \ No newline at end of file diff --git a/models/LFMF/python.qmd b/models/LFMF/python.qmd index e338bf0..bba5474 100644 --- a/models/LFMF/python.qmd +++ b/models/LFMF/python.qmd @@ -1,7 +1,7 @@ --- title: "Low Frequency / Medium Frequency Propagation Model – Python" date: 2025-01-24 -date-modified: 2025-01-24 +date-modified: 2025-06-12 --- This page details the installation and usage of the Python version of the PropLib implementation of the Low Frequency / Medium Frequency (LF/MF) propagation model. @@ -43,7 +43,7 @@ help(LFMF.LFMF) The following code examples show how the LF/MF model can be called from Python. -### Calling the Model +### Calling the LFMF Model ```python from ITS.Propagation import LFMF @@ -67,6 +67,6 @@ result = LFMF.LFMF(h_tx__meter, h_rx__meter, f__mhz, P_tx__watt, N_s, d__km, eps # The result is a data structure containing four elements: # result.A_btl__db is approximately 184.49 # result.E__dBuVm is approximately -82.50 -# result.P_rx__dbm is approximately -115.93 -# result.method is 1 (enum value) +# result.P_rx__dbm is approximately -114.93 +# result.method is ``` diff --git a/models/P2108/cpp.qmd b/models/P2108/cpp.qmd index 93229e4..97a03d2 100644 --- a/models/P2108/cpp.qmd +++ b/models/P2108/cpp.qmd @@ -32,7 +32,7 @@ This library has no external C++ dependencies. ## Examples -The following code examples show how each of the three models from Recommendation ITU-R P.2108 can be called from Python. +The following code examples show how each of the three models from Recommendation ITU-R P.2108 can be called in a C++ program. ### Height Gain Terminal Correction Model diff --git a/models/P2108/driver.qmd b/models/P2108/driver.qmd index be177de..91188df 100644 --- a/models/P2108/driver.qmd +++ b/models/P2108/driver.qmd @@ -8,9 +8,15 @@ This page details the usage of the cross-platform command-line driver version of {{< include /includes/driver/_intro_and_installation.qmd >}} +To use the command-line driver program, you'll need to download the driver program +(`P2108Driver-Windows-x64.exe` or `P2108Driver-Windows-x86.exe` on Windows, `P2108Driver-Darwin-universal` on macOS, or `P2108Driver-Linux-x86_64` on Linux) + and the shared library (`.dll` on Windows, `.dylib` on macOS, or `.so` on Linux). + These are distributed for each supported platform as part of the [GitHub Releases](https://github.com/NTIA/p2108/releases/) starting with v1.1. + Prior to v1.1, support was only provided for Windows platforms. + {{< include /includes/driver/_general_usage.qmd >}} -# Command-Line Arguments +## Command-Line Arguments Executing the command-line driver requires specifying input arguments, defined in @tbl-p2108-driver-input-args below. @@ -32,9 +38,9 @@ The additional arguments are defined in @tbl-p2108-driver-additional-args | `-v` | Display version information for the library and driver | : Additional arguments for the Recommendation ITU-R P.2108 command-line driver {#tbl-p2108-driver-additional-args} -# Examples +## Examples -## Height Gain Terminal Correction Model +### Height Gain Terminal Correction Model The Height Gain Terminal Correction Model can be run by providing the `-model HGTCM` flag on the command line. For example: @@ -80,7 +86,7 @@ Return Code 0 [P2108 Status: Successful execution] Clutter loss 24.5 (dB) ``` -## Terrestrial Statistical Model +### Terrestrial Statistical Model The Terrestrial Statistical Model can be run by providing the `-model TSM` flag on the command line. For example: @@ -122,7 +128,7 @@ Return Code 0 [P2108 Status: Successful execution] Clutter loss 32.5 (dB) ``` -## Aeronautical Statistical Model +### Aeronautical Statistical Model The Aeronautical Statistical Model can be run by providing the `-model ASM` flag on the command line. For example: diff --git a/models/P2108/matlab.qmd b/models/P2108/matlab.qmd index b81e9d1..2db8c84 100644 --- a/models/P2108/matlab.qmd +++ b/models/P2108/matlab.qmd @@ -4,7 +4,7 @@ date: 2025-01-24 date-modified: 2025-01-25 --- -This page details the installation and usage of the MATLAB® version of the PropLib implementation of Recommendation ITU-R P.2108. +This page details the installation and usage of the MATLAB® version of the PropLib implementation of Recommendation ITU-R P.2108. {{< include /includes/_under_construction.qmd >}} @@ -14,7 +14,7 @@ This page details the installation and usage of the MATLAB® version of the Prop ## Getting Started -This MATLAB® Toolbox is distributed on [MathWorks® File Exchange](#TODO). +This MATLAB® Toolbox is distributed on [MathWorks® File Exchange](#TODO). {{< include /includes/matlab/_getting_started.qmd >}} diff --git a/models/P676/_metadata.yml b/models/P676/_metadata.yml new file mode 100644 index 0000000..5604417 --- /dev/null +++ b/models/P676/_metadata.yml @@ -0,0 +1,15 @@ +format: + html: + code-links: + - text: NTIA/p676 + icon: github + href: https://github.com/NTIA/p676 + - text: NTIA/p676-dotnet + icon: github + href: https://github.com/NTIA/p676-dotnet + - text: NTIA/p676-matlab + icon: github + href: https://github.com/NTIA/p676-matlab + - text: NTIA/p676-python + icon: github + href: https://github.com/NTIA/p676-python \ No newline at end of file diff --git a/models/P676/cpp.qmd b/models/P676/cpp.qmd new file mode 100644 index 0000000..b946015 --- /dev/null +++ b/models/P676/cpp.qmd @@ -0,0 +1,112 @@ +--- +title: "The Recommendation ITU-R P.676-12 – C++" +date: 2024-12-02 +date-modified: 2025-06-12 +--- + +This page details the installation and usage of the C++ version of the PropLib implementation of the Recommendation ITU-R P.676-12. + +{{< include /includes/_link_to_model_home.qmd >}} + +## Installation + +To use the C++ library in your code, you'll need to download the shared library (`.dll` on Windows, `.dylib` on macOS, or `.so` on Linux) and the header file. These are distributed for each supported platform as part of the [GitHub Releases](https://github.com/NTIA/p676/releases/). + +To use the shared library in your project, you'll need to link against it. The details for this process differ depending on your compiler and/or IDE, but generally you will need to somehow provide the path to the files you downloaded from the GitHub release. + +Once you've linked the dynamic library to your project, all you need to do is include the appropriate header file and, optionally, use its namespace: + +```cpp +#include "P676.h" + +using namespace ITS::ITU::PSeries::P676; // Optional: makes later code more concise +``` + +This library has no external C++ dependencies. + +{{< include /includes/cpp/_documentation.qmd >}} + +[Docs](https://ntia.github.io/p676){.btn .btn-secondary .btn role="button"} + +## Examples + +The following code example shows how each of the three major methods from the Recommendation ITU-R P.676 can be called in a C++ program. + +### Specific Attenuation Model + +```cpp +#include "P676.h" +using namespace ITS::ITU::PSeries::P676; + +int main() { + // Define inputs + double f__ghz = 60.0; // Frequency, in GHz + double T__kelvin = 288.15; // Temperature, in Kelvin + double e__hPa = 9.97288879; // Water vapour partial pressure, in hPa + double p__hPa = 1013.25; // Dry air pressure, in hPa + + // Create variables to store outputs + double gamma; // Specific gaseous attenuation, in dB/km + + // Call Specific Attenuation Model + gamma = SpecificAttenuation(f__ghz, T__kelvin, e__hPa, p__hPa); + + // gamma is approx. 14.7783 +} +``` + +### Terrestrial Path Attenuation Model + +```cpp +#include "P676.h" +using namespace ITS::ITU::PSeries::P676; + +int main() { + // Define inputs + double f__ghz = 26.0; // Frequency, in GHz + Atmosphere atmosphere = Atmosphere:: + ATMOSPHERE__MAGRA; // Reference atmosphere from P.835, enum + double r_0__km = 10.5; // Path length, in km + + // Create variables to store outputs + double A_gas; // Gaseous attenuation, in dB + ReturnCode rtn; // Return code + + // Call Terrestrial Path Attenuation Model + rtn = TerrestrialPathAttenuation(f__ghz, atmosphere, r_0__km, A_gas); + + // rtn is 0 (SUCCESS) + // A_gas is approx. 1.3128 +} +``` + +### Slant Path Attenuation Model + +```cpp +#include "P676.h" +using namespace ITS::ITU::PSeries::P676; + +int main() { + // Define inputs + double f__ghz = 48.0; // Frequency, in GHz + double h_1__km = 10; // Height of the low terminal, in km + double h_2__km = 95; // Height of the high terminal, in km + double beta_1__rad = 0.75; // Elevation angle (from zenith), in rad + Atmosphere atmosphere = Atmosphere:: + ATMOSPHERE__HIGH_LAT_WINTER; // Reference atmosphere from P.835, enum + + // Create variables to store outputs + SlantPathAttenuationResult result; // Slant path result structure + ReturnCode rtn; // Return code + + // Call Slant Path Attenuation Model + rtn = SlantPathAttenuation(f__ghz, h_1__km, h_2__km, beta_1__rad, atmosphere, result); + + // rtn is 0 (SUCCESS) + // result.A_gas__db is approx. 0.1014 dB + // bending__rad is approx. 8.0309e-05 rad + // a__km is approx. 115.5221 km + // incident__rad is approx. 0.7379 rad + // delta_L__km is approx. 0.0008058 km +} +``` \ No newline at end of file diff --git a/models/P676/dotnet.qmd b/models/P676/dotnet.qmd new file mode 100644 index 0000000..3cf0d3f --- /dev/null +++ b/models/P676/dotnet.qmd @@ -0,0 +1,113 @@ +--- +title: "The Recommendation ITU-R P.676-12 – .NET" +date: 2025-01-24 +date-modified: 2025-06-12 +--- + +This page details the installation and usage of the .NET version of the PropLib implementation of the Recommendation ITU-R P.676-12. + +{{< include /includes/_link_to_model_home.qmd >}} + +## Installation + +This .NET package is distributed on +[NuGet](https://www.nuget.org/packages/ITS.ITU.PSeries.P676). + +There are two easy ways to install the NuGet package: [dotnet CLI](#installation-with-dotnet-cli) or [Visual Studio](#installation-with-visual-studio). + +### Installation with dotnet CLI + +1. Run the following command to install the package. + + ```default + dotnet add package ITS.ITU.PSeries.P676 + ``` + +1. After the command completes, open the project csproj file to see the added NuGet package reference: + + ```default + + + + ``` + +### Installation with Visual Studio + +1. Open your project in **Visual Studio** and select **Project > Manage NuGet Packages**. + +1. In the **NuGet Package Manager** page, choose **nuget.org** as the **Package source**. + +1. From the **Browse** tab, search for **ITS.ITU.PSeries.P676**, select ITS.ITU.PSeries.P676 in the list, and then select Install as shown in @fig-dotnet-add-nuget. + + ![](/images/dotnet/dotnet-add-nuget.png){#fig-dotnet-add-nuget fig-alt="A screenshot showing the 'NuGet Package Manager'" width=600 fig-align="left"} + +1. If you're prompted to verify the installation, select OK. + +## Examples + +The following code examples show how each of the three models from Recommendation ITU-R P.676 can be called from .NET project. + +### Specific Attenuation Model + +```c# +using ITS.ITU.PSeries; + +// define inputs +double f__ghz = 60.0; // Frequency, in GHz. +double T__kelvin = 288.15; // Temperature, in Kelvin. +double e__hPa = 9.97288879; // Water vapour partial pressure, in hPa. +double p__hPa = 1013.25; // Dry air pressure, in hPa. + +// Call Specific Attenuation Model +double gamma = P676.SpecificAttenuation(f__ghz, T__kelvin, e__hPa, p__hPa); + +// gamma is approximately 14.7783 dB/km +``` + +### Terrestrial Path Attenuation Model + +```c# +using ITS.ITU.PSeries; + +// Define inputs +double f__ghz = 56.0; // Frequency, in GHz. +int int_atmosphere = 5; // Reference atmosphere from P.835 (enum value). +double r_0__km = 15.6; // Path length, in km. + +// Call Terrestrial Path Attenuation Model +int rtn = P676.TerrestrialPathAttenuation(f__ghz, int_atmosphere, r_0__km, out double A_gas__db); +// rtn is 0 (SUCCESS) +// A_gas__db is approximately 109.4131 dB + +// Alternately, atmosphere can be specified using the enum: +P676.ReferenceAtmosphere atmosphere = P676.ReferenceAtmosphere.LowLatitude; +rtn = P676.TerrestrialPathAttenuation(f__ghz, atmosphere, r_0__km, out double A_gas__db); + +// rtn is 0 (SUCCESS) +// A_gas__db is approximately 109.4131 dB +``` + +### Slant Path Attenuation Model + +```c# +using ITS.ITU.PSeries; + +// define inputs +double f__ghz = 26.0; // Frequency, in GHz. +double h_1__km = 0.0; // Height of the low terminal, in km. +double h_2__km = 30.0; // Height of the high terminal, in km. +double beta_1__rad = 1.55; // Elevation angle (from zenith), in rad. +P676.ReferenceAtmosphere atmosphere = P676.ReferenceAtmosphere.MidLatitudeSummer; // Reference atmosphere from P.835. + +// Call Slant Path Attenuation Model +int rtn = P676.SlantPathAttenuation(f__ghz, h_1__km, h_2__km, beta_1__rad, + atmosphere, out P676.SlantPathAttenuationResult result); + +// rtn is 0 (SUCCESS) +// The result is a data structure containing five elements: +// result.A_gas__db is approximately 16.9083 dB +// result.bending__rad is approximately 0.0095 rad +// result.a__km is approximately 538.1633 km +// result.incident__rad is approximately 1.4753 rad +// result.delta_L__km is approximately 0.0657 km +``` \ No newline at end of file diff --git a/models/P676/driver.qmd b/models/P676/driver.qmd new file mode 100644 index 0000000..c0950e9 --- /dev/null +++ b/models/P676/driver.qmd @@ -0,0 +1,215 @@ +--- +title: "The Recommendation ITU-R P.676-12 – Command-Line Driver" +date: 2025-01-10 +date-modified: 2025-06-12 +--- + +This page details the usage of the cross-platform command-line driver version of the Recommendation ITU-R P.676-12. + +{{< include /includes/driver/_intro_and_installation.qmd >}} + +To use the command-line driver program, you'll need to download the driver program +(`P676Driver-1.0.0-Windows-x64.exe` or `P676Driver-1.0.0-Windows-x86.exe` on Windows, `P676Driver-1.0.0-Darwin-universal` on macOS, or `P676Driver-1.0.0-Linux-x86_64` on Linux) + and the shared library (`.dll` on Windows, `.dylib` on macOS, or `.so` on Linux). + These are distributed for each supported platform as part of the [GitHub Releases](https://github.com/NTIA/p676/releases/). + +{{< include /includes/driver/_general_usage.qmd >}} + +## Command-Line Arguments + +Executing the command-line driver requires specifying input arguments, defined in @tbl-p676-driver-input-args below. + + +| Flag | Type | Required | Description | +|----------|--------|----------|--------------------------------------------------------------| +| `-i` | string | true | File specifying model input parameters in `key,value` format | +| `-model` | string | true | Which model to run, one of `SPEC`, `TERR`, or `SLANT` | +| `-o` | string | true | Filename where output results should be written | +: Arguments for the Recommendation ITU-R P.676 command-line driver {#tbl-p676-driver-input-args} + +Additional arguments are available to print help text and version information without running any model. +When using these options, none of the arguments from @tbl-p676-driver-input-args are required. +The additional arguments are defined in @tbl-p676-driver-additional-args + +| Flag | Description | +|------|--------------------------------------------------------| +| `-h` | Display help text | +| `-v` | Display version information for the library and driver | +: Additional arguments for the Recommendation ITU-R P.676 command-line driver {#tbl-p676-driver-additional-args} + +## Examples + +### Specific Attenuation Model + +The Specific Attenuation Model can be run by providing the `-model SPEC` flag on the command line. +For example: + +```cmd +# Windows (64-bit) +P676Driver-1.0.0-Windows-x64.exe -i inputSPEC.txt -model SPEC -o outputSPEC.txt + +# macOS +./P676Driver-1.0.0-Darwin-universal -i inputSPEC.txt -model SPEC -o outputSPEC.txt + +# Linux +./P676Driver-1.0.0-Linux-x86_64 -i inputSPEC.txt -model SPEC -o outputSPEC.txt +``` + +A corresponding pair of input and output files for the Specific Attenuation Model are provided below. + +```{.default filename="Input File Contents"} +f__ghz,60 +T__kelvin,288.15 +e__hPa,9.97288879 +p__hPa,1013.25 +``` + +```{.default filename="Output File Contents"} +Model P676 +Model Variant Specific Attenuation Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Tue Jul 08 12:19:49 2025 +Input Arguments -i inputSPEC.txt -model SPEC -o outputSPEC.txt + +Inputs: +f__ghz 60 [GHz] +t__kelvin 288.15 [Kelvin] +e__hpa 9.97289 [hPa] +p__hpa 1013.25 [hPa] + +Results: +Return Code 0 [P676 v1.0 Status: Successful execution] +Specific gaseous attenuation 14.77832 [dB/km] +``` + +### Terrestrial Path Attenuation Model + +The Terrestrial Path Attenuation Model can be run by providing the `-model TERR` flag on the command line. +For example: + +```cmd +# Windows (64-bit) +P676Driver-1.0.0-Windows-x64.exe -i inputTERR.txt -model TERR -o outputTERR.txt + +# macOS +./P676Driver-1.0.0-Darwin-universal -i inputTERR.txt -model TERR -o outputTERR.txt + +# Linux +./P676Driver-1.0.0-Linux-x86_64 -i inputTERR.txt -model TERR -o outputTERR.txt +``` + +A corresponding pair of input and output files for the Terrestrial Path Attenuation Model are provided below. + +```{.default filename="Input File Contents"} +f__ghz,56 +T__kelvin,288.15 +e__hPa,9.97288879 +p__hPa,1013.25 +atmosphere,5 +r_0__km,15.6 +``` + +```{.default filename="Output File Contents"} +Model P676 +Model Variant Terrestrial Path Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Tue Jul 08 12:21:23 2025 +Input Arguments -i inputTERR.txt -model TERR -o outputTERR.txt + +Inputs: +f__ghz 56 [GHz] +t__kelvin 288.15 [Kelvin] +e__hpa 9.97289 [hPa] +p__hpa 1013.25 [hPa] +atmosphere 5 [Low-latitude annual reference atmosphere] +r_0__km 15.6 [km] + +Results: +Return Code 0 [P676 v1.0 Status: Successful execution] +Gaseous attenuation 109.41314 [dB] +``` + +### Slant Path Attenuation Model + +The Slant Path Attenuation Model can be run by providing the `-model SLANT` flag on the command line. +For example: + +```cmd +# Windows (64-bit) +P676Driver-1.0.0-Windows-x64.exe -i inputSLANT.txt -model SLANT -o outputSLANT.txt + +# macOS +./P676Driver-1.0.0-Darwin-universal -i inputSLANT.txt -model SLANT -o outputSLANT.txt + +# Linux +./P676Driver-1.0.0-Linux-x86_64 -i inputSLANT.txt -model SLANT -o outputSLANT.txt +``` + +**Example 1** + +A corresponding pair of input and output files for the Slant Path Attenuation Model with **INVALID** inputs are provided below. + +```{.default filename="Input File Contents"} +f__ghz,26 +h_1__km,0 +h_2__km,30 +beta_1__rad,1.55 +atmosphere,7 +``` + +```{.default filename="Output File Contents"} +Model P676 +Model Variant Slant Path Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Tue Jul 08 12:22:38 2025 +Input Arguments -i inputSLANT.txt -model SLANT -o outputSLANT.txt + +Inputs: +f__ghz 26 [GHz] +h_1__km 0 [km] +h_2__km 30 [km] +beta_1__rad 1.55 [rad] +atmosphere 7 [Invalid atmosphere] + +Results: +Return Code 32 [P676 v1.0 Error: Invalid value for atmosphere] +``` + +**Example 2** + +A corresponding pair of input and output files for the Slant Path Attenuation Model with **VALID** inputs are provided below. + +```{.default filename="Input File Contents"} +f__ghz,26 +h_1__km,0 +h_2__km,30 +beta_1__rad,1.55 +atmosphere,3 +``` + +```{.default filename="Output File Contents"} +Model P676 +Model Variant Slant Path Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Tue Jul 08 12:23:23 2025 +Input Arguments -i inputSLANT.txt -model SLANT -o outputSLANT.txt + +Inputs: +f__ghz 26 [GHz] +h_1__km 0 [km] +h_2__km 30 [km] +beta_1__rad 1.55 [rad] +atmosphere 3 [Summer Mid-latitude reference atmosphere] + +Results: +Return Code 0 [P676 v1.0 Status: Successful execution] +Gaseous attenuation 16.90827 [dB] +Bending angle 0.00950 [rad] +Ray length 538.16348 [km] +Incident angle at h_2 1.47533 [rad] +Excess atmospheric path length 0.06565 [km] +``` \ No newline at end of file diff --git a/models/P676/index.qmd b/models/P676/index.qmd new file mode 100644 index 0000000..350895e --- /dev/null +++ b/models/P676/index.qmd @@ -0,0 +1,101 @@ +--- +title: "Recommendation ITU-R P.676-12" +date: 2024-12-02 +date-modified: 2025-06-12 +--- + +The Recommendation ITU-R P.676-12 provides methods to estimate the attenuation of +atmospheric gases on terrestrial and slant paths [@p676-12]. +This implementation contains three major methods of predicting the specific and path +gaseous attenuation due to oxygen and water vapour: Specific attenuation, Terrestrial +path attenuation, and Slant path attenuation. +It implements Annex 1 of the Recommendation: Line-by-line calculation of gaseous attenuation. +In addition to the three major methods, it also provides some intermedia methods. + +{{< include /includes/_getting_started.qmd >}} + +## Functions + +### Specific Attenuation Model + +This model implements Recommendation ITU-R P.676-12(08/2019) [@p676-12, Annex1.1 Equation (1)]. The inputs for this model are shown below in @tbl-p676-inputs-specific-attenuation. + +| Variable | Type | Units | Limits | Description | +|-------------|--------|--------|----------------------|-------------------------------| +| `f__ghz` | double | GHz | $0 \leq f \leq 1000$ | Frequency | +| `T__kelvin` | double | Kelvin | $T \geq 0$ | Temperature | +| `e__hPa` | double | hPa | $e \geq 0$ | Water vapour partial pressure | +| `p__hPa` | double | hPa | $p \geq 0$ | Dry air pressure | +: Inputs for the specific attenuation model {#tbl-p676-inputs-specific-attenuation} + +The output of this model is a double value in dB/km. + +{{< include /includes/_code_examples.qmd >}} + +[C++](cpp.qmd#specific-attenuation-model){.btn .btn-secondary .btn role="button"} +[.NET](dotnet.qmd#specific-attenuation-model){.btn .btn-secondary .btn role="button"} +[MATLAB](matlab.qmd#specific-attenuation-model){.btn .btn-secondary .btn role="button"} +[Python](python.qmd#specific-attenuation-model){.btn .btn-secondary .btn role="button"} + +### Terrestrial Path Gaseous Attenuation Model + +This model implements Recommendation ITU-R P.676-12(08/2019) [@p676-12, Annex1.2.1 Equation (10)]. The inputs for this model are shown below in @tbl-p676-inputs-terrestrial-path-attenuation. + +| Variable | Type | Units | Limits | Description | +|--------------|--------|-------|--------------------------|---------------------------------| +| `f__ghz` | double | GHz | $0 \leq f \leq 1000$ | Frequency | +| `atmosphere` | enum | N/A | See @tbl-p676-atmosphere | Reference atmosphere from P.835 | +| `r_0__km` | double | km | $r_0 \geq 0$ | Path length | +: Inputs for the terrestrial path gaseous attenuation model {#tbl-p676-inputs-terrestrial-path-attenuation} + +The `atmosphere` input must be one of the following valid supported reference atmosphere from P.835 [@p835-6], as defined in @tbl-p676-atmosphere. + +| Enum Value | Reference Atmosphere | Description | +|------------|-----------------------------|-------------------------------------------| +| 0 | ATMOSPHERE__MAGRA | Mean annual global reference atmosphere | +| 1 | ATMOSPHERE__HIGH_LAT_SUMMER | Summer High latitude reference atmosphere | +| 2 | ATMOSPHERE__HIGH_LAT_WINTER | Winter High latitude reference atmosphere | +| 3 | ATMOSPHERE__MID_LAT_SUMMER | Summer Mid-latitude reference atmosphere | +| 4 | ATMOSPHERE__MID_LAT_WINTER | Winter Mid-latitude reference atmosphere | +| 5 | ATMOSPHERE__LOW_LAT | Low-latitude annual reference atmosphere | +: Allowed reference atmosphere from P.835 {#tbl-p676-atmosphere} + +The output of this model is a double value in dB. + +{{< include /includes/_code_examples.qmd >}} + +[C++](cpp.qmd#terrestrial-path-attenuation-model){.btn .btn-secondary .btn role="button"} +[.NET](dotnet.qmd#terrestrial-path-attenuation-model){.btn .btn-secondary .btn role="button"} +[MATLAB](matlab.qmd#terrestrial-path-attenuation-model){.btn .btn-secondary .btn role="button"} +[Python](python.qmd#terrestrial-path-attenuation-model){.btn .btn-secondary .btn role="button"} + +### Slant Path Gaseous Attenuation Model + +This model implements Recommendation ITU-R P.676-12(08/2019) [@p676-12, Annex1.2.2]. The inputs for this model are shown below in @tbl-p676-inputs-slant-path-attenuation. + +| Variable | Type | Units | Limits | Description | +|---------------|--------|-------|--------------------------|---------------------------------| +| `f__ghz` | double | GHz | $0 \leq f \leq 1000$ | Frequency | +| `h_1__km` | double | km | $h_1 \geq 0$ | Height of the low terminal | +| `h_2__km` | double | km | $h_2 \geq 0$ | Height of the high terminal | +| `beta_1__rad` | double | rad | $beta_1 \geq 0$ | Elevation angle (from zenith) | +| `atmosphere` | enum | N/A | See @tbl-p676-atmosphere | Reference atmosphere from P.835 | +: Inputs for the slant path gaseous attenuation model {#tbl-p676-inputs-slant-path-attenuation} + +The slant path gaseous attenuation model produces an output which contains five values which are provided in @tbl-p676-outputs. + +| Variable | Type | Units | Description | +|-----------------|---------|-------|--------------------------------| +| `A_gas__db` | double | dB | Gaseous attenuation | +| `bending__rad` | double | rad | Bending angle | +| `a__km` | double | km | Ray length | +| `incident__rad` | double | rad | Incident angle at h_2 | +| `delta_L__km` | double | km | Excess atmospheric path length | +: Outputs of the slant path gaseous attenuation model {#tbl-p676-outputs} + +{{< include /includes/_code_examples.qmd >}} + +[C++](cpp.qmd#slant-path-attenuation-model){.btn .btn-secondary .btn role="button"} +[.NET](dotnet.qmd#slant-path-attenuation-model){.btn .btn-secondary .btn role="button"} +[MATLAB](matlab.qmd#slant-path-attenuation-model){.btn .btn-secondary .btn role="button"} +[Python](python.qmd#slant-path-attenuation-model){.btn .btn-secondary .btn role="button"} diff --git a/models/P676/matlab.qmd b/models/P676/matlab.qmd new file mode 100644 index 0000000..6e153fd --- /dev/null +++ b/models/P676/matlab.qmd @@ -0,0 +1,98 @@ +--- +title: "The Recommendation ITU-R P.676-12 – MATLAB" +date: 2025-01-24 +date-modified: 2025-06-12 +--- + +This page details the installation and usage of the MATLAB® version of the PropLib implementation of Recommendation ITU-R P.676-12. + +{{< include /includes/_link_to_model_home.qmd >}} + +## Getting Started + +This MATLAB® Toolbox is distributed on [MathWorks® File Exchange](#TODO). + +{{< include /includes/matlab/_getting_started.qmd >}} + +{{< include /includes/matlab/_documentation.qmd >}} + +```matlab +help ITS.ITU.PSeries.P676.SpecificAttenuation + +% Prints detailed usage information! +``` + +{{< include /includes/matlab/_examples.qmd >}} + +### Specific Attenuation Model + +```matlab +import ITS.ITU.PSeries.P676.* + +% Define inputs +f__ghz = 60.0; % Frequency, in GHz. +T__kelvin = 288.15; % Temperature, in Kelvin. +e__hPa = 9.97288879; % Water vapour partial pressure, in hPa. +p__hPa = 1013.25; % Dry air pressure, in hPa. + +% Call Specific Attenuation Model +gamma = SpecificAttenuation(f__ghz, T__kelvin, e__hPa, p__hPa); +% gamma is approximately 14.7783 dB/km +``` + +### Terrestrial Path Attenuation Model + +This example shows multiple equivalent ways to specify the reference atmosphere input. + +```matlab +import ITS.ITU.PSeries.P676.* + +% Define inputs +f__ghz = 56.0; % Frequency, in GHz. +atmosphere = 5; % Reference atmosphere from P.835. +r_0__km = 15.6; % Path length, in km. + +% Call Terrestrial Path Attenuation Model +A_gas__db = TerrestrialPathAttenuation(f__ghz, atmosphere, r_0__km); +% A_gas__db is approximately 109.4131 dB + +% can also use enum to provide reference atmosphere +atmosphere = ReferenceAtmosphere.LowLatitude; % int value is 5 +A_gas__db = TerrestrialPathAttenuation(f__ghz, atmosphere, r_0__km); + +% another way to provide the enum value: +atmosphere = "LowLatitude"; % int value is 5 +A_gas__db = TerrestrialPathAttenuation(f__ghz, atmosphere, r_0__km); +``` + +### Slant Path Attenuation Model + +```matlab +import ITS.ITU.PSeries.P676.* + +% define inputs +f__ghz = 26.0; % Frequency, in GHz. +h_1__km = 0.0; % Height of the low terminal, in km. +h_2__km = 30.0; % Height of the high terminal, in km. +beta_1__rad = 1.55; % Elevation angle (from zenith), in rad. +atmosphere = 3; % Reference atmosphere from P.835. + +% Call Slant Path Attenuation Model +result = SlantPathAttenuation(f__ghz, h_1__km, h_2__km, beta_1__rad, atmosphere); +% The result is a data structure containing five elements: +% result.A_gas__db is approximately 16.9083 dB +% result.bending__rad is approximately 0.0095 rad +% result.a__km is approximately 538.1633 km +% result.incident__rad is approximately 1.4753 rad +% result.delta_L__km is approximately 0.0657 km + +% can also use enum to provide reference atmosphere +atmosphere = ReferenceAtmosphere.MidLatitudeSummer; % int value is 3 +result = SlantPathAttenuation(f__ghz, h_1__km, h_2__km, beta_1__rad, atmosphere); +% The result is a data structure containing five elements: +% result.A_gas__db is approximately 16.9083 dB +% result.bending__rad is approximately 0.0095 rad +% result.a__km is approximately 538.1633 km +% result.incident__rad is approximately 1.4753 rad +% result.delta_L__km is approximately 0.0657 km +``` \ No newline at end of file diff --git a/models/P676/python.qmd b/models/P676/python.qmd new file mode 100644 index 0000000..731356a --- /dev/null +++ b/models/P676/python.qmd @@ -0,0 +1,113 @@ +--- +title: "The Recommendation ITU-R P.676-12 – Python" +date: 2025-01-24 +date-modified: 2025-06-12 +--- + +This page details the installation and usage of the Python version of the PropLib implementation of Recommendation ITU-R P.676-12. + +{{< include /includes/_link_to_model_home.qmd >}} + +{{< include /includes/python/_getting_started.qmd >}} + +### Installation + +This Python package is distributed through the +[Python Package Index (PyPI)](https://pypi.org/project/proplib-p676). +Run the following command to install the package, and any required dependencies, into your Python environment. + +```default +pip install proplib-p676 +``` + +The following code snippet shows how to import the package and check the installed version. + +```python +from ITS.ITU.PSeries import P676 +print(P676.__version__) +``` + +{{< include /includes/python/_uninstallation.qmd >}} + +```default +pip uninstall proplib-p676 +``` + +{{< include /includes/python/_documentation.qmd >}} + +```python +from ITS.ITU.PSeries import P676 +help(P676.SpecificAttenuation) +``` + +## Examples + +The following code examples show how each of the three models from Recommendation ITU-R P.676 can be called from Python. + +### Specific Attenuation Model + +```python +from ITS.ITU.PSeries import P676 + +# define inputs +f__ghz = 60.0 # Frequency, in GHz. +T__kelvin = 288.15 # Temperature, in Kelvin. +e__hPa = 9.97288879 # Water vapour partial pressure, in hPa. +p__hPa = 1013.25 # Dry air pressure, in hPa. + +# Call Specific Attenuation Model +gamma = P676.SpecificAttenuation(f__ghz, T__kelvin, e__hPa, p__hPa) +# gamma is approximately 14.77832 dB/km +``` + +### Terrestrial Path Attenuation Model + +```python +from ITS.ITU.PSeries import P676 + +# define inputs +f__ghz = 56.0 # Frequency, in GHz. +atmosphere = 5 # Reference atmosphere from P.835. +r_0__km = 15.6 # Path length, in km. + +# Call Terrestrial Path Attenuation Model +A_gas__db = P676.TerrestrialPathAttenuation(f__ghz, atmosphere, r_0__km) +# A_gas__db is approximately 109.41314 dB + +# can also use enum to provide reference atmosphere +atmosphere = P676.ReferenceAtmosphere.LowLatitude # int value is 5 +A_gas__db = P676.TerrestrialPathAttenuation(f__ghz, atmosphere, r_0__km) +# A_gas__db is approximately 109.41314 dB +``` + +### Slant Path Attenuation Model + +```python +from ITS.ITU.PSeries import P676 + +# define inputs +f__ghz = 26.0 # Frequency, in GHz. +h_1__km = 0.0 # Height of the low terminal, in km. +h_2__km = 30.0 # Height of the high terminal, in km. +beta_1__rad = 1.55 # Elevation angle (from zenith), in rad. +atmosphere = 3 # Reference atmosphere from P.835. + +# Call Slant Path Attenuation Model +result = P676.SlantPathAttenuation(f__ghz, h_1__km, h_2__km, beta_1__rad, atmosphere) +# The result is a data structure containing five elements: +# result.A_gas__db is approximately 16.90827 dB +# result.bending__rad is approximately 0.00950 rad +# result.a__km is approximately 538.16348 km +# result.incident__rad is approximately 1.47533 rad +# result.delta_L__km is approximately 0.06565 km + +# can also use enum to provide reference atmosphere +atmosphere = P676.ReferenceAtmosphere.MidLatitudeSummer # int value is 3 +result = P676.SlantPathAttenuation(f__ghz, h_1__km, h_2__km, beta_1__rad, atmosphere) +# The result is a data structure containing five elements: +# result.A_gas__db is approximately 16.90827 dB +# result.bending__rad is approximately 0.00950 rad +# result.a__km is approximately 538.16348 km +# result.incident__rad is approximately 1.47533 rad +# result.delta_L__km is approximately 0.06565 km +``` \ No newline at end of file diff --git a/models/P835/_metadata.yml b/models/P835/_metadata.yml new file mode 100644 index 0000000..74e30cf --- /dev/null +++ b/models/P835/_metadata.yml @@ -0,0 +1,15 @@ +format: + html: + code-links: + - text: NTIA/p835 + icon: github + href: https://github.com/NTIA/p835 + - text: NTIA/p835-dotnet + icon: github + href: https://github.com/NTIA/p835-dotnet + - text: NTIA/p835-matlab + icon: github + href: https://github.com/NTIA/p835-matlab + - text: NTIA/p835-python + icon: github + href: https://github.com/NTIA/p835-python \ No newline at end of file diff --git a/models/P835/cpp.qmd b/models/P835/cpp.qmd new file mode 100644 index 0000000..d57edf5 --- /dev/null +++ b/models/P835/cpp.qmd @@ -0,0 +1,184 @@ +--- +title: "The Recommendation ITU-R P.835-6 – C++" +date: 2024-12-02 +date-modified: 2025-06-12 +--- + +This page details the installation and usage of the C++ version of the PropLib implementation of the Recommendation ITU-R P.835-6. + +{{< include /includes/_link_to_model_home.qmd >}} + +## Installation + +To use the C++ library in your code, you'll need to download the shared library (`.dll` on Windows, `.dylib` on macOS, or `.so` on Linux) and the header file. These are distributed for each supported platform as part of the [GitHub Releases](https://github.com/NTIA/p835/releases/). + +To use the shared library in your project, you'll need to link against it. The details for this process differ depending on your compiler and/or IDE, but generally you will need to somehow provide the path to the files you downloaded from the GitHub release. + +Once you've linked the dynamic library to your project, all you need to do is include the appropriate header file and, optionally, use its namespace: + +```cpp +#include "P835.h" + +using namespace ITS::ITU::PSeries::P835; // Optional: makes later code more concise +``` + +This library has no external C++ dependencies. + +{{< include /includes/cpp/_documentation.qmd >}} + +[Docs](https://ntia.github.io/p835){.btn .btn-secondary .btn role="button"} + +## Examples + +The following code example shows how each of the functions from the Recommendation ITU-R P.835 can be called in a C++ program. + +### Mean Annual Global Reference Atmosphere + +```cpp +#include "P835.h" +using namespace ITS::ITU::PSeries::P835; + +int main() { + // Define inputs + double h__km = 15.0; // Geometric height, in km + double rho_0__g_m3 = 7.5; // Ground-level water vapour density, in g/m^3 + + // Call Mean Annual Global Reference Atmosphere functions + double T__kelvin = GlobalTemperature(h__km); + // T__kelvin is approx. 216.65 Kelvin + + double p__hPa = GlobalPressure(h__km); + // p__hPa is approx. 121.1193 hPa + + double rho__g_m3 = GlobalWaterVapourDensity(h__km, rho_0__g_m3); + // rho__g_m3 is approx. 0.004148 g/m^3 + + double e__hPa = GlobalWaterVapourPressure(h__km, rho_0__g_m3); + // e__hPa is approx. 0.004147 hPa +} +``` + +### Low-latitude Annual Reference Atmosphere + +```cpp +#include "P835.h" +using namespace ITS::ITU::PSeries::P835; + +int main() { + // Define inputs + double h__km = 10.0; // Geometric height, in km + + // Call Low-latitude Annual Reference Atmosphere functions + double T__kelvin = LowLatitudeTemperature(h__km); + // T__kelvin is approx. 237.478 Kelvin + + double p__hPa = LowLatitudePressure(h__km); + // p__hPa is approx. 284.853 hPa + + double rho__g_m3 = LowLatitudeWaterVapourDensity(h__km); + // rho__g_m3 is approx. 0.051421 g/m^3 + + double e__hPa = LowLatitudeWaterVapourPressure(h__km); + // e__hPa is approx. 0.0563514 hPa +} +``` + +### Mid-latitude Summer Reference Atmosphere + +```cpp +#include "P835.h" +using namespace ITS::ITU::PSeries::P835; + +int main() { + // Define inputs + double h__km = 10.0; // Geometric height, in km + + // Call Mid-latitude Summer Reference Atmosphere functions + double T__kelvin = MidLatitudeSummerTemperature(h__km); + // T__kelvin is approx. 235.716 Kelvin + + double p__hPa = MidLatitudeSummerPressure(h__km); + // p__hPa is approx. 283.71 hPa + + double rho__g_m3 = MidLatitudeSummerWaterVapourDensity(h__km); + // rho__g_m3 is approx. 0.0612398 g/m^3 + + double e__hPa = MidLatitudeSummerWaterVapourPressure(h__km); + // e__hPa is approx. 0.0666137 hPa +} +``` + +### Mid-latitude Winter Reference Atmosphere + +```cpp +#include "P835.h" +using namespace ITS::ITU::PSeries::P835; + +int main() { + // Define inputs + double h__km = 10.0; // Geometric height, in km + + // Call Mid-latitude Winter Reference Atmosphere functions + double T__kelvin = MidLatitudeWinterTemperature(h__km); + // T__kelvin is approx. 218 Kelvin + + double p__hPa = MidLatitudeWinterPressure(h__km); + // p__hPa is approx. 258.979 hPa + + double rho__g_m3 = MidLatitudeWinterWaterVapourDensity(h__km); + // rho__g_m3 is approx. 0.00998436 g/m^3 + + double e__hPa = MidLatitudeWinterWaterVapourPressure(h__km); + // e__hPa is approx. 0.0100443 hPa +} +``` + +### High-latitude Summer Reference Atmosphere + +```cpp +#include "P835.h" +using namespace ITS::ITU::PSeries::P835; + +int main() { + // Define inputs + double h__km = 8.0; // Geometric height, in km + + // Call High-latitude Summer Reference Atmosphere functions + double T__kelvin = HighLatitudeSummerTemperature(h__km); + // T__kelvin is approx. 239.621 Kelvin + + double p__hPa = HighLatitudeSummerPressure(h__km); + // p__hPa is approx. 354.244 hPa + + double rho__g_m3 = HighLatitudeSummerWaterVapourDensity(h__km); + // rho__g_m3 is approx. 0.129769 g/m^3 + + double e__hPa = HighLatitudeSummerWaterVapourPressure(h__km); + // e__hPa is approx. 0.143495 hPa +} +``` + +### High-latitude Winter Reference Atmosphere + +```cpp +#include "P835.h" +using namespace ITS::ITU::PSeries::P835; + +int main() { + // Define inputs + double h__km = 8.0; // Geometric height, in km + + // Call High-latitude Winter Reference Atmosphere functions + double T__kelvin = HighLatitudeWinterTemperature(h__km); + // T__kelvin is approx. 220.53 Kelvin + + double p__hPa = HighLatitudeWinterPressure(h__km); + // p__hPa is approx. 324.41 hPa + + double rho__g_m3 = HighLatitudeWinterWaterVapourDensity(h__km); + // rho__g_m3 is approx. 0.0177274 g/m^3 + + double e__hPa = HighLatitudeWinterWaterVapourPressure(h__km); + // e__hPa is approx. 0.0180407 hPa +} +``` diff --git a/models/P835/dotnet.qmd b/models/P835/dotnet.qmd new file mode 100644 index 0000000..b1824a2 --- /dev/null +++ b/models/P835/dotnet.qmd @@ -0,0 +1,189 @@ +--- +title: "The Recommendation ITU-R P.835-6 – .NET" +date: 2025-01-24 +date-modified: 2025-06-12 +--- + +This page details the installation and usage of the .NET version of the PropLib implementation of the Recommendation ITU-R P.835-6. + +{{< include /includes/_link_to_model_home.qmd >}} + +## Installation + +This .NET package is distributed on +[NuGet](https://www.nuget.org/packages/ITS.ITU.PSeries.P835). + +There are two easy ways to install the NuGet package: [dotnet CLI](#installation-with-dotnet-cli) or [Visual Studio](#installation-with-visual-studio). + +### Installation with dotnet CLI + +1. Run the following command to install the package. + + ```default + dotnet add package ITS.ITU.PSeries.P835 + ``` + +1. After the command completes, open the project csproj file to see the added NuGet package reference: + + ```default + + + + ``` + +### Installation with Visual Studio + +1. Open your project in **Visual Studio** and select **Project > Manage NuGet Packages**. + +1. In the **NuGet Package Manager** page, choose **nuget.org** as the **Package source**. + +1. From the **Browse** tab, search for **ITS.ITU.PSeries.P835**, select ITS.ITU.PSeries.P835 in the list, and then select Install as shown in @fig-dotnet-add-nuget. + + ![](/images/dotnet/dotnet-add-nuget.png){#fig-dotnet-add-nuget fig-alt="A screenshot showing the 'NuGet Package Manager'" width=600 fig-align="left"} + +1. If you're prompted to verify the installation, select OK. + +## Examples + +The following code examples show how each of the functions from Recommendation ITU-R P.835 can be called from .NET project. + +### Mean Annual Global Reference Atmosphere + +```c# +using ITS.ITU.PSeries; + +// Define inputs +double h__km = 15.0; // Geometric height, in km +double rho_0__g_m3 = 8.0; // Ground-level water vapour density, in g/m^3 + +// Call Mean Annual Global Reference Atmosphere functions +double T__kelvin = P835.MeanAnnualGlobalReferenceAtmosphere.GlobalTemperature(h__km); +// T__kelvin is approx. 216.65 Kelvin + +double p__hPa = P835.MeanAnnualGlobalReferenceAtmosphere.GlobalPressure(h__km); +// p__hPa is approx. 121.1193 hPa + +double rho__g_m3 = P835.MeanAnnualGlobalReferenceAtmosphere.GlobalWaterVapourDensity(h__km, rho_0__g_m3); +// rho__g_m3 is approx. 0.0044247 g/m^3 + +// or omit rho_0__g_m3, using default Ground-level water vapour density, which is 7.5: +// double rho__g_m3 = P835.MeanAnnualGlobalReferenceAtmosphere.GlobalWaterVapourDensity(h__km); +// rho__g_m3 is approx. 0.004148 g/m^3 + +double e__hPa = P835.MeanAnnualGlobalReferenceAtmosphere.GlobalWaterVapourPressure(h__km, rho_0__g_m3); +// e__hPa is approx. 0.0044237 hPa + +// or omit rho_0__g_m3, using default Ground-level water vapour density, which is 7.5: +// double e__hPa = P835.MeanAnnualGlobalReferenceAtmosphere.GlobalWaterVapourPressure(h__km); +// e__hPa is approx. 0.004147 hPa +``` + +### Low-latitude Annual Reference Atmosphere + +```c# +using ITS.ITU.PSeries; + +// Define inputs +double h__km = 10.0; // Geometric height, in km + +// Call Low-latitude Annual Reference Atmosphere functions +double T__kelvin = P835.LowLatitudeAtmosphere.Temperature(h__km); +// T__kelvin is approx. 237.478 Kelvin + +double p__hPa = P835.LowLatitudeAtmosphere.Pressure(h__km); +// p__hPa is approx. 284.853 hPa + +double rho__g_m3 = P835.LowLatitudeAtmosphere.WaterVapourDensity(h__km); +// rho__g_m3 is approx. 0.051421 g/m^3 + +double e__hPa = P835.LowLatitudeAtmosphere.WaterVapourPressure(h__km); +// e__hPa is approx. 0.0563514 hPa +``` + +### Mid-latitude Summer Reference Atmosphere + +```c# +using ITS.ITU.PSeries; + +// Define inputs +double h__km = 10.0; // Geometric height, in km + +// Call Mid-latitude Summer Reference Atmosphere functions +double T__kelvin = P835.MidLatitudeAtmosphere.SummerTemperature(h__km); +// T__kelvin is approx. 235.716 Kelvin + +double p__hPa = P835.MidLatitudeAtmosphere.SummerPressure(h__km); +// p__hPa is approx. 283.71 hPa + +double rho__g_m3 = P835.MidLatitudeAtmosphere.SummerWaterVapourDensity(h__km); +// rho__g_m3 is approx. 0.0612398 g/m^3 + +double e__hPa = P835.MidLatitudeAtmosphere.SummerWaterVapourPressure(h__km); +// e__hPa is approx. 0.0666137 hPa +``` + +### Mid-latitude Winter Reference Atmosphere + +```c# +using ITS.ITU.PSeries; + +// Define inputs +double h__km = 10.0; // Geometric height, in km + +// Call Mid-latitude Winter Reference Atmosphere functions +double T__kelvin = P835.MidLatitudeAtmosphere.WinterTemperature(h__km); +// T__kelvin is approx. 218 Kelvin + +double p__hPa = P835.MidLatitudeAtmosphere.WinterPressure(h__km); +// p__hPa is approx. 258.979 hPa + +double rho__g_m3 = P835.MidLatitudeAtmosphere.WinterWaterVapourDensity(h__km); +// rho__g_m3 is approx. 0.00998436 g/m^3 + +double e__hPa = P835.MidLatitudeAtmosphere.WinterWaterVapourPressure(h__km); +// e__hPa is approx. 0.0100443 hPa +``` + +### High-latitude Summer Reference Atmosphere + +```c# +using ITS.ITU.PSeries; + +// Define inputs +double h__km = 8.0; // Geometric height, in km + +// Call High-latitude Summer Reference Atmosphere functions +double T__kelvin = P835.HighLatitudeAtmosphere.SummerTemperature(h__km); +// T__kelvin is approx. 239.621 Kelvin + +double p__hPa = P835.HighLatitudeAtmosphere.SummerPressure(h__km); +// p__hPa is approx. 354.244 hPa + +double rho__g_m3 = P835.HighLatitudeAtmosphere.SummerWaterVapourDensity(h__km); +// rho__g_m3 is approx. 0.129769 g/m^3 + +double e__hPa = P835.HighLatitudeAtmosphere.SummerWaterVapourPressure(h__km); +// e__hPa is approx. 0.143495 hPa +``` + +### High-latitude Winter Reference Atmosphere + +```c# +using ITS.ITU.PSeries; + +// Define inputs +double h__km = 8.0; // Geometric height, in km + +// Call High-latitude Winter Reference Atmosphere functions +double T__kelvin = P835.HighLatitudeAtmosphere.WinterTemperature(h__km); +// T__kelvin is approx. 220.53 Kelvin + +double p__hPa = P835.HighLatitudeAtmosphere.WinterPressure(h__km); +// p__hPa is approx. 324.41 hPa + +double rho__g_m3 = P835.HighLatitudeAtmosphere.WinterWaterVapourDensity(h__km); +// rho__g_m3 is approx. 0.0177274 g/m^3 + +double e__hPa = P835.HighLatitudeAtmosphere.WinterWaterVapourPressure(h__km); +// e__hPa is approx. 0.0180407 hPa +``` diff --git a/models/P835/driver.qmd b/models/P835/driver.qmd new file mode 100644 index 0000000..f3bfb85 --- /dev/null +++ b/models/P835/driver.qmd @@ -0,0 +1,339 @@ +--- +title: "The Recommendation ITU-R P.835-6 – Command-Line Driver" +date: 2025-01-10 +date-modified: 2025-06-12 +--- + +This page details the usage of the cross-platform command-line driver version of the Recommendation ITU-R P.835-6. + +{{< include /includes/driver/_intro_and_installation.qmd >}} + +To use the command-line driver program, you'll need to download the driver program +(`P835Driver-1.0.0-Windows-x64.exe` or `P835Driver-1.0.0-Windows-x86.exe` on Windows, `P835Driver-1.0.0-Darwin-universal` on macOS, or `P835Driver-1.0.0-Linux-x86_64` on Linux) + and the shared library (`.dll` on Windows, `.dylib` on macOS, or `.so` on Linux). + These are distributed for each supported platform as part of the [GitHub Releases](https://github.com/NTIA/p835/releases/). + +{{< include /includes/driver/_general_usage.qmd >}} + +## Command-Line Arguments + +Executing the command-line driver requires specifying input arguments, defined in @tbl-p835-driver-input-args below. + + +| Flag | Type | Required | Description | +|----------|--------|----------|-------------------------------------------------------------------------------------------------------| +| `-i` | string | true | File specifying model input parameters in `key,value` format | +| `-model` | string | true | Which model to run, one of `MEAN`, `LOW`, `MID-SUMMER`, `MID-WINTER`, `HIGH-SUMMER`, or `HIGH-WINTER` | +| `-o` | string | true | Filename where output results should be written | +: Arguments for the Recommendation ITU-R P.835 command-line driver {#tbl-p835-driver-input-args} + +Additional arguments are available to print help text and version information without running any model. +When using these options, none of the arguments from @tbl-p835-driver-input-args are required. +The additional arguments are defined in @tbl-p835-driver-additional-args + +| Flag | Description | +|------|--------------------------------------------------------| +| `-h` | Display help text | +| `-v` | Display version information for the library and driver | +: Additional arguments for the Recommendation ITU-R P.835 command-line driver {#tbl-p835-driver-additional-args} + +## Examples + +### Mean Annual Global Reference Atmosphere + +The Mean Annual Global Reference Atmosphere Model can be run by providing the `-model MEAN` flag on the command line. +For example: + +```cmd +# Windows (64-bit) +P835Driver-1.0.0-Windows-x64.exe -i inputMEAN.txt -model MEAN -o outputMEAN.txt + +# macOS +./P835Driver-1.0.0-Darwin-universal -i inputMEAN.txt -model MEAN -o outputMEAN.txt + +# Linux +./P835Driver-1.0.0-Linux-x86_64 -i inputMEAN.txt -model MEAN -o outputMEAN.txt +``` + +A corresponding pair of input and output files for the Mean Annual Global Reference Atmosphere Model are provided below. + +**Example 1** + +```{.default filename="Input File Contents"} +h__km,2 +rho_0__g_m3,8.5 +``` + +```{.default filename="Output File Contents"} +Model P835 +Model Variant Mean Annual Global Reference Atmosphere Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Thu Jul 17 12:39:29 2025 +Input Arguments -i ..\inputMEAN.txt -o outputMEAN.txt -model MEAN + +Inputs: +h__km 2 [km] +rho_0__g_m3 8.5 [g/m^3] + +Results: +Return Code 0 [P835 v1.0 Status: Successful execution] +Global temperature 275.15409 [Kelvin] +Global dry air pressure 795.01422 [hPa] +Global water vapour density 3.12698 [g/m^3] +Global water vapour partial pressure 3.97047 [hPa] +``` + +**Example 2: Omit `rho_0__g_m3`, using default 7.5** + +```{.default filename="Input File Contents"} +h__km,2 +``` + +```{.default filename="Output File Contents"} +Model P835 +Model Variant Mean Annual Global Reference Atmosphere Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Fri Jul 18 10:24:43 2025 +Input Arguments -i ..\inputMEAN.txt -o outputMEAN.txt -model MEAN + +Inputs: +h__km 2 [km] +rho_0__g_m3 7.5 [g/m^3] + +Results: +Return Code 0 [P835 v1.0 Status: Successful execution] +Global temperature 275.15409 [Kelvin] +Global dry air pressure 795.01422 [hPa] +Global water vapour density 2.75910 [g/m^3] +Global water vapour partial pressure 3.50335 [hPa] +``` + +**Example 3: Invalid `h__km`** + +```{.default filename="Input File Contents"} +h__km,200 +rho_0__g_m3,8.5 +``` + +```{.default filename="Output File Contents"} +Model P835 +Model Variant Mean Annual Global Reference Atmosphere Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Fri Jul 18 10:21:51 2025 +Input Arguments -i ..\inputMEAN.txt -o outputMEAN.txt -model MEAN + +Inputs: +h__km 200 [km] +rho_0__g_m3 8.5 [g/m^3] + +Results: +Return Code -1002 [P835 v1.0 Error: Geometry height must be <= 100] +``` + +### Low-latitude Annual Reference Atmosphere + +The Low-latitude Annual Reference Atmosphere Model can be run by providing the `-model LOW` flag on the command line. +For example: + +```cmd +# Windows (64-bit) +P835Driver-1.0.0-Windows-x64.exe -i inputLOW.txt -model LOW -o outputLOW.txt + +# macOS +./P835Driver-1.0.0-Darwin-universal -i inputLOW.txt -model LOW -o outputLOW.txt + +# Linux +./P835Driver-1.0.0-Linux-x86_64 -i inputLOW.txt -model LOW -o outputLOW.txt +``` + +A corresponding pair of input and output files for the Low-latitude Annual Reference Atmosphere Model are provided below. + +```{.default filename="Input File Contents"} +h__km,10 +``` + +```{.default filename="Output File Contents"} +Model P835 +Model Variant Low-latitude Reference Atmosphere Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Fri Jul 18 10:05:23 2025 +Input Arguments -i ..\inputLOW.txt -o outputLOW.txt -model LOW + +Inputs: +h__km 10 [km] + +Results: +Return Code 0 [P835 v1.0 Status: Successful execution] +Temperature 237.47780 [Kelvin] +Dry air pressure 284.85260 [hPa] +Water vapour density 0.05142 [g/m^3] +Water vapour partial pressure 0.05635 [hPa] +``` + +### Mid-latitude Summer Reference Atmosphere + +The Mid-latitude Summer Reference Atmosphere Model can be run by providing the `-model MID-SUMMER` or `-model MID_SUMMER` flag on the command line. +For example: + +```cmd +# Windows (64-bit) +P835Driver-1.0.0-Windows-x64.exe -i inputMID_SUMMER.txt -model MID-SUMMER -o outputMID_SUMMER.txt + +# macOS +./P835Driver-1.0.0-Darwin-universal -i inputMID_SUMMER.txt -model MID-SUMMER -o outputMID_SUMMER.txt + +# Linux +./P835Driver-1.0.0-Linux-x86_64 -i inputMID_SUMMER.txt -model MID-SUMMER -o outputMID_SUMMER.txt +``` + +A corresponding pair of input and output files for the Mid-latitude Summer Reference Atmosphere Model are provided bemid. + +```{.default filename="Input File Contents"} +h__km,8 +``` + +```{.default filename="Output File Contents"} +Model P835 +Model Variant Mid-latitude Summer Reference Atmosphere Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Wed Jul 23 09:13:07 2025 +Input Arguments -i inputMID_SUMMER.txt -model MID-SUMMER -o outputMID_SUMMER.txt + +Inputs: +h__km 8 [km] + +Results: +Return Code 0 [P835 v1.0 Status: Successful execution] +Temperature 248.70684 [Kelvin] +Dry air pressure 367.69780 [hPa] +Water vapour density 0.19688 [g/m^3] +Water vapour partial pressure 0.22596 [hPa] +``` + +### Mid-latitude Winter Reference Atmosphere + +The Mid-latitude Winter Reference Atmosphere Model can be run by providing the `-model MID-WINTER` or `-model MID_WINTER` flag on the command line. +For example: + +```cmd +# Windows (64-bit) +P835Driver-1.0.0-Windows-x64.exe -i inputMID_WINTER.txt -model MID-WINTER -o outputMID_WINTER.txt + +# macOS +./P835Driver-1.0.0-Darwin-universal -i inputMID_WINTER.txt -model MID-WINTER -o outputMID_WINTER.txt + +# Linux +./P835Driver-1.0.0-Linux-x86_64 -i inputMID_WINTER.txt -model MID-WINTER -o outputMID_WINTER.txt +``` + +A corresponding pair of input and output files for the Mid-latitude Winter Reference Atmosphere Model are provided bemid. + +```{.default filename="Input File Contents"} +h__km,8 +``` + +```{.default filename="Output File Contents"} +Model P835 +Model Variant Mid-latitude Winter Reference Atmosphere Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Wed Jul 23 09:29:35 2025 +Input Arguments -i inputMID_WINTER.txt -model MID-WINTER -o outputMID_WINTER.txt + +Inputs: +h__km 8 [km] + +Results: +Return Code 0 [P835 v1.0 Status: Successful execution] +Temperature 232.49290 [Kelvin] +Dry air pressure 333.66430 [hPa] +Water vapour density 0.05034 [g/m^3] +Water vapour partial pressure 0.05401 [hPa] +``` + +### High-latitude Summer Reference Atmosphere + +The High-latitude Summer Reference Atmosphere Model can be run by providing the `-model HIGH-SUMMER` or `-model HIGH_SUMMER` flag on the command line. +For example: + +```cmd +# Windows (64-bit) +P835Driver-1.0.0-Windows-x64.exe -i inputHIGH_SUMMER.txt -model HIGH_SUMMER -o outputHIGH_SUMMER.txt + +# macOS +./P835Driver-1.0.0-Darwin-universal -i inputHIGH_SUMMER.txt -model HIGH_SUMMER -o outputHIGH_SUMMER.txt + +# Linux +./P835Driver-1.0.0-Linux-x86_64 -i inputHIGH_SUMMER.txt -model HIGH_SUMMER -o outputHIGH_SUMMER.txt +``` + +A corresponding pair of input and output files for the High-latitude Summer Reference Atmosphere Model are provided behigh. + +```{.default filename="Input File Contents"} +h__km,5 +``` + +```{.default filename="Output File Contents"} +Model P835 +Model Variant High-latitude Summer Reference Atmosphere Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Wed Jul 23 10:36:14 2025 +Input Arguments -i inputHIGH_SUMMER.txt -model HIGH_SUMMER -o outputHIGH_SUMMER.txt + +Inputs: +h__km 5 [km] + +Results: +Return Code 0 [P835 v1.0 Status: Successful execution] +Temperature 259.42990 [Kelvin] +Dry air pressure 540.30080 [hPa] +Water vapour density 1.00951 [g/m^3] +Water vapour partial pressure 1.20857 [hPa] +``` + +### High-latitude Winter Reference Atmosphere + +The High-latitude Winter Reference Atmosphere Model can be run by providing the `-model HIGH-WINTER` or `-model HIGH_WINTER` flag on the command line. +For example: + +```cmd +# Windows (64-bit) +P835Driver-1.0.0-Windows-x64.exe -i inputHIGH_WINTER.txt -model HIGH_WINTER -o outputHIGH_WINTER.txt + +# macOS +./P835Driver-1.0.0-Darwin-universal -i inputHIGH_WINTER.txt -model HIGH_WINTER -o outputHIGH_WINTER.txt + +# Linux +./P835Driver-1.0.0-Linux-x86_64 -i inputHIGH_WINTER.txt -model HIGH_WINTER -o outputHIGH_WINTER.txt +``` + +A corresponding pair of input and output files for the High-latitude Winter Reference Atmosphere Model are provided behigh. + +```{.default filename="Input File Contents"} +h__km,5 +``` + +```{.default filename="Output File Contents"} +Model P835 +Model Variant High-latitude Winter Reference Atmosphere Model +Library Version v1.0 +Driver Version v1.0.0 +Date Generated Wed Jul 23 10:40:27 2025 +Input Arguments -i inputHIGH_WINTER.txt -model HIGH_WINTER -o outputHIGH_WINTER.txt + +Inputs: +h__km 5 [km] + +Results: +Return Code 0 [P835 v1.0 Status: Successful execution] +Temperature 241.06525 [Kelvin] +Dry air pressure 513.52730 [hPa] +Water vapour density 0.21901 [g/m^3] +Water vapour partial pressure 0.24363 [hPa] +``` \ No newline at end of file diff --git a/models/P835/index.qmd b/models/P835/index.qmd new file mode 100644 index 0000000..a7dfee4 --- /dev/null +++ b/models/P835/index.qmd @@ -0,0 +1,236 @@ +--- +title: "Recommendation ITU-R P.835-6" +date: 2024-12-02 +date-modified: 2025-06-12 +--- + +The Recommendation ITU-R P.835-6 provides expressions and data for reference standard atmospheres required for the calculation of gaseous attenuation on Earth-space paths [@p835-6]. +This implementation contains six set of functions of altitude: Mean annual global reference atmosphere [@p835-6, Annex1.1], Low-latitude annual reference atmosphere [@p835-6, Annex1.2], Summer Mid-latitude reference atmosphere [@p835-6, Annex1.3.1], Winter Mid-latitude reference atmosphere [@p835-6, Annex1.3.2], Summer High latitude reference atmosphere [@p835-6, Annex1.4.1] and Winter High latitude reference atmosphere [@p835-6, Annex1.4.2]. These functions can be used to determine temperature, pressure and water-vapour pressure, for calculating gaseous attenuation when more reliable local data are not available. +In addition to those major functions, it also provides some intermedia conversion functions. + +{{< include /includes/_getting_started.qmd >}} + +## Functions + +The input of most of the Recommendation ITU-R P.835-6 function is Geometric height shown in @tbl-p835-inputs-geometric-height. + +| Variable | Type | Units | Limits | Description | +|----------|--------|-------|---------------------|------------------| +| `h__km` | double | km | $0 \leq h \leq 100$ | Geometric height | +: Geometric height input {#tbl-p835-inputs-geometric-height} + +### Mean Annual Global Reference Atmosphere + +This set of functions implements Recommendation ITU-R P.835-6(12/2017) [@p835-6, Annex1.1]. + +**Global Temperature** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in Kelvin. + +**Global Pressure** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in hPa. + +**Global Water Vapour Density** + +The inputs for this function are shown in @tbl-p835-inputs-water-vapour. + +The output of this function is a double value in g/m3. + +| Variable | Type | Units | Limits | Description | +|---------------|--------|-----------------|---------------------|-------------------------------------------------------------| +| `h__km` | double | km | $0 \leq h \leq 100$ | Geometric height | +| `rho_0__g_m3` | double | g/m3 | $rho_0 \geq 0$ | Ground-level water vapour density, default is 7.5 | +: Water Vapour inputs {#tbl-p835-inputs-water-vapour} + +**Global Water Vapour Pressure** + +The inputs for this function are shown in @tbl-p835-inputs-water-vapour. + +The output of this function is a double value in hPa. + +{{< include /includes/_code_examples.qmd >}} + +[C++](cpp.qmd#mean-annual-global-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[.NET](dotnet.qmd#mean-annual-global-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[MATLAB](matlab.qmd#mean-annual-global-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[Python](python.qmd#mean-annual-global-reference-atmosphere){.btn .btn-secondary .btn role="button"} + +### Low-latitude Annual Reference Atmosphere + +This set of functions implements Recommendation ITU-R P.835-6(12/2017) [@p835-6, Annex1.2]. + +**Low-latitude Temperature** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in Kelvin. + +**Low-latitude Pressure** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in hPa. + +**Low-latitude Water Vapour Density** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in g/m3. + +**Low-latitude Water Vapour Pressure** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in hPa. + +{{< include /includes/_code_examples.qmd >}} + +[C++](cpp.qmd#low-latitude-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[.NET](dotnet.qmd#low-latitude-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[MATLAB](matlab.qmd#low-latitude-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[Python](python.qmd#low-latitude-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} + +### Mid-latitude Summer Annual Reference Atmosphere + +This set of functions implements Recommendation ITU-R P.835-6(12/2017) [@p835-6, Annex1.3.1]. + +**Mid-latitude Summer Temperature** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in Kelvin. + +**Mid-latitude Summer Pressure** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in hPa. + +**Mid-latitude Summer Water Vapour Density** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in g/m3. + +**Mid-latitude Summer Water Vapour Pressure** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in hPa. + +{{< include /includes/_code_examples.qmd >}} + +[C++](cpp.qmd#mid-latitude-summer-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[.NET](dotnet.qmd#mid-latitude-summer-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[MATLAB](matlab.qmd#mid-latitude-summer-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[Python](python.qmd#mid-latitude-summer-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} + +### Mid-latitude Winter Annual Reference Atmosphere + +This set of functions implements Recommendation ITU-R P.835-6(12/2017) [@p835-6, Annex1.3.2]. + +**Mid-latitude Winter Temperature** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in Kelvin. + +**Mid-latitude Winter Pressure** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in hPa. + +**Mid-latitude Winter Water Vapour Density** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in g/m3. + +**Mid-latitude Winter Water Vapour Pressure** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in hPa. + +{{< include /includes/_code_examples.qmd >}} + +[C++](cpp.qmd#mid-latitude-winter-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[.NET](dotnet.qmd#mid-latitude-winter-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[MATLAB](matlab.qmd#mid-latitude-winter-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[Python](python.qmd#mid-latitude-winter-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} + +### High-latitude Summer Annual Reference Atmosphere + +This set of functions implements Recommendation ITU-R P.835-6(12/2017) [@p835-6, Annex1.4.1]. + +**High-latitude Summer Temperature** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in Kelvin. + +**High-latitude Summer Pressure** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in hPa. + +**High-latitude Summer Water Vapour Density** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in g/m3. + +**High-latitude Summer Water Vapour Pressure** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in hPa. + +{{< include /includes/_code_examples.qmd >}} + +[C++](cpp.qmd#high-latitude-summer-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[.NET](dotnet.qmd#high-latitude-summer-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[MATLAB](matlab.qmd#high-latitude-summer-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[Python](python.qmd#high-latitude-summer-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} + +### High-latitude Winter Annual Reference Atmosphere + +This set of functions implements Recommendation ITU-R P.835-6(12/2017) [@p835-6, Annex1.4.2]. + +**High-latitude Winter Temperature** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in Kelvin. + +**High-latitude Winter Pressure** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in hPa. + +**High-latitude Winter Water Vapour Density** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in g/m3. + +**High-latitude Winter Water Vapour Pressure** + +The input for this function is shown in @tbl-p835-inputs-geometric-height. + +The output of this function is a double value in hPa. + +{{< include /includes/_code_examples.qmd >}} + +[C++](cpp.qmd#high-latitude-winter-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[.NET](dotnet.qmd#high-latitude-winter-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[MATLAB](matlab.qmd#high-latitude-winter-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} +[Python](python.qmd#high-latitude-winter-annual-reference-atmosphere){.btn .btn-secondary .btn role="button"} diff --git a/models/P835/matlab.qmd b/models/P835/matlab.qmd new file mode 100644 index 0000000..ec945b1 --- /dev/null +++ b/models/P835/matlab.qmd @@ -0,0 +1,166 @@ +--- +title: "The Recommendation ITU-R P.835-6 – MATLAB" +date: 2025-01-24 +date-modified: 2025-06-12 +--- + +This page details the installation and usage of the MATLAB® version of the PropLib implementation of Recommendation ITU-R P.835-6. + +{{< include /includes/_link_to_model_home.qmd >}} + +## Getting Started + +This MATLAB® Toolbox is distributed on [MathWorks® File Exchange](#TODO). + +{{< include /includes/matlab/_getting_started.qmd >}} + +{{< include /includes/matlab/_documentation.qmd >}} + +```matlab +help ITS.ITU.PSeries.P835.MeanAnnualGlobalAtmosphere.GlobalTemperature + +% Prints detailed usage information! +``` + +{{< include /includes/matlab/_examples.qmd >}} + +### Mean Annual Global Reference Atmosphere + +```matlab +import ITS.ITU.PSeries.P835.* + +% Define inputs +h__km = 15.0; % Geometric height, in km +rho_0__g_m3 = 8.0; % Ground-level water vapour density, in g/m^3 + +% Call Mean Annual Global Atmosphere functions +T__kelvin = MeanAnnualGlobalAtmosphere.GlobalTemperature(h__km); +% T__kelvin is approx. 216.65 Kelvin + +p__hPa = MeanAnnualGlobalAtmosphere.GlobalPressure(h__km); +% p__hPa is approx. 121.1193 hPa + +rho__g_m3 = MeanAnnualGlobalAtmosphere.GlobalWaterVapourDensity(h__km, rho_0__g_m3); +% rho__g_m3 is approx. 0.0044247 g/m^3 + +% or omit rho_0__g_m3, using default Ground-level water vapour density, which is 7.5: +% rho__g_m3 = MeanAnnualGlobalAtmosphere.GlobalWaterVapourDensity(h__km); +% rho__g_m3 is approx. 0.004148 g/m^3 + +e__hPa = MeanAnnualGlobalAtmosphere.GlobalWaterVapourPressure(h__km, rho_0__g_m3); +% e__hPa is approx. 0.0044237 hPa + +% or omit rho_0__g_m3, using default Ground-level water vapour density, which is 7.5: +% e__hPa = MeanAnnualGlobalAtmosphere.GlobalWaterVapourPressure(h__km); +% e__hPa is approx. 0.004147 hPa +``` + +### Low-latitude Annual Reference Atmosphere + +```matlab +import ITS.ITU.PSeries.P835.* + +% Define inputs +h__km = 10.0; % Geometric height, in km + +% Call Low-latitude Annual Reference Atmosphere functions +T__kelvin = LowLatitudeAtmosphere.Temperature(h__km); +% T__kelvin is approx. 237.478 Kelvin + +p__hPa = LowLatitudeAtmosphere.Pressure(h__km); +% p__hPa is approx. 284.853 hPa + +rho__g_m3 = LowLatitudeAtmosphere.WaterVapourDensity(h__km); +% rho__g_m3 is approx. 0.051421 g/m^3 + +e__hPa = LowLatitudeAtmosphere.WaterVapourPressure(h__km); +% e__hPa is approx. 0.0563514 hPa +``` + +### Mid-latitude Summer Reference Atmosphere + +```matlab +import ITS.ITU.PSeries.P835.* + +% Define inputs +h__km = 10.0; % Geometric height, in km + +% Call Mid-latitude Summer Reference Atmosphere functions +T__kelvin = MidLatitudeAtmosphere.SummerTemperature(h__km); +% T__kelvin is approx. 235.716 Kelvin + +p__hPa = MidLatitudeAtmosphere.SummerPressure(h__km); +% p__hPa is approx. 283.71 hPa + +rho__g_m3 = MidLatitudeAtmosphere.SummerWaterVapourDensity(h__km); +% rho__g_m3 is approx. 0.0612398 g/m^3 + +e__hPa = MidLatitudeAtmosphere.SummerWaterVapourPressure(h__km); +% e__hPa is approx. 0.0666137 hPa +``` + +### Mid-latitude Winter Reference Atmosphere + +```matlab +import ITS.ITU.PSeries.P835.* + +% Define inputs +h__km = 10.0; % Geometric height, in km + +% Call Mid-latitude Winter Reference Atmosphere functions +T__kelvin = MidLatitudeAtmosphere.WinterTemperature(h__km); +% T__kelvin is approx. 218 Kelvin + +p__hPa = MidLatitudeAtmosphere.WinterPressure(h__km); +% p__hPa is approx. 258.979 hPa + +rho__g_m3 = MidLatitudeAtmosphere.WinterWaterVapourDensity(h__km); +% rho__g_m3 is approx. 0.00998436 g/m^3 + +e__hPa = MidLatitudeAtmosphere.WinterWaterVapourPressure(h__km); +% e__hPa is approx. 0.0100443 hPa +``` + +### High-latitude Summer Reference Atmosphere + +```matlab +import ITS.ITU.PSeries.P835.* + +% Define inputs +h__km = 8.0; % Geometric height, in km + +% Call High-latitude Summer Reference Atmosphere functions +T__kelvin = HighLatitudeAtmosphere.SummerTemperature(h__km); +% T__kelvin is approx. 239.621 Kelvin + +p__hPa = HighLatitudeAtmosphere.SummerPressure(h__km); +% p__hPa is approx. 354.244 hPa + +rho__g_m3 = HighLatitudeAtmosphere.SummerWaterVapourDensity(h__km); +% rho__g_m3 is approx. 0.129769 g/m^3 + +e__hPa = HighLatitudeAtmosphere.SummerWaterVapourPressure(h__km); +% e__hPa is approx. 0.143495 hPa +``` + +### High-latitude Winter Reference Atmosphere + +```matlab +import ITS.ITU.PSeries.P835.* + +% Define inputs +h__km = 8.0; % Geometric height, in km + +% Call High-latitude Winter Reference Atmosphere functions +T__kelvin = HighLatitudeAtmosphere.WinterTemperature(h__km); +% T__kelvin is approx. 220.53 Kelvin + +p__hPa = HighLatitudeAtmosphere.WinterPressure(h__km); +% p__hPa is approx. 324.41 hPa + +rho__g_m3 = HighLatitudeAtmosphere.WinterWaterVapourDensity(h__km); +% rho__g_m3 is approx. 0.0177274 g/m^3 + +e__hPa = HighLatitudeAtmosphere.WinterWaterVapourPressure(h__km); +% e__hPa is approx. 0.0180407 hPa +``` diff --git a/models/P835/python.qmd b/models/P835/python.qmd new file mode 100644 index 0000000..f1a6382 --- /dev/null +++ b/models/P835/python.qmd @@ -0,0 +1,203 @@ +--- +title: "The Recommendation ITU-R P.835-6 – Python" +date: 2025-01-24 +date-modified: 2025-06-12 +--- + +This page details the installation and usage of the Python version of the PropLib implementation of Recommendation ITU-R P.835-6. + +{{< include /includes/_link_to_model_home.qmd >}} + +{{< include /includes/python/_getting_started.qmd >}} + +### Installation + +This Python package is distributed through the +[Python Package Index (PyPI)](https://pypi.org/project/proplib-p835). +Run the following command to install the package, and any required dependencies, into your Python environment. + +```default +pip install proplib-p835 +``` + +The following code snippet shows how to import the package and check the installed version. + +```python +from ITS.ITU.PSeries import P835 +print(P835.__version__) +``` + +{{< include /includes/python/_uninstallation.qmd >}} + +```default +pip uninstall proplib-p835 +``` + +{{< include /includes/python/_documentation.qmd >}} + +```python +from ITS.ITU.PSeries import P835 +help(P835.MeanAnnualGlobalAtmosphere.GlobalTemperature) +``` + +## Examples + +The following code examples show how each of the three models from Recommendation ITU-R P.835 can be called from Python. + +### Specific Attenuation Model + +```python +from ITS.ITU.PSeries import P835 + +# define inputs +f__ghz = 60.0 # Frequency, in GHz. +T__kelvin = 288.15 # Temperature, in Kelvin. +e__hPa = 9.97288879 # Water vapour partial pressure, in hPa. +p__hPa = 1013.25 # Dry air pressure, in hPa. + +# Call Specific Attenuation Model +gamma = P835.SpecificAttenuation(f__ghz, T__kelvin, e__hPa, p__hPa) +# gamma is approximately 14.77832 dB/km +``` + + +### Mean Annual Global Reference Atmosphere + +```python +from ITS.ITU.PSeries import P835 + +# Define inputs +h__km = 15.0 # Geometric height, in km +rho_0__g_m3 = 8.0 # Ground-level water vapour density, in g/m^3 + +# Call Mean Annual Global Atmosphere functions +T__kelvin = P835.MeanAnnualGlobalAtmosphere.GlobalTemperature(h__km) +# T__kelvin is approx. 216.65 Kelvin + +p__hPa = P835.MeanAnnualGlobalAtmosphere.GlobalPressure(h__km) +# p__hPa is approx. 121.1193 hPa + +rho__g_m3 = P835.MeanAnnualGlobalAtmosphere.GlobalWaterVapourDensity(h__km, rho_0__g_m3) +# rho__g_m3 is approx. 0.0044247 g/m^3 + +# or omit rho_0__g_m3, using default Ground-level water vapour density, which is 7.5: +# rho__g_m3 = P835.MeanAnnualGlobalAtmosphere.GlobalWaterVapourDensity(h__km) +# rho__g_m3 is approx. 0.004148 g/m^3 + +e__hPa = P835.MeanAnnualGlobalAtmosphere.GlobalWaterVapourPressure(h__km, rho_0__g_m3) +# e__hPa is approx. 0.0044237 hPa + +# or omit rho_0__g_m3, using default Ground-level water vapour density, which is 7.5: +# e__hPa = P835.MeanAnnualGlobalAtmosphere.GlobalWaterVapourPressure(h__km) +# e__hPa is approx. 0.004147 hPa +``` + +### Low-latitude Annual Reference Atmosphere + +```python +from ITS.ITU.PSeries import P835 + +# Define inputs +h__km = 10.0 # Geometric height, in km + +# Call Low-latitude Annual Reference Atmosphere functions +T__kelvin = P835.LowLatitudeAtmosphere.Temperature(h__km) +# T__kelvin is approx. 237.478 Kelvin + +p__hPa = P835.LowLatitudeAtmosphere.Pressure(h__km) +# p__hPa is approx. 284.853 hPa + +rho__g_m3 = P835.LowLatitudeAtmosphere.WaterVapourDensity(h__km) +# rho__g_m3 is approx. 0.051421 g/m^3 + +e__hPa = P835.LowLatitudeAtmosphere.WaterVapourPressure(h__km) +# e__hPa is approx. 0.0563514 hPa +``` + +### Mid-latitude Summer Reference Atmosphere + +```python +from ITS.ITU.PSeries import P835 + +# Define inputs +h__km = 10.0 # Geometric height, in km + +# Call Mid-latitude Summer Reference Atmosphere functions +T__kelvin = P835.MidLatitudeAtmosphere.SummerTemperature(h__km) +# T__kelvin is approx. 235.716 Kelvin + +p__hPa = P835.MidLatitudeAtmosphere.SummerPressure(h__km) +# p__hPa is approx. 283.71 hPa + +rho__g_m3 = P835.MidLatitudeAtmosphere.SummerWaterVapourDensity(h__km) +# rho__g_m3 is approx. 0.0612398 g/m^3 + +e__hPa = P835.MidLatitudeAtmosphere.SummerWaterVapourPressure(h__km) +# e__hPa is approx. 0.0666137 hPa +``` + +### Mid-latitude Winter Reference Atmosphere + +```python +from ITS.ITU.PSeries import P835 + +# Define inputs +h__km = 10.0 # Geometric height, in km + +# Call Mid-latitude Winter Reference Atmosphere functions +T__kelvin = P835.MidLatitudeAtmosphere.WinterTemperature(h__km) +# T__kelvin is approx. 218 Kelvin + +p__hPa = P835.MidLatitudeAtmosphere.WinterPressure(h__km) +# p__hPa is approx. 258.979 hPa + +rho__g_m3 = P835.MidLatitudeAtmosphere.WinterWaterVapourDensity(h__km) +# rho__g_m3 is approx. 0.00998436 g/m^3 + +e__hPa = P835.MidLatitudeAtmosphere.WinterWaterVapourPressure(h__km) +# e__hPa is approx. 0.0100443 hPa +``` + +### High-latitude Summer Reference Atmosphere + +```python +from ITS.ITU.PSeries import P835 + +# Define inputs +h__km = 8.0 # Geometric height, in km + +# Call High-latitude Summer Reference Atmosphere functions +T__kelvin = P835.HighLatitudeAtmosphere.SummerTemperature(h__km) +# T__kelvin is approx. 239.621 Kelvin + +p__hPa = P835.HighLatitudeAtmosphere.SummerPressure(h__km) +# p__hPa is approx. 354.244 hPa + +rho__g_m3 = P835.HighLatitudeAtmosphere.SummerWaterVapourDensity(h__km) +# rho__g_m3 is approx. 0.129769 g/m^3 + +e__hPa = P835.HighLatitudeAtmosphere.SummerWaterVapourPressure(h__km) +# e__hPa is approx. 0.143495 hPa +``` + +### High-latitude Winter Reference Atmosphere + +```python +from ITS.ITU.PSeries import P835 + +# Define inputs +h__km = 8.0 # Geometric height, in km + +# Call High-latitude Winter Reference Atmosphere functions +T__kelvin = P835.HighLatitudeAtmosphere.WinterTemperature(h__km) +# T__kelvin is approx. 220.53 Kelvin + +p__hPa = P835.HighLatitudeAtmosphere.WinterPressure(h__km) +# p__hPa is approx. 324.41 hPa + +rho__g_m3 = P835.HighLatitudeAtmosphere.WinterWaterVapourDensity(h__km) +# rho__g_m3 is approx. 0.0177274 g/m^3 + +e__hPa = P835.HighLatitudeAtmosphere.WinterWaterVapourPressure(h__km) +# e__hPa is approx. 0.0180407 hPa +``` diff --git a/references.bib b/references.bib index 50d5e07..40123f1 100644 --- a/references.bib +++ b/references.bib @@ -66,4 +66,26 @@ @article{wait-radiation-from-vertical-antenna number = "4", pages = "237--244", doi = "https://dx.doi.org/10.6028/jres.056.031" +} + +@techreport{p676-12, + author = "", + title = {{P.676 : Attenuation by atmospheric gases and related effects}}, + institution = "International Telecommunications Union", + year = 2019, + type = "Recommendation ITU-R", + number = "P.676-12", + month = "8", + url = "https://www.itu.int/rec/R-REC-P.676" +} + +@techreport{p835-6, + author = "", + title = {{P.835 : Reference atmospheres }}, + institution = "International Telecommunications Union", + year = 2017, + type = "Recommendation ITU-R", + number = "P.835-6", + month = "12", + url = "https://www.itu.int/rec/R-REC-P.835" } \ No newline at end of file