Skip to main content

generic classes and functions to query, access and process multi-spectral and SAR satellite images

Project description

UKIS UKIS-pysat

Build Status codecov PyPI version Documentation Status GitHub license Code Style

The UKIS-pysat package provides generic classes and functions to query, access and process multi-spectral and SAR satellite images.

data

Download satellites data from different sources (currently Earth Explorer, SciHub, local directory), deal with and structure metadata.

file

Work with you local satellite data files and read information out of file names and metadata files. Currently focusing on Sentinel-1.

raster

Reading satellite data and performing simple, but cumbersome tasks.

Read the documentation for more details: https://ukis-pysat.readthedocs.io.

Example

Here's an example about some basic features, it might also help to read through the tests.

from ukis_pysat.data import Source
from ukis_pysat.file import get_sentinel_scene_from_dir
from ukis_pysat.members import Datahub, Platform
from ukis_pysat.raster import Image


# connect to Scihub and query metadata (returns MetadataCollection)
src = Source(source=Datahub.Scihub)
meta = src.query_metadata(
    platform=Platform.Sentinel2,
    date=("20200101", "NOW"),
    aoi=(11.90, 51.46, 11.94, 51.50),
    cloud_cover=(0, 50),
)

# inspect MetadataCollection with Pandas
meta_df = meta.to_pandas()
print(meta_df[["srcid", "producttype", "cloudcoverpercentage", "size", "srcuuid"]])

# filter MetadataCollection by producttype
meta.filter(filter_dict={"producttype": "S2MSI1C"})

# save Metadata items as GeoJSON
meta.save(target_dir="target_dir/")

# get product_uuid of first metadata item
uuid = meta.items[0].to_dict()["srcuuid"]

# download geocoded quicklook and image
src.download_quicklook(platform=Platform.Sentinel2, product_uuid=uuid, target_dir="target_dir/")
src.download_image(platform=Platform.Sentinel2, product_uuid=uuid, target_dir="target_dir/")

# get sentinel scene from directory
with get_sentinel_scene_from_dir(target_dir) as (full_path, ident):
    img = Image(os.path_testfiles.join(full_path, 'pre_nrcs.tif'))

Environment variables to configure Datahub credentials

To use ukis_pysat.data and to download from the respective Datahub you need to set the credentials as environment variables.

For EarthExplorer that's:
EARTHEXPLORER_USER=your_username
EARTHEXPLORER_PW=your_password

For SciHub that's:
SCIHUB_USER=your_username
SCIHUB_PW=your_password

Installation

The easiest way to install pysat is through pip. Be aware, that Rasterio requires GDAL >= 1.11, < 3.1.

Most users will want to do this:

pip install ukis-pysat[complete]  # install everything

There's also some lighter versions with less dependencies:

pip install ukis-pysat  # only install core dependencies (ukis_pysat.file can be used)

pip install ukis-pysat[data]  # also install dependencies for ukis_pysat.data

pip install ukis-pysat[raster]  # also install dependencies for ukis_pysat.raster

Some helper functions might need additional dependencies like pandas, dask[array] or utm. If this is the case you will receive an ImportError.

You can also do this, even though environment.yml is updated less often:

git clone https://github.com/dlr-eoc/ukis-pysat
cd ukis-pysat
conda env create -f environment.yml
conda activate ukis_pysat

Dependencies

For the latest list of dependencies check the requirements.

Contributors

The UKIS team creates and adapts libraries which simplify the usage of satellite data. Our team includes (in alphabetical order):

  • Boehnke, Christian
  • Fichtner, Florian
  • Mandery, Nico
  • Martinis, Sandro
  • Riedlinger, Torsten
  • Wieland, Marc

German Aerospace Center (DLR)

Licenses

This software is licensed under the Apache 2.0 License.

Copyright (c) 2020 German Aerospace Center (DLR) * German Remote Sensing Data Center * Department: Geo-Risks and Civil Security

Changelog

See changelog.

Contributing

The UKIS team welcomes contributions from the community. For more detailed information, see our guide on contributing if you're interested in getting involved.

What is UKIS?

The DLR project Environmental and Crisis Information System (the German abbreviation is UKIS, standing for Umwelt- und Kriseninformationssysteme aims at harmonizing the development of information systems at the German Remote Sensing Data Center (DFD) and setting up a framework of modularized and generalized software components.

UKIS is intended to ease and standardize the process of setting up specific information systems and thus bridging the gap from EO product generation and information fusion to the delivery of products and information to end users.

Furthermore the intention is to save and broaden know-how that was and is invested and earned in the development of information systems and components in several ongoing and future DFD projects.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ukis-pysat-0.3.0.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ukis_pysat-0.3.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file ukis-pysat-0.3.0.tar.gz.

File metadata

  • Download URL: ukis-pysat-0.3.0.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for ukis-pysat-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a3d9a6c8abac591e86582e28c297ac658c6e73f05e48e28afc4bc850becb6ab5
MD5 aa6bb2f7b57d11bbb20b765795f4861f
BLAKE2b-256 62704867a271171b1aac1ac2158cec9fd8e8febdcffc0ef48a0a9ff3331aa6ca

See more details on using hashes here.

File details

Details for the file ukis_pysat-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ukis_pysat-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for ukis_pysat-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e84641000982856743209aa227165b08ef139078ce1c3b117cbc6ebd84ab1c1c
MD5 c5dad68b141aecb38ba1941f82cf84e3
BLAKE2b-256 c5873255344d05164abbd2a308ee4ccf7eaffc3cda7e31803e816b08f1dbab08

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page