Skip to content

Commit

Permalink
Merge 2e51e6c into afebc0e
Browse files Browse the repository at this point in the history
  • Loading branch information
bwinkel committed Apr 25, 2019
2 parents afebc0e + 2e51e6c commit 3be6304
Show file tree
Hide file tree
Showing 28 changed files with 3,666 additions and 42 deletions.
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ env:
# so Cython is required for testing. If your package does not include
# Cython code, you can set CONDA_DEPENDENCIES=''
# - CONDA_DEPENDENCIES='pip wheel numpy scipy pytest astropy cython h5py matplotlib pyproj sgp4 sphinx-astropy'
- CONDA_DEPENDENCIES='pip wheel scipy pytest cython h5py matplotlib pyproj<2 sgp4 sphinx-astropy'
- CONDA_DEPENDENCIES='pip wheel scipy pyqt>=5 pytest pytest-qt cython h5py matplotlib pyproj<2 sgp4 sphinx-astropy'

# List other runtime dependencies for the package that are available as
# pip packages here.
Expand All @@ -64,7 +64,7 @@ env:

# If there are matplotlib or other GUI tests, uncomment the following
# line to use the X virtual framebuffer.
# - SETUP_XVFB=True
- SETUP_XVFB=True

# github pages secure key
- secure: "c9cNFhnlRkx/J5kLiP8uEwTvPDq9hPuSQXG3qiR5+JfB0CeERwr59Vuyux3g6IXmWMwqHPhIMkohV7PtnmaxRWmO0RiGhEDIZOZ5NVI5XGCIrJYuNPJ2tJnGJ3GMDqCw+Mw49MS4xx04fS0ye0StGYbP3gmMIHwIk3LCV5DPjrmlS9t/3mOry1MKlQIqXb6JocJBHtlHtK094i91arW1UG+KEVM1Xv/sjOupHKRbQ4/2OZYGx9Kzl9aeVDCxbNUyXxLd12vJKjIn5toDbzLlFuqb2VgLg2LDMdFGcL2VnUS6MUWb4nPPn20cLKv9B/5auUWC08COMg+QJTzsGUuU8fMGlgaDgB0/geXNkwnY1vF8S19sQCUW4oAU1RjOuOYMhUlxBodz/ql+RGJ6f/mBoD+FJ9aSJ9fOb1hXosFmM9KSRNaa6PiPouWQ+Xx1foaeD5DelCO9d5ZiKR63PBJby7dq1sh0DyCbi5vcqZFwwwrut27Pb6yJmyYacvbyLpbXh3BuA5V20hoOlGdzxg+aObJLx4eArwj8BoMlYvQ1up3dk558KqSCa/KZgjgg32cdGoikRn60Yywd1fZ9dtJ+ctL20U3dA3Csg4vIW+a3r0S/evrpPSTzjXxVxaqi669Svw1Hj0OtiR4rR7y+Ph6U11BT+xSsK7N0J3DrUBKiq5I="
Expand Down Expand Up @@ -209,15 +209,15 @@ matrix:
env: MAIN_CMD='pycodestyle pycraf --count' SETUP_CMD=''

before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $COMPILER == "clang" ]]; then brew update; brew install libomp; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $COMPILER == "llvm" ]]; then brew update; brew install llvm; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $COMPILER == "gcc" ]]; then brew update; brew install gcc; brew link --overwrite gcc; fi
- 'if [[ $TRAVIS_OS_NAME == "osx" && $COMPILER == "gcc" ]]; then
gcc --version;
gcc-6 --version && export CC="gcc-6" && export LD="gcc-6" && export LDFLAGS="-Wl,-rpath,/usr/local/opt/gcc/lib/gcc/6/" || true;
gcc-7 --version && export CC="gcc-7" && export LD="gcc-7" && export LDFLAGS="-Wl,-rpath,/usr/local/opt/gcc/lib/gcc/7/" || true;
gcc-8 --version && export CC="gcc-8" && export LD="gcc-8" && export LDFLAGS="-Wl,-rpath,/usr/local/opt/gcc/lib/gcc/8/" || true;
fi'
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $COMPILER == "clang" ]]; then brew update; brew install libomp; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $COMPILER == "llvm" ]]; then brew update; brew install llvm; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $COMPILER == "gcc" ]]; then brew update; brew install gcc; brew link --overwrite gcc; fi
- 'if [[ $TRAVIS_OS_NAME == "osx" && $COMPILER == "gcc" ]]; then
gcc --version;
gcc-6 --version && export CC="gcc-6" && export LD="gcc-6" && export LDFLAGS="-Wl,-rpath,/usr/local/opt/gcc/lib/gcc/6/" || true;
gcc-7 --version && export CC="gcc-7" && export LD="gcc-7" && export LDFLAGS="-Wl,-rpath,/usr/local/opt/gcc/lib/gcc/7/" || true;
gcc-8 --version && export CC="gcc-8" && export LD="gcc-8" && export LDFLAGS="-Wl,-rpath,/usr/local/opt/gcc/lib/gcc/8/" || true;
fi'

install:

Expand Down
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
1.0.0 (unreleased)
=======================
New Features
------------

