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.6.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.6-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.2.6-cp314-cp314-macosx_11_0_arm64.whl (244.1 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: necpp-2.2.6.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.6.tar.gz
Algorithm Hash digest
SHA256 ee28de8a8db895f7950bd3f52f0e696c813c8060a1fafdf8ea49ffa234bd61aa
MD5 7d7c9cf04fc5c39084d011337fe798c2
BLAKE2b-256 51984b5579b5987f041e20c8c92c62da1243c16dfbe784fc80d31b6d843627ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.2.6.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.6-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for necpp-2.2.6-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d461a0a1c29f3095b6026c9c0d855b55f304acdc5a8b9cae03b8a44df5e39059
MD5 08ff6f3fa01667c8342a208b637186c5
BLAKE2b-256 95b0c8991eab92b245af0dbdbeb263cbe36a5436234eb9c4bd5d211b860fbb6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for necpp-2.2.6-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.2.6-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for necpp-2.2.6-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd4ff31ad78928ee09136b05ce5afbc4a2de8ec9f1cd3843a277c1b825375c43
MD5 4232a3c8f83c4ab67bf81592f43b8fa7
BLAKE2b-256 cf4f078b0037d04a539ea3943888d5c72448de924219ac9f6e7cba0e8ec5db7c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for necpp-2.2.6-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c9b3cb819bb3106a68f6e0a6df7599fcaac5574822c9bef9c1d6f4c37d4f881c
MD5 5c1a8da0b378d47a0f971efaae069817
BLAKE2b-256 88e1a5e4cc6f5cf76b73e1b1d2f8e2836af625fe82b663b6b2eb2fd854daeb9c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for necpp-2.2.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 18ff80393264a51f3a1e28c0767a547139ee2c516286c6e7925ff527a448c886
MD5 109d012764243725148c2dfb21eda932
BLAKE2b-256 ac14662c2bcd16e562df64b7dd846f36795088bee52a5c5eb631dd98702267a1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for necpp-2.2.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b9d64e3db12cb0bc14a6d6cc759990fb4302c2dd11eb5da89e4dcbe987ac4b85
MD5 15f46aed73aed8649471ca1257b796ef
BLAKE2b-256 dd72f7210ce4ab3e3f90ac0fafcf92e3d9acab2342d9edb1cb8ddb85972ed45d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for necpp-2.2.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cadf0df73445d6776067a8f133550f9721a95ae37222520eed8ae532a0760b1e
MD5 14bf43dee09721c5394008ebdf7b0c91
BLAKE2b-256 9da3f902120fc72ac6b233543e6825225f93cdd2c97b2c8333a8fac16fe853b8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for necpp-2.2.6-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b42e9d26ace25316c112b8d019c36e95974a93393e04966d7d60e410ac7d6273
MD5 82f28b854ddfa05910fdf5f1041aae7d
BLAKE2b-256 0b71ecbcd1501dc236dc40e83df2ed3f1f568f6f049f5226dd21f97d7180d02a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for necpp-2.2.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 55eeaaf38baf566676495af92d7edfda1b0b7a7bacaa0dc10c00945e66c0b31d
MD5 3bdfaffcb244bafdecc0030efbd85947
BLAKE2b-256 ce26904a4a4398f474e8f5888d732c334a3fe8150845d8ad600ca2e9af70e38f

See more details on using hashes here.

Provenance

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

2.3.2

9 files

This release

2.2.6 This release

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