PySTARE
Introduction
PySTARE exposes the STARE library to python.
Requirements
Pystare requires STARE to be installed. It expects either:
libSTARE.ain /usr/local/lib/ and STARE.h in /usr/local/include/ or- the variables STARE_LIB_DIR and STARE_INCLUDE_DIR to be set e.g. with:
export STARE_INCLUDE_DIR=/path/to/directory-containing-stare.h/
export STARE_LIB_DIR=/path/to/directory-containing-stare.a/
Build and install STARE e.g. with:
git clone https://github.com/SpatioTemporal/STARE
cd STARE
mkdir build
cd build
cmake -DSTARE_INSTALL_LIBDIR=lib -DBUILD_SHARED_LIBS=NO ../
make -j4
sudo make install
It may be necessary to set PYTHON_INCLUDE_DIRS, if, for example, numpy headers cannot be found.
Installation
Wheels for manylinux exist on pypi
pip install pystare
Or install from source:
export STARE_INCLUDE_DIR=/path/to/directory-containing-stare.h/
export STARE_LIB_DIR=/path/to/directory-containing-stare.a/
git clone https://github.com/SpatioTemporal/pystare
pip3 install pystare/
Manual build
python3 setup.py build_ext --inplace
python3 setup.py bdist_wheel
python3 setup.py sdist
Tests
pystare uses pytest. Pytest is configured in pytest.ini.
Run pytest to run all tests.
To run the doctest,
pytest --doctest-modules
To run tests of a specific module
pytest /path/to/module.py
Documentation
pystare uses sphinx
pip install sphinx-markdown-tables
sphinx-automodapi
myst_parser
nbsphinx
numpydoc
pydata-sphinx-theme
Usage
Spatial
import numpy
import pystare
lat = numpy.array([30,45,60], dtype=numpy.double)
lon = numpy.array([45,60,10], dtype=numpy.double)
indices = pystare.from_latlon(lat, lon, 12)
print('0 indices: ', [hex(i) for i in indices])
lat, lon = pystare.to_latlon(indices)
print(lat, lon)
lat, lon, level = pystare.to_latlonlevel(indices)
print(lat, lon, level)
level = pystare.to_level(indices)
print(level)
area = pystare.to_area(indices)
print(area)
Temporal
import numpy
import pystare
datetime = numpy.array(['1970-01-01T00:00:00',
'2000-01-01T00:00:00',
'2002-02-03T13:56:03.172',
'2016-01-05T17:26:00.172'], dtype=numpy.datetime64)
print(datetime)
print(datetime.astype(numpy.int64))
index = pystare.from_ms_since_epoch_utc(datetime.astype(numpy.int64), 6, 6)
print([hex(i) for i in index])
index = pystare.from_ms_since_epoch_utc(datetime.astype(numpy.int64), 27, 27)
print([hex(i) for i in index])
Common issues when building
undefined symbol
- STARE and pystare out of sync. Are we building against the correct STARE version?
- Stale pystare targets.
python setup.py cleanmight help - Missing function headers in
PySTARE.h
Metadata
Release files for pystare 0.8.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pystare-0.8.17-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.17+ x86-64 | Details |
| pystare-0.8.17-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.17+ x86-64 | Details |
| pystare-0.8.17-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.17+ x86-64 | Details |
| pystare-0.8.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.17+ x86-64 | Details |
| pystare-0.8.17-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.17+ x86-64 | Details |
Total release size: 19.4 MB
Release files / pystare-0.8.17-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pystare-0.8.17-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
3f83fee4ce9052c4fb82f0eb29dfe040d9cb3cd93a9bc5a3f2ca7983b0e4b016
|
|
BLAKE2b-256 checksum How to use checksums |
cee2dcd454962675efda44f86b60e25e069fd21113c2d8a6fdbb7425d78620d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / pystare-0.8.17-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pystare-0.8.17-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
c146f36ad81db997c3d7dc0da724417996eeedf301a52af71536f0085e431db3
|
|
BLAKE2b-256 checksum How to use checksums |
0660f29ceaf18af0c465dd98e7fee9ba351ff21780817b4ecf8e59221e1b3ba2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / pystare-0.8.17-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pystare-0.8.17-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
cc9387f0e71e737daf8e3e31a54f293bdf781863153cdb0bb422b09cb26a6d4a
|
|
BLAKE2b-256 checksum How to use checksums |
53aba90f66258759f39e1e8e400c5226a30754f3fc8c9aaacdeb827cf45480ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / pystare-0.8.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pystare-0.8.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d663be4e5e3eebef72a49fda3bdaae391b548727906a7bb8efa8ca925ebf1619
|
|
BLAKE2b-256 checksum How to use checksums |
cf65fc68864a06212af492f77d64af6dd680481e3d965073747a4a759354d1af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / pystare-0.8.17-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pystare-0.8.17-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
424b9ba5ab892ae82237faec0cf81c1bf619ead90427e14e0a8a8fad7a46f9a5
|
|
BLAKE2b-256 checksum How to use checksums |
4cf0dd7b634b89878b4f92eec14a0235410c5e77fe63fe18b520fc395769afbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|