🌍 QKUN
Geoinformation Tools & Data Access for Satellite Observations
Qkun, pronaunced as "kun", is a Python package for querying, downloading, caching, and processing Earth observation satellite data.
🚀 Features
- ✅ Query satellite data (current & historical) by spatial and temporal bounds
- ✅ Download observational data by mission, instrument, and processing level
- ✅ Local LRU cache with automatic size limit and on-demand re-download
- ✅ Digest large data files into lightweight YAML summaries for quick inspection
📦 Installation
🧪 System Requirements:
- Python 3.9+
- Linux or macOS
- hdf5, netCDF, and other data format libraries
- use python virtual environment for isolation
If you are using MacOS, you may need to install hdf5 and netCDF libraries:
brew install hdf5 netcdf
If you are using Ubuntu, you may need to install hdf5 and netCDF libraries:
sudo apt-get install libhdf5-dev libnetcdf-dev
If you are using RedHat, you may need to install hdf5 and netCDF libraries:
sudo yum install hdf5 netcdf
Please activate a python virtual environment before installing the package:
python3 -m venv venv
source venv/bin/activate
🔗 Install from PyPI:
pip install qkun
🛠️ Install locally (dev mode)
git clone https://github.com/yourusername/qkun.git
cd qkun
pip install -e .
📁 Command-line Usage
🌐 Query satellite granules
search-granule pace OCI-L1B --start 2025-03-26 --end 2025-03-27 --lat -10 10 --lon 30 50
📦 Download satellite granules
search-granule pace OCI-L1B --start 2025-03-26 --end 2025-03-27 --lat -10 10 --lon 30 50 --quiet > download_list.txt
download-granule download_list.txt --select ::2 --save-dir ${HOME}/.cache/qkun
📊 Summarize large data files
digest-granule download_list.txt --select ::2 --save-dir ${HOME}/.cache/qkun
🛰️ Supported Missions, Instruments & Data Levels
| Mission | Instrument(s) | Data Level(s) |
|---|---|---|
| pace | OCI | L1B, L2 |
| aqua | AIRS,MODIS | L1B, L2 |
| gpm | GMI | L1B, L2 |
| sentinel-5p | TROPOMI | L1B, L2 |
| (More coming) | ... | ... |
🧠 Example Python API Usage
Assuming that you have already downloaded and digested the data using command-line tools, you can use the following Python API to access the data.
import os
from qkun import CACHE_FOLDER_PATH
from qkun.pace import OceanColor
basename = "PACE_OCI.20250326T103301.L1B.V3"
digest_path = os.path.join(CACHE_FOLDER_PATH, f"{basename}.global.yaml")
# create an instance of OceanColor
obs = OceanColor(digest_path, verbose=True)
# create auxiliary files such as footprint and field of view
# also saved in the cache folder
obs.process()
# get a lat-lon bounding box
box = obs.get_bounding_box()
# get instrument field of view
lon, lat = obs.get_fov()
# get data keys
keys = obs.get_data().variables.keys()
# subsample and average over bands
blue = obs.get_data("rhot_blue")[:,::5,::5].mean(axis=0)
🧹 Caching By default, all downloaded data are cached locally in:
~/.cache/qkun/
To change the cache directory and size limit, set these global variables:
import qkun
qkun.CACHE_FOLDER_PATH = '/path/to/cache'
qkun.CACHE_SIZE_LIMIT = 10. # in GB
🤝 Contributing
Contributions are welcome! Please open an issue or PR if you’d like to:
- Add new missions/instruments
- Improve download or parsing logic
- Enhance command line tools or add GUI
- Expand test coverage
📬 Contact
Maintained by @chengcli — feel free to reach out with ideas, feedback, or collaboration proposals.
Metadata
Release files for qkun 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qkun-0.4.1.tar.gz | 25.0 kB | Without provenance | Details for qkun-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qkun-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for qkun-0.4.1-py3-none-any.whl |
Total release size: 51.6 kB
Release files / qkun-0.4.1.tar.gz
| Download URL | qkun-0.4.1.tar.gz |
|---|---|
| Size | 25.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ade9490cbcf4300361ebecf9c456b738e991374f614469f286f6ebc180e2f79
|
|
BLAKE2b-256 checksum How to use checksums |
6e355a31bfea96d1df5656c77979ffa88019909dcf147dbca090b49b73cbed80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Release files / qkun-0.4.1-py3-none-any.whl
| Download URL | qkun-0.4.1-py3-none-any.whl |
|---|---|
| Size | 26.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8358e54f0698542665a27e9450fc61d20fad1c949930a69519abadd7c76d10fb
|
|
BLAKE2b-256 checksum How to use checksums |
a9189d57491aa9296715bd65770913acb22f5460aa1aaa569c1e8267ed3e70a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Security for qkun 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.