Warning, /education/kstars/kstars/python/readme.md is written in an unsupported language. File is not indexed.

0001 # Python Bindings
0002 
0003 This directory contains some basic `python` bindings to allow `HTMesh`
0004 indexation from python scripts. The bindings are created with
0005 [pybind11](https://github.com/pybind/pybind11).
0006 
0007 ## Building/Installing
0008 Make sure you can build `kstars` and have `pybind11` installed.
0009 
0010 ### Distutils
0011 Run `python3 setup.py install`.
0012 
0013 ### CMake
0014 Use the flag `-DBUILD_PYKSTARS=ON` when configuring kstars with cmake
0015 and then build the `pykstars` target. The python module
0016 `kstars/python/pykstars.cpython-*.so` will be built and can then be
0017 imported.
0018 
0019 ## Usage
0020 ### Indexer
0021 The class `pykstars.Indexer` is a thin wrapper to interface with the
0022 `SkyMesh` implementation in KStars.
0023 
0024 The constructor takes the `HTMesh` level as an argument. The only
0025 interesting method of the Indexer is `get_trixel` which takes the
0026 right ascension and declination of some object and returns the
0027 computed trixel id. The third argument can optionally be set to `True`
0028 if an epoch conversion from `B1950` to `J2000` is required.
0029 
0030 ```python
0031 >>> import kstars.python.pykstars as pykstars
0032 >>> I = pykstars.Indexer(7)
0033 >>> I.get_trixel(1, 2, True)
0034 123356
0035 >>> I.get_trixel(1, 2)
0036 123353
0037 ```
0038 
0039 ### DBManager
0040 These are just straight python bindings for the `CatalogsDB::DBManager` class.
0041 
0042 ## Authors
0043  - Valentin Boettcher <hiro at protagon.space>, hiro98:kde.org