Skip to main content

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]
)

image

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()

image

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)

image

Metadata

Release files for satcompression 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for satcompression 0.0.3
File Size Uploaded
satcompression-0.0.3.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for satcompression 0.0.3
File Interpreter ABI Platform
satcompression-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 18.5 kB

Release files / satcompression-0.0.3.tar.gz

Download URL satcompression-0.0.3.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6c10fbfa83c8e0bd3be0dca31b76a62705bdb36b0949cc4ba5c5e52766ebaf1b
BLAKE2b-256 checksum
How to use checksums
49c6222cc01e27ea56f527e406c22732ca3f4a131bd656e4c193e3bd9995b4dc
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / satcompression-0.0.3-py3-none-any.whl

Download URL satcompression-0.0.3-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6af0c812035a4f13da621a728b82a87d47eae9da84159a1b2c805f92aff35027
BLAKE2b-256 checksum
How to use checksums
4bf9f36588629bfec616ed33253626d5d266f497432257f834f7cc144606b15e
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page