A python package to compress sat data
Project description
satcompression
Efficient decomposition of satellite images in a Quad-Tree structure
Installation
pip install satcompression
Usage
Compression and decompression of satellite images using the Quad-Tree structure.
import satcompression
import rasterio as rio
# Load an image
with rio.open('path/to/image.tif') as src:
image_meta = src.meta
image_data = src.read()
# Compress the image
image_data_compress = satcompression.compress_and_encode_image_data(
image_data=image_data, detail_error_threshold=20
)
# Decompress the image
image_data_decompress = satcompression.reconstruct_image_data(
data=image_data_compress, dtype=image_data.dtype, nchannels = image_data.shape[0]
)
Obtain the pseudo-mtf from the quadtree structure.
import satcompression
import matplotlib.pyplot as plt
with rio.open('path/to/image.tif') as src:
image_data = src.read()
mtf_values1, x_axis1 = satcompression.quadtree_mtf(image_data, 10, detail_error_threshold=20)
mtf_values2, x_axis2 = satcompression.quadtree_mtf(image_data, 10, detail_error_threshold=10)
mtf_values3, x_axis3 = satcompression.quadtree_mtf(image_data, 10, detail_error_threshold=5)
plt.plot(x_axis1, mtf_values1, label="Detail Error Threshold: 0.002")
plt.plot(x_axis2, mtf_values2, label="Detail Error Threshold: 0.001")
plt.plot(x_axis3, mtf_values3, label="Detail Error Threshold: 0.0005")
plt.legend()
plt.ylim(0, 1.2)
plt.title("Pseudo-MTF obtained from the quadtree decomposition")
plt.show()
Obtain the classification of the quadtree nodes.
import satcompression
with rio.open('path/to/image.tif') as src:
image_data = src.read()
satcompression.create_classification_map(image_data, detail_error_threshold=20)
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 satcompression-0.0.3.tar.gz.
File metadata
- Download URL: satcompression-0.0.3.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/7.0.1 keyring/24.3.1 pkginfo/1.9.6 readme-renderer/34.0 requests-toolbelt/1.0.0 requests/2.31.0 rfc3986/1.5.0 tqdm/4.66.1 urllib3/2.2.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c10fbfa83c8e0bd3be0dca31b76a62705bdb36b0949cc4ba5c5e52766ebaf1b
|
|
| MD5 |
04c05358b762af03e1504b8e468134a2
|
|
| BLAKE2b-256 |
49c6222cc01e27ea56f527e406c22732ca3f4a131bd656e4c193e3bd9995b4dc
|
File details
Details for the file satcompression-0.0.3-py3-none-any.whl.
File metadata
- Download URL: satcompression-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/7.0.1 keyring/24.3.1 pkginfo/1.9.6 readme-renderer/34.0 requests-toolbelt/1.0.0 requests/2.31.0 rfc3986/1.5.0 tqdm/4.66.1 urllib3/2.2.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6af0c812035a4f13da621a728b82a87d47eae9da84159a1b2c805f92aff35027
|
|
| MD5 |
fb6d77b08eca1eb94b9817e7a06c14e2
|
|
| BLAKE2b-256 |
4bf9f36588629bfec616ed33253626d5d266f497432257f834f7cc144606b15e
|