Beamshapes
Calculate directivity of various sound source models and get their beamshapes.
This package is released under an MIT license.
Getting started with beamshapes
>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> import beamshapes
>>> from beamshapes import piston_in_infinite_baffle_directivity as PIB # short alias
>>> input_parameters = {'k':50, 'a':0.1}
>>> angles = np.linspace(-np.pi/2,np.pi/2,50)
>>> _, directionality = PIB(angles, input_parameters) # output the dB(D(theta)/D(on-axis))
>>> plt.figure();a0 = plt.subplot(111, projection='polar')
>>> plt.plot(angles, directionality) # plot the beamshape !!
For more detailed use-cases, check out the example gallery online!
Installation
Pre-PyPi installation instructions For the steps below to work you need to have a working Python installation that you can access from the command line. It is recommended to do the installation in a virtual environment.
- Clone the Github repository
git clone https://github.com/thejasvibr/bat_beamshapes.git - Change directories to the downloaded repo, and switch to the dev branch:
git checkout dev - Install the dependencies with
pip install -r beamshapes/tests/requirements_test.txt - Install beamshapes with
python setup.py install
Detailed documentation
For more details on the concepts and source documentation - please check out the online docs.
Citation information
If you use this package - please do consider citing the preprint:
*Beleyur, T. (2021, August 5). beamshapes : a Python package to generate directivity patterns for various sound sources. https://doi.org/10.31219/osf.io/zc52t, version {VERSIONNUMBER-HERE} *
You can access the version number of the package being used with
>>> import beamshapes
>>> print(beamshapes.__version__)
Bibtext format:
@misc{beleyur_2021,
title={beamshapes : a Python package to generate directivity patterns for various sound sources},
url={osf.io/zc52t},
DOI={10.31219/osf.io/zc52t},
publisher={OSF Preprints},
author={Beleyur, Thejasvi},
year={2021},
month={Aug}
}
Future implementations
- Piston on a cylinder
- Rectangular piston on a prolate spheroid (paper)
TODO:
- Add more examples
- Remove 'a' parameter from piston in sphere directivity? (next releases, this is backwards incompatible!)
Metadata
Release files for beamshapes 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| beamshapes-0.2.1.tar.gz | 25.1 kB | Without provenance | Details for beamshapes-0.2.1.tar.gz |
Release files / beamshapes-0.2.1.tar.gz
| Download URL | beamshapes-0.2.1.tar.gz |
|---|---|
| Size | 25.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71db5fa3d657c6b26fe2399f0f419c72fe17540652b74f966d03dc4c52607f23
|
|
BLAKE2b-256 checksum How to use checksums |
ae89532c19a4917de0864429030f31bd3b6f5bb4001b57a63c1b3c6613723ea1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.11
|
Security for beamshapes 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.