Package: pycraf
Version:2.0.1Authors:Benjamin Winkel, Marta Bautista, Federico Di Vruno,
Gyula I. G. JózsaUser manual:stable|developerThe pycraf Python package provides functions and procedures for
various tasks in spectrum-management compatibility studies. A typical example
would be to calculate the interference levels at a radio telescope produced
from a radio broadcasting tower.Releases areregistered on PyPI,
and development is occurring at theproject’s github page.Project StatusFeaturesFull implementation ofITU-R Rec. P.452-16that allows to calculate path
attenuation for the distance between interferer and victim service. Supports
to load NASA’sShuttle Radar Topography Mission (SRTM)data for height-profile generation.Full implementation ofITU-R Rec. P.676-10, which provides two atmospheric
models to calculate the attenuation for paths through Earth’s atmosphere.Provides various antenna patterns necessary for compatibility studies (e.g.,
RAS, IMT, fixed-service links).Functions to convert power flux densities, field strengths, transmitted and
received powers at certain distances and frequencies into each other.UsageExamples and DocumentationWe providean online documentation and API reference. Furthermore, you can find tutorials and HowTos in
thenotebooksdirectory on the pycraf repository.TestingAfter installation (see below) you can test, if everything works as intended:import pycraf

pycraf.test()By default, thetestfunction will skip over tests that require
data from the internet. One can include them by:pycraf.test(remote_data='any')This willalwaysdownload SRTM data (few tiles only) to test the
auto-download functionality! Do this only, if you can afford the network
traffic.LicenseSeveral licenses apply; see thelicense directoryin the repository. The pycraf Python package
itself is published underGPL v3, an open-source license.For some of the functionality provided in pycraf, data files provided by the
ITU are necessary. For example, the atmospheric model in thepycraf.atmsubpackage implements the algorithm described inITU-R Recommendation P.676.
Annex 1 of this Recommendation makes use of spectroscopic information of the
oxygen and water vapour lines given in Tables 1 and 2 of P.676. Another
example are the radiometeorological data files that are distributed alongsideITU-R Rec. P.452-16ITU kindly gave us permission to include data files into pycraf that are
distributed with the Recommendations on the ITU servers. This makes it possible
to just use pycraf without the need to manually download necessary data files.
However, these data files are not free for commercial use. For details, please
see theLICENSE.ITUfile.Some of the examples/images in the pycraf documentation and tutorial notebooks
make use ofCopernicusdata. For these, the
conditions inCOPERNICUS.EUapply.Since pycraf uses theAstropy Package Templatefor packaging, we also refer to the associatedlicense.InstallationWe strongly recommend to use theAnaconda Python distribution, as it allows to downloadpycrafbinaries for all major platforms (Linux, OSX, Windows). After installing
Anaconda/Miniconda, one can use thecondapackage manager to install it:conda install pycraf -c conda-forgeOf course, it is always a good idea to do this in its own environment, such
that you don’t mess up with your standard environment, e.g.:conda create -n pycraf-env python=3.9 pycrafIf you don’t like Anaconda, the easiest way to install pycraf is via pip:pip install pycrafThe installation is also possible from source. Download the tar.gz-file,
extract (or clone from GitHub) and simply execute:python -m pip install .DependenciesWe kept the dependencies as minimal as possible. The following packages are
required:Python 3.8 or latersetuptoolscython 0.29 or laternumpy 1.18 or laterastropy 4.0 or laterscipy 1.7 or laterpytest 5.4 or laterpytest-remotedata 0.3.3 or laterThe following packages are optional, and you will need them for certain
features and to build the docs:h5py 3.3 or later; for cachingmatplotlib 3.4 or later; for some plot helperspyproj 2.6 or later; for thegeospatialsubpackagesgp4 2.0 or later; for thesatellitesubpackagerasterio 1.2 or later; for thesatellitesubpackageFor further details, we refer to the online documentioninstallation
instructions. It also
includes some hints for running pycraf on Windows or MacOS. Older versions
of the packages may work, but no support will be provided.SRTM dataTo make full use of the path attenuation calculations provided by pycraf
(implementsITU-R Rec. P.452), we recommend to use NASA’sShuttle Radar Topography Mission (SRTM)data for height-profile generation. pycraf can work with so-called.hgtfiles, a very simple binary format. Each.hgtfile, a so-called tile, just
contains 1201x1201 16-bit integers. From the file naming scheme, one can infer
the associated coordinates. Most tiles contain one square-degree.Unfortunately, we cannot provide SRTM data as part of the package, due to the
large file sizes and legal reasons. But once you downloaded the necessary
tiles (all or only a subset appropriate for your region), simply define the
environment variableSRTMDATA, let it point to the folder containing the
tiles, and pycraf will find the files when it is imported from Python.On windows:set SRTMDATA=C:\[path-to-srtm]\On Linux/MacOS (sh-like):export SRTMDATA=[path-to-srtm]/There is also the possibility to change the path to the SRTM directory during
run-time (see documentation).AcknowledgmentsWe are very grateful for the kind support from ITU study groups and ITU’s
legal department.This code is makes use of the excellent work provided by theAstropycommunity. pycraf uses the Astropy package and also theAstropy Package Templatefor the packaging.Who do I talk to?If you encounter any problems or have questions, do not hesitate to raise an
issue or make a pull request. Moreover, you can contact the devs directly:bwinkel@mpifr.de