The batread project is a Python library for reading
SWMF/BATSRUS
output and related Tecplot ASCII .dat and binary .plt datasets. The project also includes a use case in the form of a quicklook command, bat-quick, for visualising two-dimensional SWMF/BATSRUS output.
Installation
After cloning this repository, the project may be installed with pip in the regular way:
cd <project>
pip install .
This installs the reader functionality only. To use the quicklook plotting command, install the graphics extra:
pip install .[graphics]
Python code to access file data
This code reads a dataset named <file> and stores the dataset variable named Rho [g/cm^3] in a local variable named density_g_cm3.
from batread import Dataset
ds = Dataset.from_file('<file>')
print(ds)
density_g_cm3 = ds['Rho [g/cm^3]']
Running the quicklook command
A simple 'quicklook' shell command is included which permits plotting of two-dimensional slices of the SWMF/BATSRUS results. Irregularly gridded data is accepted. The quicklook command uses the plot function in basicplot.py but this may be extended by the user.
The quicklook command requires the graphics extra:
pip install .[graphics]
To create a quicklook .png file from the included file examples/x=0_var_2_n00000000.plt
run
cd examples
bat-quick x=0_var_2_n00000000.plt
This will create a file named ql-x-0-var-2-n00000000-plt-rho-g-cm-3.png; the name comprises the prefix ql, the file name, and the name of the plotted variable. Non-alphanumeric characters are normalised to dashes in the output file name.
A wildcard pattern may be used; in this case one .png file is created for each file matching the wildcard pattern:
bat-quick x*.plt
Development and testing
To install the project in editable mode and enable testing do
cd <project>
pip install --editable .[tests]
Now it is possible to run the test suite by typing
pytest
Metadata
Release files for batread 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| batread-1.1.0.tar.gz | 14.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| batread-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.7 kB
Release files / batread-1.1.0.tar.gz
| Download URL | batread-1.1.0.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00e85c19b57d0292312dbf1f6c28cda2987d4da6470d4223db869d4f96ed1918
|
|
BLAKE2b-256 checksum How to use checksums |
ab8f0bab985e736e840a4f7704ef36ac0c159a7617bc5ebf0df46b1260e2e0bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / batread-1.1.0-py3-none-any.whl
| Download URL | batread-1.1.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9601206b768b5aa8c6b5d2044e14bf2eae4d89f886347af364299457cdcc6d61
|
|
BLAKE2b-256 checksum How to use checksums |
d0f149298b334908b19028725faada8138062db520139d7d1557116ce8c258b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for batread 1.1.0
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.