Skip to main content

python-necpp: Antenna simulation in python

This module allows you to do antenna simulations in Python using the nec2++ antenna simulation package.

This is a wrapper using SWIG of the C interface, so the syntax is quite simple. Have a look at the file necpp_src/example/test.py, for an example of how this library can be used.

Tim Molteno. tim@physics.otago.ac.nz

News

  • Version 2.2.x Latest releases including Eigen-based matrix solver and modern Python packaging (pyproject.toml, uv support).

Install

As of version 1.6.1.2 swig is no longer required for installation. Simply use PIP as follows:

pip install necpp

To build from source with uv:

uv build
uv pip install .

Documentation

Try help(necpp) to list the available functions. The functions available are documented in the C-style API of nec2++. This is available here

Using

The following code calculates the impedance of a simple vertical monopole antenna over a perfect ground.

import necpp

def handle_nec(result):
  if (result != 0):
    print(necpp.nec_error_message())

def impedance(frequency, z0, height):
  
  nec = necpp.nec_create()
  handle_nec(necpp.nec_wire(nec, 1, 17, 0, 0, z0, 0, 0, z0+height, 0.1, 1, 1))
  handle_nec(necpp.nec_geometry_complete(nec, 1, 0))
  handle_nec(necpp.nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0))
  handle_nec(necpp.nec_fr_card(nec, 0, 1, frequency, 0))
  handle_nec(necpp.nec_ex_card(nec, 0, 0, 1, 0, 1.0, 0, 0, 0, 0, 0)) 
  handle_nec(necpp.nec_rp_card(nec, 0, 90, 1, 0,5,0,0, 0, 90, 1, 0, 0, 0))
  result_index = 0
  
  z = complex(necpp.nec_impedance_real(nec,result_index), 
              necpp.nec_impedance_imag(nec,result_index))
  
  necpp.nec_delete(nec)
  return z

if __name__ == "__main__":
  z = impedance(frequency = 34.5, z0 = 0.5, height = 4.0)
  print("Impedance \t(%6.1f,%+6.1fI) Ohms" % (z.real, z.imag))

More Information

Have a look at [http://github.com/tmolteno/necpp] for more information on using nec2++.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

necpp-2.3.2.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

necpp-2.3.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

necpp-2.3.2-cp314-cp314-macosx_11_0_arm64.whl (249.0 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

necpp-2.3.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

necpp-2.3.2-cp313-cp313-macosx_11_0_arm64.whl (249.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

necpp-2.3.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

necpp-2.3.2-cp312-cp312-macosx_11_0_arm64.whl (249.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

necpp-2.3.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

necpp-2.3.2-cp311-cp311-macosx_11_0_arm64.whl (249.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file necpp-2.3.2.tar.gz.

File metadata

  • Download URL: necpp-2.3.2.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for necpp-2.3.2.tar.gz
Algorithm Hash digest
SHA256 c2abab7cbad948f20d3704202d2854d75fc537cc2cfaf5328ae629e5665e0726
MD5 6928f51343b19486f8807058e2b37a46
BLAKE2b-256 8a6df7e18c2b66f4bca9dee62b64e1c4a61db77aef5885163eb768b13a628f6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.3.2.tar.gz:

Publisher: build-necpp-wheels.yml on tmolteno/python-necpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file necpp-2.3.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for necpp-2.3.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c71f39ce062e4ea8e78b705052343eab201dd3b81beb61182b059c6f2a78f3d8
MD5 0ea87eea95ac4c4ee82602cc91e178a1
BLAKE2b-256 c53a057746b00b16031a2a32e6f8d0aa79ace516848ada0b03914b80a7515146

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.3.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-necpp-wheels.yml on tmolteno/python-necpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file necpp-2.3.2-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for necpp-2.3.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0dd57d74a6d28c4e346ea400be6ce5d0e47fd6afa465bc2abcdc3f04148131bf
MD5 93f979812bb28b0d16ebe7ea95031d69
BLAKE2b-256 bef775f0ca471c86ed438c2caaa61474925e211fb77830e38f375875054cc583

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.3.2-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: build-necpp-wheels.yml on tmolteno/python-necpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file necpp-2.3.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for necpp-2.3.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8d4f6c9ebadb3b7ae599003c3e283477a06b07274a02e52920399466f617a390
MD5 ee6c21ea99bce6b897db10de6c16cfd9
BLAKE2b-256 61ff4b48f8013f8c753a4295f546a490c29c6b66a848fa3fa92c26ea49f8a0d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.3.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-necpp-wheels.yml on tmolteno/python-necpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file necpp-2.3.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for necpp-2.3.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3893cd51ce0952f8ee5a8fe3e76ba2ddabdffaa63bdab7fffa5400f9fd3cf4d9
MD5 8d404ab88d6ae5d6161953207c1d7ad6
BLAKE2b-256 4f20ebe66fb3716cd568ab372fa195f8dd1adea8b9b8e90bc0f6135f2a383084

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.3.2-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build-necpp-wheels.yml on tmolteno/python-necpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file necpp-2.3.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for necpp-2.3.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7d1a9b74adbb918a9bee4bfa34a7c0ed0795d7bad0f9641ecd7110c845663320
MD5 14d1bfe59b7038f7c03212415681faad
BLAKE2b-256 1dbc440a03ad985800b0fda9dc735253c7d260fd60ec2f992d6a8af4972810ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.3.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-necpp-wheels.yml on tmolteno/python-necpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file necpp-2.3.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for necpp-2.3.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d8c351b53f1011ea06d31e0c62f58f448e0a1394b181f850f871ab3f0892060c
MD5 98824640d8c8e8e57b4944a248c3126d
BLAKE2b-256 327825240dc716ba4dbdeebdc6f09521ab629781b533ad1678d3793058c1018e

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.3.2-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build-necpp-wheels.yml on tmolteno/python-necpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file necpp-2.3.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for necpp-2.3.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 eb98539df1a8239de646519535f96e62951d4978c687acc500df1c15977baa24
MD5 93d2f897875e87c04056e4b369a5809e
BLAKE2b-256 db23377b871f06ae52adeb25695664eb9aa7f9551b47bb6137f485459dc1c863

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.3.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-necpp-wheels.yml on tmolteno/python-necpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file necpp-2.3.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for necpp-2.3.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 082dde3e9c0a1f19cda199731d6ed790837a795f6bc4520fc72a1a86ddf64cb0
MD5 52492e8880ab5746269ae94ba5d00fba
BLAKE2b-256 9b72c38d9e9392a51c7472379fb980087d204f97aea175e869d50a117dd6bc9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.3.2-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build-necpp-wheels.yml on tmolteno/python-necpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.3.4

9 files

This release

2.3.2 This release

9 files

2.2.6

9 files

2.2.5

9 files

2.2.4

9 files

2.2.3

9 files

2.2.2

9 files

2.2.1

9 files

1.8.2

9 files

1.8.1

10 files

1.7.4

3 files

1.7.3.5

1 file

1.7.3.2

1 file

1.7.3.1

1 file

1.7.3

1 file

1.7.0.3

1 file

1.7.0.2

1 file

1.6.1.4

1 file

1.6.1.3

1 file

1.6.1.2

1 file

1.6.1.1

1 file

1.6.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page