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

Metadata

Release files for utilities-awetzel 1.1

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

Source distribution (sdist)

Source distribution for utilities-awetzel 1.1
File Size Uploaded Provenance Actions
utilities_awetzel-1.1.tar.gz 107.9 kB Without provenance Details for utilities_awetzel-1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for utilities-awetzel 1.1
File Interpreter ABI Platform Actions
utilities_awetzel-1.1-py3-none-any.whl Python 3 none any Details for utilities_awetzel-1.1-py3-none-any.whl

Total release size: 220.2 kB

Release files / utilities_awetzel-1.1.tar.gz

Download URL utilities_awetzel-1.1.tar.gz
Size 107.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bb4080ef3dc86b303673602dfef29424211db6075df07bf99c962aed14997449
BLAKE2b-256 checksum
How to use checksums
f76490b682429066949d23e69e6d5904b6547f7c3afe37b6b4f57396aec0a409
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / utilities_awetzel-1.1-py3-none-any.whl

Download URL utilities_awetzel-1.1-py3-none-any.whl
Size 112.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de9df723b39c254fea6f5455ba219e0396810447ec161cb64fef0ebabfbe5999
BLAKE2b-256 checksum
How to use checksums
1b03c43fb130926e8e7730f98a5aa09a1ce9ffed3ad6caa1b221ce6f7d9b3be1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for utilities-awetzel 1.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.

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