Skip to main content

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.py The main program classes and functions.
  • examples.py Examples to demonstrate how to use the SEAGen module.
  • setup.py, setup.cfg, __init__.py, MANIFEST.in Python package files.
  • LICENSE.txt GNU general public license v3+.

Basic Usage

  • See the doc strings in seagen.py for 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.py for other working examples, e.g. an arbitrary density profile with multiple layers and extra temperature information.

Installation

  • PyPI: Automatically install the package with pip install seagen, see https://pypi.org/project/seagen/
  • Direct download: The single seagen.py file 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_, or An_ for an n-dimensional array.
  • Particle is abbreviated to picle.

Metadata

Release files for seagen 1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for seagen 1.7
File Size Uploaded
seagen-1.7.tar.gz 30.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for seagen 1.7
File Interpreter ABI Platform
seagen-1.7-py3-none-any.whl Python 3 none any Details

Total release size: 58.4 kB

Release files / seagen-1.7.tar.gz

Download URL seagen-1.7.tar.gz
Size 30.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c8f77424ad31ce5fd4df4fddc9ea6e92658be56f17bc6b3ae8dc65ec31494058
BLAKE2b-256 checksum
How to use checksums
b4f0e2e881357ef40f2e5a0c72ee237755c921cd5f77e69acac49ad87c4f87bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release files / seagen-1.7-py3-none-any.whl

Download URL seagen-1.7-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3abf21b619a47752eeaeef0bdd18edee8e0311ce9d56d3214d338fcd41614a59
BLAKE2b-256 checksum
How to use checksums
98aaaddaef0e7a51c6506998d77576ecf3a0b1f9a191fa9da8b7b7eec71465fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.7 This release

2 release files

1.6

2 release files

1.5

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

0.3

1 release file

0.2

1 release file

0.1

1 release 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