Stretched Equal Area Generator
Project description
SEAGen
A python implementation of the stretched equal area (SEA) algorithm for generating spherically symmetric arrangements of particles with accurate particle densities, e.g. for SPH initial conditions that precisely match an arbitrary density profile, as presented in Kegerreis et al. (2019), MNRAS 487:4, 5029-5040, https://doi.org/10.1093/mnras/stz1606.
See also https://github.com/srbonilla/WoMa for making input planetary profiles, placing particles with SEAGen, and modifications for spinning bodies.
Jacob Kegerreis (2020) jacob.kegerreis@durham.ac.uk
Josh Borrow
Visit https://github.com/jkeger/seagen to download the code including examples and for support.
This program has been tested for a wide range of cases but not exhaustively. If you find any bugs, potential improvements, or features worth adding, then please let us know!
Contents
seagen.pyThe main program classes and functions.examples.pyExamples to demonstrate how to use the SEAGen module.setup.py,setup.cfg,__init__.py,MANIFEST.inPython package files.LICENSE.txtGNU general public license v3+.
Basic Usage
- See the doc strings in
seagen.pyfor all the details. - Create a single shell of particles and print their positions:
import seagen N = 100 r = 1 particles = seagen.GenShell(N, r) print(particles.x, particles.y, particles.z)
- Create a full sphere of particles on a simple density profile and print their
positions and masses:
import seagen import numpy as np N = 100000 radii = np.arange(0.01, 10, 0.01) densities = np.ones(len(radii)) # e.g. constant density particles = seagen.GenSphere(N, radii, densities) print(particles.x, particles.y, particles.z, particles.m)
- See
examples.pyfor other working examples, e.g. an arbitrary density profile with multiple layers and extra temperature information.
Installation
PyPI: Automatically install the package withpip install seagen, see https://pypi.org/project/seagen/- Direct download: The single
seagen.pyfile can be imported and used without any extra installation, so you can just download this repository and place the file in a local directory or wherever your python will look for modules.
Requirements
- Python 3 (tested with 3.6.0).
Notation etc.
- Formatted with black.
- Arrays are explicitly labelled with a prefix
A1_, orAn_for ann-dimensional array. - Particle is abbreviated to
picle.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file seagen-1.5.tar.gz.
File metadata
- Download URL: seagen-1.5.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a12337f3f568e9ce5beaf1fa2b5522b438963b40184625b8fe7f85adbd80d702
|
|
| MD5 |
9fc9678765fa1fa60546be6b969105b7
|
|
| BLAKE2b-256 |
bdcf16c9cd47f1da1ee4ccbcbb94383bb951f99f83404c588a8f1f8df6186705
|
File details
Details for the file seagen-1.5-py3-none-any.whl.
File metadata
- Download URL: seagen-1.5-py3-none-any.whl
- Upload date:
- Size: 27.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
841ac54d23bffc318c76a637215617ad1ff614bff5e95b706c326277a043834d
|
|
| MD5 |
c57a47a178420a96151cd2e6ce032450
|
|
| BLAKE2b-256 |
4f5f7174bb61ed41d495d51ed8c712b0c2de38b258f1d5fa306fbcc7992375e8
|