SMAP (Soil Moisture Active Passive) data readers
Project description
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
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
Built Distribution
Hashes for smap_io-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e6c7e08ca6632d745ee0826653b59548a61e6884d025d341c6eb06e164a8f15 |
|
MD5 | ee486e374474c1761cfd36867b7cd857 |
|
BLAKE2b-256 | dda253e96a5981ea31e65eed3021b0bfb4639b1e7063a58f2718765e95bb5af9 |