Skip to main content

A small package to read OSIRIS HDF5 Data in python

Project description

OSIRISPY

osirispy is a python package for reading simulation output for the particle-in-cell code OSIRIS. It utilizes the numpy interface to provide a simple way to readsimulation output.

Installing osirispy

osirispy is available on PyPI. You can install it by running the following command inside your terminal

pip install osirispy

pip3 install osirispy

Using osirispy

import the package in python

import osirispy as ospy

You can use the function ospy.read() to read osiris files. It will give a different output based on the type of file that is being opened.

grid files

Grid files are the output of vdf objects and can have between 1 and 3 dimensions. They can represent charge density, current, E.M. fields, phasespaces, etc...

ospy.read("/path/to/grid.h5") will output a grid object when reading a grid-type file. The data is a numpy array accessible at grid.data The object also contains a list of axis containing the physical dimentions of the grid file at grid.axis.

particle (aka RAW) files

Particle files contain the output of the RAW diagnostic for a given species at a given time-step. RAW files contain information on the quantities x1,x2,x3,p1,p2,p3,ene. ospy.read(filepath,req_quantitites) will output a raw object with the required quantities specified with a list of strings on the req_quantities parameter.

The data is a python dictionary of numpy arrays accessible at grid data. An example is given below:

# read raw data
rawdata=ospy.read("/path/to/raw.h5",("x1","x2"))
#access x1 array
x1=rawdata.data["x1"]

The object also contains a dictionary with the label of each quantity accessible at raw.label.

track files

Track files contain the output of the tracks diagnostic for a given species . Track files contain information on the quantities t,x1,x2,x3,p1,p2,p3,ene. ospy.read(filepath,req_quantitites) will output a tracks object

The data is a python dictionary of a list of numpy arrays accessible at grid data. An example is given below:

# read tracks data
trackdata=ospy.read("/path/to/track.h5",("x1","x2"))
#access x1 array of particle i
x1=trackdata.data["x1"][i]

The object also contains a dictionary with the label of each quantity accessible at raw.label.

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

osirispy-0.0.11.tar.gz (177.7 kB view details)

Uploaded Source

Built Distribution

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

osirispy-0.0.11-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file osirispy-0.0.11.tar.gz.

File metadata

  • Download URL: osirispy-0.0.11.tar.gz
  • Upload date:
  • Size: 177.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for osirispy-0.0.11.tar.gz
Algorithm Hash digest
SHA256 201f979c478c6673b69cd70f0744e053a4a55e634a02c668177534ce391384e9
MD5 590ba6fafbb66aad6ce6fe3e1f803c33
BLAKE2b-256 ed5c09fde67da857731f7b9273a2d82f36e3825c11c40940ffd3f5de2529869c

See more details on using hashes here.

File details

Details for the file osirispy-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: osirispy-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for osirispy-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 e4a159b42210b75d52a77a294d4b7a8eaf4d1d1bb9265a5b714f23dac7d9b3c3
MD5 d711e89e1d1ab05dc3f675c62e75547a
BLAKE2b-256 b0079c835f8baa4111fc9905b42118f6eacbc242b3bd87c6abef55c9612c09bd

See more details on using hashes here.

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