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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osirispy-0.0.10.tar.gz.
File metadata
- Download URL: osirispy-0.0.10.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10fa22dd8e289b4aacd0e6cb48c96bb7652db01015056df06ff9bcfb7dcd56ff
|
|
| MD5 |
47ba8f29b79974f45ea5f188da20c2f8
|
|
| BLAKE2b-256 |
bfbe2e32bbdc81ba1a26de346ded1e5dedd803796e648eb47343d3f5b3954daa
|
File details
Details for the file osirispy-0.0.10-py3-none-any.whl.
File metadata
- Download URL: osirispy-0.0.10-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdc176a1fec62da1615881d208dca53ab445fc3a8635be5e0dcf5d63b4032be5
|
|
| MD5 |
f90a09cc1035e6f52b2f6c352842cbd8
|
|
| BLAKE2b-256 |
6f869687f45666c7317d0bcd81fb8b1c002471400ce254fb1cf7e81a6993ea69
|