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.2.5.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.2.5-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.2.5-cp313-cp313-macosx_11_0_arm64.whl (244.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

necpp-2.2.5-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.2.5-cp312-cp312-macosx_11_0_arm64.whl (244.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

necpp-2.2.5-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.2.5-cp311-cp311-macosx_11_0_arm64.whl (244.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

necpp-2.2.5-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (4.7 MB view details)

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

necpp-2.2.5-cp310-cp310-macosx_11_0_arm64.whl (244.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for necpp-2.2.5.tar.gz
Algorithm Hash digest
SHA256 3c26da43185997ae80dc46c731cda9c0e84be7a8ae794b355db108c62fc1d2cb
MD5 750eeb136fa3c456c88235538b1cab1c
BLAKE2b-256 df0c47a58e9fd9cd758dd74eb750c64d3d3ac7bbdd18f0e74d6fcb3da096188b

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.2.5.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.2.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for necpp-2.2.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ed241e8531972b8fe99532d3a37b2a8071973cd8a76553219ad88c6f0c0dfb16
MD5 98a2473f364aab6889310fd0d4ececf5
BLAKE2b-256 eb45c7be56df152243dea00f9ce61733ca9caf931230c587308db83b0132b909

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.2.5-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.2.5-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for necpp-2.2.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc9e39e66147ec96e00e336a8339ea7f13ff71adf21446e4a843e9b5622a214c
MD5 43b5d504aac0d1237d614d600321790d
BLAKE2b-256 5071616715e4cd634718e6ec86041ac824cd5bd2f06298be4585b0075823b659

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.2.5-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.2.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for necpp-2.2.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7bd983a7c66fa74eda09848acb0e5e5b3c1ad038dd0b1a20a67745f6b353b9d6
MD5 7adfc932fa288c70034a3786310816ca
BLAKE2b-256 42f2cedb6d55fec0934e6d69e948811680e55a574d3c514f9420ee02d071ee51

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.2.5-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.2.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for necpp-2.2.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44eec2d676019b7908158f14e42b018c74e81027bc50025db27fbb1ca35fde46
MD5 fe2eb22329c0572c9497ab1956af869f
BLAKE2b-256 7aa5a9505affd0acf221747f5f6af48f2f1a534f69b7626cfb069876cf48558e

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.2.5-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.2.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for necpp-2.2.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3de84673bc58b8529ced94588d20906c657f9a0a56dbfb199b6943432b77da89
MD5 d6ff6abb45802016fdc27af0ad3bd0fe
BLAKE2b-256 99890a65842f4fb3e5d0fd92c9520ee0c002b50d2096f58f57263e6c6977671a

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.2.5-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.2.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for necpp-2.2.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8de199babbf4dc9d80f9d26b36d4f27e1dba8e3ad0e0eb44f226b42be5296a11
MD5 98ddce89a46fa16682f26c82e872aa9a
BLAKE2b-256 db8bb2ef21913eb433e70033c7e1b12dcb62c295233424abf3b7587c57f6b94f

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.2.5-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.

File details

Details for the file necpp-2.2.5-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for necpp-2.2.5-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 638de9e2caeba533c882583fe5e8e713249ea1ff5c4d616ea2a5742c7e2a2216
MD5 9ff3b5d9e56951df33b037186280c46c
BLAKE2b-256 9b8d474126e9d75af6ba33c2dc87f13709728fc0ead524bef17632e7d0ab9dd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.2.5-cp310-cp310-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.2.5-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for necpp-2.2.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0818a74407ec124636dee495d9477461f65cfa73a1f11df61b0072e12deaf706
MD5 0e89c2ac480f5d34e92af0b572159b14
BLAKE2b-256 7a37a664176d429521706bb3a6fdeea66357e283fbafb41d31076a5ae477ebfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.2.5-cp310-cp310-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

2.3.2

9 files

2.2.6

9 files

This release

2.2.5 This release

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