Skip to main content

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.

Release files for osirispy 0.0.13

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

Source distribution (sdist)

Source distribution for osirispy 0.0.13
File Size Uploaded
osirispy-0.0.13.tar.gz 2.9 MB Details

Built distribution (wheel)

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

Total release size: 2.9 MB

Release files / osirispy-0.0.13.tar.gz

Download URL osirispy-0.0.13.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
7910bf67da24a674a060ffd29386d24797e11fe3777efd7e8bc38471055ff665
BLAKE2b-256 checksum
How to use checksums
7fd7063a67b30dc160247d77543ccb385888057f1a900f19bcf1bd3c5d656dda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.9

Release files / osirispy-0.0.13-py3-none-any.whl

Download URL osirispy-0.0.13-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
418d6416d334054db51ac0f6c112de746e50fb91f88e995a4c72fe31b8e5dd3d
BLAKE2b-256 checksum
How to use checksums
a4dd3b28e5bebfdd4e8b4d949bcc53fd1caaa1adfb49d325f5ce344b7c632342
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.0.13 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.3

2 release files

0.0.2

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