Skip to main content

Velociraptor catalogue reading routines.

Project description

Velociraptor Python Library

Documentation Status

Velociraptor catalogues provide a signifciant amount of information, but applying units to it can be painful. Here, the unyt python library is used to automatically apply units to velociraptor data and perform generic halo-catalogue reduction. This library is primarily intended to be used on SWIFT data that has been post-processed with velociraptor, but can be used for any velociraptor catalogue.

The internals of this library are based heavily on the internals of the swiftsimio library, and essentially allow the velociraptor catalogue to be accessed in a lazy, object-oriented way. This enables users to be able to reduce data quickly and in a computationally efficient manner, without having to resort to using the h5py library to manually load data (and hence manually apply units)!

Requirements

The velociraptor library requires:

  • unyt and its dependencies
  • h5py and its dependencies
  • python3.6 or above

Note that for development, we suggest that you have pytest and black installed. To create the plots in the example directory, you will need the plotting framework matplotlib.

Installation

You can install this library from PyPI using:

pip3 install velociraptor

Documentation

Full documentation is available on ReadTheDocs.

Why a custom library?

This custom library, instead of something like pandas, allows us to only load in the data that we require, and provide significant context-dependent features that would not be available for something generic. One example of this is the automatic labelling of properties, as shown in the below example.

from velociraptor import load
from velociraptor.tools import get_full_label

catalogue = load("/path/to/catalogue.properties")

stellar_masses = catalogue.apertures.mass_star_30_kpc
stellar_masses.convert_to_units("msun")

print(get_full_label(stellar_masses))

This outputs "Stellar Mass $M_*$ (30 kpc) $\left[M_\odot\right]$", which is easy to add as, for example, a label on a plot.

Project details


Download files

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

Source Distribution

velociraptor-0.21.0.tar.gz (88.0 kB view details)

Uploaded Source

Built Distribution

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

velociraptor-0.21.0-py3-none-any.whl (99.4 kB view details)

Uploaded Python 3

File details

Details for the file velociraptor-0.21.0.tar.gz.

File metadata

  • Download URL: velociraptor-0.21.0.tar.gz
  • Upload date:
  • Size: 88.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for velociraptor-0.21.0.tar.gz
Algorithm Hash digest
SHA256 3fa7f497ff783527a868c0bc5f24e899407b779b06d654bbcf01651f48a4087b
MD5 932f999b697330a8835f7a6a38fdbc86
BLAKE2b-256 f688171335d0721cc4a04e9df38c3cfc68575ef1e9d578c9342ba431ce3c4e0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for velociraptor-0.21.0.tar.gz:

Publisher: python-publish.yml on SWIFTSIM/velociraptor-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file velociraptor-0.21.0-py3-none-any.whl.

File metadata

  • Download URL: velociraptor-0.21.0-py3-none-any.whl
  • Upload date:
  • Size: 99.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for velociraptor-0.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7ff33479db8e9b9842b4c29973c370d83ac0e594d396bb4b843e3f530ae3c48
MD5 79b9880fe19c18083f9cd4fe7b0ca81e
BLAKE2b-256 d47fa90f04ee536de8dbd6535ddabf23fc245a8491052955760fb5ab2a3d481b

See more details on using hashes here.

Provenance

The following attestation bundles were made for velociraptor-0.21.0-py3-none-any.whl:

Publisher: python-publish.yml on SWIFTSIM/velociraptor-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page