pycraf-gui
^^^^^^^^^^
- A simple graphical user interface was added, which can be used to quickly
analyze the path propogation losses along a transmitter-receiver sight-line
and plot the path geometry. It is also possible to compute attenuation
maps. At the moment, it doesn't come with an amazing amount of features,
but it is foreseen to add more in the future. [#15]

pycraf.amt
^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ environment:
# For this package-template, we include examples of Cython modules,
# so Cython is required for testing. If your package does not include
# Cython code, you can set CONDA_DEPENDENCIES=''
CONDA_DEPENDENCIES: "pip wheel numpy scipy astropy pytest cython h5py matplotlib pyproj sgp4 twine"
CONDA_DEPENDENCIES: "pip wheel numpy scipy astropy pytest pytest-qt cython h5py matplotlib pyproj sgp4 twine"

# Conda packages for affiliated packages are hosted in channel
# "astropy" while builds for astropy LTS with recent numpy versions
Expand Down
64 changes: 64 additions & 0 deletions docs/gui/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.. pycraf-gui:
*****************************************************************
Graphical user interface (`pycraf-gui`)
*****************************************************************

.. currentmodule:: pycraf.gui

Introduction
============

The `~pycraf` GUI is a little graphical application, which is shipped with
the Python `~pycraf` package. It can be used to quickly analyze the path
propogation losses along a transmitter-receiver sight-line and plot the path
geometry. It is also possible to compute attenuation maps. At the moment, it
doesn't come with an amazing amount of features, but it is foreseen to add
more in the future.



Using pycraf-gui
================

To run the application, simply run:

.. code-block:: console
pycraf-gui
.. note::

As for the `~pycraf.pathprof` sub-package, SRTM tile data is necessary
to query terrain height profiles. It is possible to have the GUI download
the tiles automatically. Nevertheless, if you already have SRTM (or other
.hgt) tiles, you can use them; see also :ref:`working_with_srtm`.

The GUI looks like the following:

.. image:: pycraf-screenshot-low.jpg
:width: 800
:height: 699px
:scale: 100 %
:alt: pycraf-gui screenshot
:align: left

In the "General parameters" pane, one can change the environmental properties,
such as temperature and pressure, the desired radio frequency and of course
the location of transmitter and receiver with their antenna heights, etc.
Any change to these numbers will automatically update the "Geometry" display,
i.e., the results of the path loss calculation and the associate path plot.
It is also possible to compute plots of the path losses vs. distance ("Path
profile" pane) and attenuation maps ("Mapping" pane).

Currently, it is possible to save the plots as images (pdf, png, etc.) but it
is not yet possible to export the data into a disk file.

See Also
========

- `Astropy Units and Quantities package <http://docs.astropy.org/en/stable/
units/index.html>`_, which is used extensively in pycraf.
- `ITU-R Recommendation P.452-16 <https://www.itu.int/rec/
R-REC-P.452-16-201507-I/en>`_

Binary file added docs/gui/pycraf-screenshot-low.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Available modules
geometry/index
mc/index
utils/index
gui/index

.. automodapi:: pycraf
:no-heading:
Expand Down
6 changes: 3 additions & 3 deletions pycraf/antenna/imt.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def imt2020_single_element_pattern(
Vertical 3dB beam width of single element [deg]
k : float, optional
Multiplication factor, can be used to get better match to
measured antenna patters (default: 12). See `WP5D-C-0936
measured antenna patters (default: 12). See `WP5D-C-0936`
Returns
-------
Expand Down Expand Up @@ -266,7 +266,7 @@ def imt2020_composite_pattern(
Correlation level (see 3GPP TR 37.840, 5.4.4.1.4, default: 1) [dimless]
k : float, optional
Multiplication factor, can be used to get better match to
measured antenna patters (default: 12). See `WP5D-C-0936
measured antenna patters (default: 12). See `WP5D-C-0936`
Returns
-------
Expand Down Expand Up @@ -514,7 +514,7 @@ def imt_advanced_sectoral_peak_sidelobe_pattern_400_to_6000_mhz(
.. math::
\\vartheta_\\mathrm{3dB}=\\frac{31000\\times10^{-0.1G_0}}{\\varphi_\\mathrm{3dB}}
'''

return _imt_advanced_sectoral_peak_sidelobe_pattern_400_to_6000_mhz(
Expand Down
25 changes: 25 additions & 0 deletions pycraf/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,28 @@
TESTED_VERSIONS[pycraf] = version
except NameError: # Needed to support Astropy <= 1.0.0
pass


# want the following two fixtures in multiple sub-packages

import pytest
from . import pathprof


@pytest.fixture(scope='session')
def srtm_temp_dir(tmpdir_factory):

tdir = tmpdir_factory.mktemp('srtmdata')
return str(tdir)


@pytest.yield_fixture()
def srtm_handler(srtm_temp_dir):

with pathprof.srtm.SrtmConf.set(
srtm_dir=srtm_temp_dir,
server='nasa_v2.1',
download='missing',
):

yield
7 changes: 7 additions & 0 deletions pycraf/gui/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Contains a graphical user interface (GUI) for simple tasks.
'''

from .gui import *
17 changes: 17 additions & 0 deletions pycraf/gui/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys


def main(args=None):
'''Launch pycraf GUI.'''
if args is None:
args = sys.argv[1:]

from pycraf import gui
gui.start_gui()


if __name__ == '__main__':
main()
Loading

0 comments on commit 3be6304

Please sign in to comment.