lasprs/examples_py/test_ppm.ipynb

98 lines
1.9 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "ec44a8b1-7508-470b-bb2e-f26c7ad8e851",
"metadata": {},
"outputs": [],
"source": [
"!cd .. && maturin develop -F python-bindings"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "29b4422e-844b-4944-a391-313ef0ed26e4",
"metadata": {},
"outputs": [],
"source": [
"from lasprs import StreamMgr, ClipState, PPM"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a12659c7-5ec9-4011-accc-423c4c660701",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"smgr = StreamMgr()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "709aa842-0c47-422c-806b-edf2bf97df4b",
"metadata": {},
"outputs": [],
"source": [
"smgr.startDefaultInputStream()\n",
"ppm = PPM(smgr)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2eb1bf1a-8133-421a-ac3e-d609e83ad763",
"metadata": {},
"outputs": [],
"source": [
"import time\n",
"N = 0\n",
"while N < 60:\n",
" try:\n",
" print(ppm.getState(), end='\\r')\n",
" except KeyboardInterrupt:\n",
" break\n",
" time.sleep(0.1)\n",
" N += 1\n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7d94d2fb-c03e-415e-b58b-86dc70865c2e",
"metadata": {},
"outputs": [],
"source": [
"del ppm"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}