pyant 0.11.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. pyant-0.11.0/LICENSE +21 -0
  2. pyant-0.11.0/MANIFEST.in +2 -0
  3. pyant-0.11.0/PKG-INFO +87 -0
  4. pyant-0.11.0/README.md +46 -0
  5. pyant-0.11.0/pyproject.toml +80 -0
  6. pyant-0.11.0/setup.cfg +9 -0
  7. pyant-0.11.0/setup.py +32 -0
  8. pyant-0.11.0/src/clibbeam/Makefile +26 -0
  9. pyant-0.11.0/src/clibbeam/array.c +17 -0
  10. pyant-0.11.0/src/clibbeam/beam.c +20 -0
  11. pyant-0.11.0/src/clibbeam/beam.h +11 -0
  12. pyant-0.11.0/src/pyant/__init__.py +33 -0
  13. pyant-0.11.0/src/pyant/beam.py +531 -0
  14. pyant-0.11.0/src/pyant/beams/__init__.py +27 -0
  15. pyant-0.11.0/src/pyant/beams/arrays.py +32 -0
  16. pyant-0.11.0/src/pyant/beams/beams.py +90 -0
  17. pyant-0.11.0/src/pyant/beams/data/__init__.py +27 -0
  18. pyant-0.11.0/src/pyant/beams/data/e3d_subgroup_positions.txt +109 -0
  19. pyant-0.11.0/src/pyant/beams/data/eiscat_uhf_bp.txt +128 -0
  20. pyant-0.11.0/src/pyant/beams/data/radar_parameters.json +46 -0
  21. pyant-0.11.0/src/pyant/beams/eiscat_3d.py +216 -0
  22. pyant-0.11.0/src/pyant/beams/eiscat_uhf.py +87 -0
  23. pyant-0.11.0/src/pyant/beams/esr.py +38 -0
  24. pyant-0.11.0/src/pyant/beams/radar_parameters.py +46 -0
  25. pyant-0.11.0/src/pyant/beams/tsdr.py +64 -0
  26. pyant-0.11.0/src/pyant/clib.py +17 -0
  27. pyant-0.11.0/src/pyant/coordinates.py +290 -0
  28. pyant-0.11.0/src/pyant/models/__init__.py +10 -0
  29. pyant-0.11.0/src/pyant/models/airy.py +100 -0
  30. pyant-0.11.0/src/pyant/models/array.py +204 -0
  31. pyant-0.11.0/src/pyant/models/cassegrain.py +116 -0
  32. pyant-0.11.0/src/pyant/models/finite_cylindrical_parabola.py +226 -0
  33. pyant-0.11.0/src/pyant/models/gaussian.py +150 -0
  34. pyant-0.11.0/src/pyant/models/interpolated.py +77 -0
  35. pyant-0.11.0/src/pyant/models/interpolated_array.py +243 -0
  36. pyant-0.11.0/src/pyant/models/measured.py +9 -0
  37. pyant-0.11.0/src/pyant/models/phased_finite_cylindrical_parabola.py +192 -0
  38. pyant-0.11.0/src/pyant/plotting.py +505 -0
  39. pyant-0.11.0/src/pyant/profiling.py +117 -0
  40. pyant-0.11.0/src/pyant/registry.py +26 -0
  41. pyant-0.11.0/src/pyant/statistics.py +49 -0
  42. pyant-0.11.0/src/pyant/version.py +1 -0
  43. pyant-0.11.0/src/pyant.egg-info/PKG-INFO +87 -0
  44. pyant-0.11.0/src/pyant.egg-info/SOURCES.txt +48 -0
  45. pyant-0.11.0/src/pyant.egg-info/dependency_links.txt +1 -0
  46. pyant-0.11.0/src/pyant.egg-info/requires.txt +29 -0
  47. pyant-0.11.0/src/pyant.egg-info/top_level.txt +2 -0
  48. pyant-0.11.0/tests/test_beam.py +216 -0
  49. pyant-0.11.0/tests/test_coordinates.py +246 -0
