Skip to main content

Description

Python package of utility functions that are useful in analyzing various datasets, in particular, catalogs of particles or galaxies/halos from cosmological simulations.

The GizmoAnalysis and HaloAnalysis packages depend on this package.


Requirements

python 3, numpy, scipy, h5py, matplotlib


Content

lower-level utilities

array.py

  • create, manipulate, analyze arrays

binning.py

  • binning of array data

constant.py

  • physical constants and unit conversions

coordinate.py

  • manipulate positions and velocities

io.py

  • read, write, print during run time

math.py

  • math, statistics, and fitting

plot.py

  • supplementary functions for plotting with matplotlib

higher-level utilities

catalog.py

  • analyze catalogs of halos/galaxies

cosmology.py

  • calculate cosmological values, including cosmic density, distance, age, volume

halo_property.py

  • calculate halo properties at different radii, convert between virial definitions

orbit.py

  • compute orbital quantities such as peri/apo-centric distance, orbital time, in a given gravitational potential

particle.py

  • high-level analysis of N-body particle data

simulation.py

  • tools to help set up and run a simulation

Units

Unless otherwise noted, this package stores all quantities in (combinations of) these base units

  • mass [M_sun]
  • position [kpc comoving]
  • distance, radius [kpc physical]
  • time [Gyr]
  • temperature [K]
  • magnetic field [Gauss]
  • elemental abundance [linear mass fraction]

These are the common exceptions to those standards

  • velocity [km/s]
  • acceleration [km/s / Gyr]
  • gravitational potential [km^2 / s^2]
  • rates (star formation, cooling, accretion) [M_sun / yr]
  • metallicity (if converted from stored massfraction) [log10(mass_fraction / mass_fraction_solar)], using Asplund et al 2009 for Solar

Installing

The easiest way to install this packages is by using pip:

python -m pip install utilities_awetzel

Alternately, and especially if you want to ensure that you have the latest version, you can clone and install from bitbucket, in one of two ways:

using HTTPS:

git clone https://awetzel@bitbucket.org/awetzel/utilities.git

or using SSH:

git clone git@bitbucket.org:awetzel/utilities.git

Then do one of the following:

  1. either point your PYTHONPATH to this repository

  2. or build and install this project via pip by going inside the top-level utilities/ directory and doing:

python -m pip install .

Using

Once installed, you can use individual modules like this:

import utilities as ut
ut.particle

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

utilities_awetzel-1.1.tar.gz (107.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

utilities_awetzel-1.1-py3-none-any.whl (112.2 kB view details)

Uploaded Python 3

File details

Details for the file utilities_awetzel-1.1.tar.gz.

File metadata

  • Download URL: utilities_awetzel-1.1.tar.gz
  • Upload date:
  • Size: 107.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for utilities_awetzel-1.1.tar.gz
Algorithm Hash digest
SHA256 bb4080ef3dc86b303673602dfef29424211db6075df07bf99c962aed14997449
MD5 8f289d0e1cf9d8a19f7c0251cccaf78e
BLAKE2b-256 f76490b682429066949d23e69e6d5904b6547f7c3afe37b6b4f57396aec0a409

See more details on using hashes here.

File details

Details for the file utilities_awetzel-1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for utilities_awetzel-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de9df723b39c254fea6f5455ba219e0396810447ec161cb64fef0ebabfbe5999
MD5 b89e345d8ae92e6fba6f37e50e16cb92
BLAKE2b-256 1b03c43fb130926e8e7730f98a5aa09a1ce9ffed3ad6caa1b221ce6f7d9b3be1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1 This release

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

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