{ "info": { "author": "Tim Molteno", "author_email": "tim@physics.otago.ac.nz", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Topic :: Communications :: Ham Radio", "Topic :: Scientific/Engineering" ], "description": "# Python NEC2++ Module\n\nThis module wraps the C++ API for antenna simulation of nec2++. It is easier to work with, and more powerful\nthan the C-style API wrapper.\n\n## Usage\n\nHere is an example that plots a radiation pattern.\n\n from PyNEC import *\n import numpy as np\n\n #creation of a nec context\n context=nec_context()\n\n #get the associated geometry\n geo = context.get_geometry()\n\n #add wires to the geometry\n geo.wire(0, 36, 0, 0, 0, -0.042, 0.008, 0.017, 0.001, 1.0, 1.0)\n context.geometry_complete(0)\n\n context.gn_card(-1, 0, 0, 0, 0, 0, 0, 0)\n\n #add a \"ex\" card to specify an excitation\n context.ex_card(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0)\n\n #add a \"fr\" card to specify the frequency \n context.fr_card(0, 2, 2400.0e6, 100.0e6)\n\n #add a \"rp\" card to specify radiation pattern sampling parameters and to cause program execution\n context.rp_card(0, 91, 1, 0, 5, 0, 0, 0.0, 45.0, 4.0, 2.0, 1.0, 0.0)\n\n #get the radiation_pattern\n rp = context.get_radiation_pattern(0)\n\n # Gains are in decibels\n gains_db = rp.get_gain()\n gains = 10.0**(gains_db / 10.0)\n thetas = rp.get_theta_angles() * 3.1415 / 180.0\n phis = rp.get_phi_angles() * 3.1415 / 180.0\n\n\n # Plot stuff\n import matplotlib.pyplot as plt\n\n ax = plt.subplot(111, polar=True)\n ax.plot(thetas, gains[:,0], color='r', linewidth=3)\n ax.grid(True)\n\n ax.set_title(\"Gain at an elevation of 45 degrees\", va='bottom')\n plt.savefig('RadiationPattern.png')\n plt.show()\n\n## Install\n\n git clone https://github.com/tmolteno/python-necpp.git\n cd python-necpp\n git submodule init\n git submodule update --remote\n cd PyNEC\n ./build.sh\n sudo python setup.py install\n\n## Testing\n\n python example/test_rp.py\n\n \nThe example directory contains the following additional examples (that are inspired by excercises from a course on antennas):\n\n* logperiodic_opt.py is an example on how to combine PyNECPP with scipy.optimize to use a genetic algorithm to **optimize an antenna for multiple frequency bands** at the same time (which I thin is not possible in 4nec2). The resulting gains and VSWR are plotted over the frequency range of interest. This requires scipy >= 0.15.0 due to the usage of scipy.optimize.differential_evolution.\n* monopole_realistic_ground_plane.py plots the vertical gain pattern of a monopole antenna. Its dimensions are optimized with a local search, and the path through the search space is visualized with a heat map.\n* dipole.py does a very simple optimization of a dipole, and plots the VSWR over a given frequency range for different system impedances to file.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/tmolteno/python-necpp", "keywords": "nec2 nec2++ antenna electromagnetism radio", "license": "GPLv2", "maintainer": "", "maintainer_email": "", "name": "PyNEC", "package_url": "https://pypi.org/project/PyNEC/", "platform": "", "project_url": "https://pypi.org/project/PyNEC/", "project_urls": { "Homepage": "http://github.com/tmolteno/python-necpp" }, "release_url": "https://pypi.org/project/PyNEC/1.7.3.4/", "requires_dist": null, "requires_python": "", "summary": "Python Antenna Simulation Module (nec2++) object-oriented interface", "version": "1.7.3.4" }, "last_serial": 5752604, "releases": { "1.7.3.1": [ { "comment_text": "", "digests": { "md5": "f60aceb5754aae13619e02503b84629a", "sha256": "4569493691f40758d7345b5a73fe49c3076348376b90f67f57a2037c6191ba1d" }, "downloads": -1, "filename": "PyNEC-1.7.3.1.tar.gz", "has_sig": false, "md5_digest": "f60aceb5754aae13619e02503b84629a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58730, "upload_time": "2017-09-24T21:23:19", "url": "https://files.pythonhosted.org/packages/11/16/8004bac8412d1cc501ef0cc78b4935086f502711c2db711a2c839aeeeeae/PyNEC-1.7.3.1.tar.gz" } ], "1.7.3.4": [ { "comment_text": "", "digests": { "md5": "021aa283746172dd8bd502989c421ada", "sha256": "c8112d97b3f9e3a410baaafa32398cc85050da2ebe4179fb4b490dc0b4de6b84" }, "downloads": -1, "filename": "PyNEC-1.7.3.4.tar.gz", "has_sig": false, "md5_digest": "021aa283746172dd8bd502989c421ada", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 218972, "upload_time": "2019-08-29T13:33:52", "url": "https://files.pythonhosted.org/packages/38/3a/026386eae1b3d250cab0df3abcb545d39327c54c9170ac810049c1835850/PyNEC-1.7.3.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "021aa283746172dd8bd502989c421ada", "sha256": "c8112d97b3f9e3a410baaafa32398cc85050da2ebe4179fb4b490dc0b4de6b84" }, "downloads": -1, "filename": "PyNEC-1.7.3.4.tar.gz", "has_sig": false, "md5_digest": "021aa283746172dd8bd502989c421ada", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 218972, "upload_time": "2019-08-29T13:33:52", "url": "https://files.pythonhosted.org/packages/38/3a/026386eae1b3d250cab0df3abcb545d39327c54c9170ac810049c1835850/PyNEC-1.7.3.4.tar.gz" } ] }