pyant-0.11.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [2019] [Daniel Kastinen, Juha Vierinen, Tom Grydeland]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ graft src/clibbeam
2
+ include README.md
pyant-0.11.0/PKG-INFO ADDED
@@ -0,0 +1,87 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyant
3
+ Version: 0.11.0
4
+ Summary: Radar antenna models in python
5
+ Author-email: Daniel Kastinen <daniel.kastinen@irf.se>, Tom Grydeland <tgry@norceresearch.no>, Juha Vierinen <juha-pekka.vierinen@uit.no>
6
+ Maintainer-email: Daniel Kastinen <daniel.kastinen@irf.se>
7
+ License: MIT License
8
+
9
+ Copyright (c) [2019] [Daniel Kastinen, Juha Vierinen, Tom Grydeland]
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+ Project-URL: Documentation, https://danielk.developer.irf.se/pyant/
29
+ Project-URL: Repository, https://github.com/danielk333/pyant
30
+ Classifier: Intended Audience :: Science/Research
31
+ Classifier: Programming Language :: Python :: 3
32
+ Classifier: Topic :: Scientific/Engineering :: Physics
33
+ Classifier: Operating System :: OS Independent
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Requires-Python: >=3.5
36
+ Description-Content-Type: text/markdown
37
+ Provides-Extra: develop
38
+ Provides-Extra: notebooks
39
+ Provides-Extra: profiling
40
+ License-File: LICENSE
41
+
42
+ # PyAnt
43
+
44
+ PyAnt is a standardization for implementing radar gain pattern in Python. Nothing more, nothing less.
45
+
46
+ ## Getting started
47
+
48
+ To install
49
+
50
+ ```bash
51
+ pip install pyant
52
+ ```
53
+
54
+ or for the nightly build
55
+
56
+ ```bash
57
+ git clone git@github.com:danielk333/pyant.git
58
+ cd pyant
59
+ git checkout develop
60
+ pip install .
61
+ ```
62
+
63
+ Alternatively, if you are following updates closely you can install using ``pip install -e .`` so that in the future a ``git pull`` will update the library.
64
+
65
+ Then get started by looking at the examples gallery and API in the Documentation.
66
+
67
+ ## Example
68
+
69
+ Plot the gain pattern of a dish radar modeled using the Cassegrain model.
70
+
71
+ ```python
72
+ import matplotlib.pyplot as plt
73
+ import pyant
74
+
75
+ ant = pyant.Cassegrain(
76
+ azimuth=0,
77
+ elevation=90.0,
78
+ frequency=930e6,
79
+ I0=10**4.81,
80
+ a0=23.0,
81
+ a1=40.0,
82
+ degrees=True,
83
+ )
84
+
85
+ pyant.plotting.gain_heatmap(ant, resolution=301, min_elevation=80.0)
86
+ plt.show()
87
+ ```
pyant-0.11.0/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # PyAnt
2
+
3
+ PyAnt is a standardization for implementing radar gain pattern in Python. Nothing more, nothing less.
4
+
5
+ ## Getting started
6
+
7
+ To install
8
+
9
+ ```bash
10
+ pip install pyant
11
+ ```
12
+
13
+ or for the nightly build
14
+
15
+ ```bash
16
+ git clone git@github.com:danielk333/pyant.git
17
+ cd pyant
18
+ git checkout develop
19
+ pip install .
20
+ ```
21
+
22
+ Alternatively, if you are following updates closely you can install using ``pip install -e .`` so that in the future a ``git pull`` will update the library.
23
+
24
+ Then get started by looking at the examples gallery and API in the Documentation.
25
+
26
+ ## Example
27
+
28
+ Plot the gain pattern of a dish radar modeled using the Cassegrain model.
29
+
30
+ ```python
31
+ import matplotlib.pyplot as plt
32
+ import pyant
33
+
34
+ ant = pyant.Cassegrain(
35
+ azimuth=0,
36
+ elevation=90.0,
37
+ frequency=930e6,
38
+ I0=10**4.81,
39
+ a0=23.0,
40
+ a1=40.0,
41
+ degrees=True,
42
+ )
43
+
44
+ pyant.plotting.gain_heatmap(ant, resolution=301, min_elevation=80.0)
45
+ plt.show()
46
+ ```
@@ -0,0 +1,80 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pyant"
7
+ description = "Radar antenna models in python"
8
+ readme = {file = "README.md", content-type = "text/markdown"}
9
+ authors = [
10
+ {name = "Daniel Kastinen", email = "daniel.kastinen@irf.se"},
11
+ {name = "Tom Grydeland", email = "tgry@norceresearch.no"},
12
+ {name = "Juha Vierinen", email = "juha-pekka.vierinen@uit.no"},
13
+ ]
14
+ maintainers = [
15
+ {name = "Daniel Kastinen", email = "daniel.kastinen@irf.se"},
16
+ ]
17
+ license = {file = "LICENSE"}
18
+ classifiers = [
19
+ "Intended Audience :: Science/Research",
20
+ "Programming Language :: Python :: 3",
21
+ "Topic :: Scientific/Engineering :: Physics",
22
+ "Operating System :: OS Independent",
23
+ "License :: OSI Approved :: MIT License",
24
+ ]
25
+ requires-python = ">=3.5"
26
+ dependencies = [
27
+ "numpy >= 1.14.3",
28
+ "scipy >= 1.1.0",
29
+ "matplotlib >= 3.2.0",
30
+ ]
31
+ dynamic = ["version"]
32
+
33
+ [tool.setuptools]
34
+ include-package-data = true
35
+ license-files = ["LICENSE"]
36
+
37
+ [tool.setuptools.dynamic]
38
+ version = {attr = "pyant.version.__version__"}
39
+
40
+ [tool.setuptools.packages.find]
41
+ where = ["src"]
42
+
43
+ [tool.setuptools.package-data]
44
+ "pyant.beams" = ["data/*"]
45
+
46
+ [project.optional-dependencies]
47
+ develop = [
48
+ "pytest >= 6.2.5",
49
+ "sphinx >= 4.2.0",
50
+ "flake8 >= 6.0.0",
51
+ "wheel >= 0.37.0",
52
+ "build >= 0.7.0",
53
+ "twine >= 3.4.2",
54
+ "pytest-cov >= 4.1.0",
55
+ "sphinx-gallery >= 0.3.1",
56
+ "matplotlib >= 3.5.1",
57
+ "myst-nb >= 0.17.2",
58
+ "ipykernel >= 6.9.1",
59
+ "radon >= 5.1.0",
60
+ "numpydoc >= 1.2",
61
+ "pre-commit > 3.0.0",
62
+ "black >= 23.3.0",
63
+ "auditwheel >= 5.4.0",
64
+ "patchelf >= 0.14",
65
+ ]
66
+ notebooks = [
67
+ "notebook >= 6.5.4",
68
+ "jupytext >= 1.14.5",
69
+ ]
70
+ profiling = [
71
+ "yappi >= 1.4.0",
72
+ ]
73
+
74
+ [project.urls]
75
+ Documentation = "https://danielk.developer.irf.se/pyant/"
76
+ Repository = "https://github.com/danielk333/pyant"
77
+
78
+ [tool.black]
79
+ line-length = 100
80
+ target_version = ['py35', 'py36', 'py37', 'py38', 'py39', 'py310']
pyant-0.11.0/setup.cfg ADDED
@@ -0,0 +1,9 @@
1
+ [flake8]
2
+ ignore = D203,E251,E126,E226,W504,W503,W605
3
+ max-line-length = 100
4
+ exclude = src/pyant/__pycache__,src/pyant/__init__.py,src/pyant/**/__init__.py
5
+
6
+ [egg_info]
7
+ tag_build =
8
+ tag_date = 0
9
+
pyant-0.11.0/setup.py ADDED
@@ -0,0 +1,32 @@
1
+ import setuptools
2
+ from distutils.core import Extension
3
+ import pathlib
4
+ import codecs
5
+
6
+ HERE = pathlib.Path(__file__).resolve().parents[0]
7
+
8
+
9
+ def get_version(path):
10
+ with codecs.open(path, 'r') as fp:
11
+ for line in fp.read().splitlines():
12
+ if line.startswith('__version__'):
13
+ delim = '"' if '"' in line else "'"
14
+ return line.split(delim)[1]
15
+ else:
16
+ raise RuntimeError("Unable to find version string.")
17
+
18
+
19
+ clib_beam = Extension(
20
+ name='pyant.clibbeam',
21
+ sources=[
22
+ 'src/clibbeam/array.c',
23
+ 'src/clibbeam/beam.c',
24
+ ],
25
+ include_dirs=['src/clibbeam/'],
26
+ )
27
+
28
+
29
+ setuptools.setup(
30
+ version=get_version(HERE / 'src' / 'pyant' / 'version.py'),
31
+ ext_modules=[clib_beam],
32
+ )
@@ -0,0 +1,26 @@
1
+ CC=gcc
2
+ CFLAGS=-fPIC
3
+ LIBS=-lm
4
+
5
+ SOURCES=$(wildcard *.c)
6
+ OBJECTS=$(SOURCES:.c=.o)
7
+ EXT=$(shell python -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))")
8
+ OUTLIB=clibbeam$(EXT)
9
+
10
+ all: $(OUTLIB)
11
+
12
+ %.o: %.c
13
+ @echo "pyant installation -> Compiling source file $< ..."
14
+ $(CC) -c $(CFLAGS) -o $@ $<
15
+
16
+ $(OUTLIB): $(OBJECTS)
17
+ @echo "pyant installation -> Linking shared library $@ ..."
18
+ $(CC) $(CFLAGS) -shared $(OBJECTS) $(LIBS) -o $@
19
+ @mv $@ ../pyant/ -v
20
+ @echo "pyant installation -> The shared library $< has been created successfully."
21
+
22
+ clean:
23
+ @echo "pyant installation -> Removing object files *.o ..."
24
+ @-rm -f *.o
25
+ @echo "pyant installation -> Removing shared library *.so ..."
26
+ @-rm -f *.so
@@ -0,0 +1,17 @@
1
+ #include <stdio.h>
2
+ #include <complex.h>
3
+ #include <math.h>
4
+ #include "beam.h"
5
+
6
+
7
+ void
8
+ array_sensor_response(
9
+ double *k,
10
+ double complex *G,
11
+ size_t channels
12
+ )
13
+ {
14
+ for(size_t ch = 0; ch < channels; ch++) {
15
+ G[ch] = 1.0;
16
+ }
17
+ }
@@ -0,0 +1,20 @@
1
+ #include <stdio.h>
2
+ #include <complex.h>
3
+ #include <math.h>
4
+ #include "beam.h"
5
+
6
+ int
7
+ main(int argc, char *argv[])
8
+ {
9
+ double kvec[3];
10
+ size_t channels = 1;
11
+ double complex G[channels];
12
+ kvec[0] = 0.0;
13
+ kvec[1] = 0.0;
14
+ kvec[2] = 1.0;
15
+ array_sensor_response(kvec, G, channels);
16
+
17
+ printf("Hello, G = %.2f + %.2fi\n", creal(G[0]), cimag(G[0]));
18
+
19
+ return 0;
20
+ }
@@ -0,0 +1,11 @@
1
+ // inclusion guard
2
+ #ifndef BEAM_H_
3
+ #define BEAM_H_
4
+
5
+ void
6
+ array_sensor_response(
7
+ double *k,
8
+ double complex *G,
9
+ size_t channels
10
+ );
11
+ #endif // BEAM_H_
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env python
2
+
3
+ """
4
+
5
+ """
6
+
7
+ from .version import __version__
8
+
9
+ # Modules
10
+ from . import plotting
11
+ from . import coordinates
12
+ from . import beams
13
+ from . import models
14
+ from . import statistics
15
+ from . import clib
16
+
17
+ # Classes
18
+ from .beam import Beam, SummedBeams
19
+ from .beams import Radars, Models
20
+
21
+ # Functions
22
+ from .beams import (
23
+ beam_of_radar,
24
+ avalible_beams,
25
+ parameters_of_radar,
26
+ avalible_radar_info,
27
+ )
28
+
29
+ # Static
30
+ from .beams import UNITS
31
+
32
+ # Profiling
33
+ from .profiling import profile, profile_stop, get_profile, print_profile