Skip to main content

SMAP (Soil Moisture Active Passive) data readers

Project description

https://travis-ci.org/TUW-GEO/smap_io.svg?branch=master https://coveralls.io/repos/github/TUW-GEO/smap_io/badge.svg?branch=master https://badge.fury.io/py/smap_io.svg https://zenodo.org/badge/12761/TUW-GEO/smap_io.svg

SMAP (Soil Moisture Active Passive) data readers.

Works great in combination with pytesmo.

Installation

Setup of a complete environment with conda can be performed using the following commands:

conda create -q -n smap_io-environment numpy h5py pyproj
source activate smap_io-environment
pip install smap_io

Supported Products

  • SPL3SMP: SMAP L3 Radiometer Global Daily 36 km EASE-Grid Soil Moisture

Documentation

Documentation Status

Example

SPL3SMP

After downloading the data you will have a path with subpaths of the format YYYY.MM.DD. Let’s call this path root_path. To read the data of a certain date use the following code:

from smap_io import SPL3SMP_Ds
root_path = os.path.join(os.path.dirname(__file__),
                         'test_data', 'SPL3SMP')
ds = SPL3SMP_Ds(root_path)
image = ds.read(datetime(2015, 4, 1))
assert list(image.data.keys()) == ['soil_moisture']
assert image.data['soil_moisture'].shape == (406, 964)

The returned image is of the type pygeobase.Image. Which is only a small wrapper around a dictionary of numpy arrays.

If you only have a single image you can also read the data directly

from smap_io import SPL3SMP_Img
fname = os.path.join(os.path.dirname(__file__),
                     'test_data', 'SPL3SMP', '2015.04.01',
                     'SMAP_L3_SM_P_20150401_R13080_001.h5')
ds = SPL3SMP_Img(fname)
image = ds.read()
assert list(image.data.keys()) == ['soil_moisture']
assert image.data['soil_moisture'].shape == (406, 964)

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

smap_io-0.1.tar.gz (22.1 MB view hashes)

Uploaded Source

Built Distribution

smap_io-0.1-py2.py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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