Skip to main content

Reading and reshuffling of CCI soil moisture

Project description

ci cov pip doc

Tools to convert ESA CCI SM image files into a time series format.

Installation

This python package and all required dependencies can be installed from pypi via pip

pip install esa_cci_sm

On macOS if you get ImportError: Pykdtree failed to import its C extension, then it might be necessary to install the pykdtree package from conda-forge

conda install -c conda-forge pykdtree

Data download

Download ESA CCI SM data files either from the public CEDA data store via https or the CEDA FTP server using, e.g. FileZilla or wget

Host (FTP): anon-ftp.ceda.ac.uk no password or user required

Directory (FTP): /neodc/esacci/soil_moisture)

E.g the following command will download v9.1 COMBINED data for the year 2023 from the CEDA FTP via wget

wget ftp://anon-ftp.ceda.ac.uk/neodc/esacci/soil_moisture/data/daily_files/COMBINED/v09.1/2023/*.nc

Time series creation

After installing this package via pip, you have access to the command line tool to convert ESA CCI SM image files to CF conform time series. We use an Orthogonal multidimensional array representation as implemented in the pynetCF python library.

Note that we assume that the downloaded images are stored in yearly subfolders like

/tmp/img/
├── 1978/
│   ├── ESACCI-SOILMOISTURE-L3S-SSMV-PASSIVE-19781101000000-fv09.1.nc
│   ├── ESACCI-SOILMOISTURE-L3S-SSMV-PASSIVE-19781102000000-fv09.1.nc
│   ├── ...
...
├── 2023/
│   ├── ...
│   ├── ESACCI-SOILMOISTURE-L3S-SSMV-PASSIVE-20231231000000-fv09.1.nc

The following command would then take the daily images from 1991 to 2023 in the path /tmp/img and convert data for grid cells over land into times series. Time series are then stored in /tmp/ts.

ccism_reshuffle /tmp/img /tmp/ts 1991-01-01 2023-12-31 --land_points True

Afterwards, in python, the data can be read as pandas DataFrames.

>> from esa_cci_sm.interface import CCITs
>> ds = CCITs("/tmp/ts", ioclass_kws={'read_bulk': True})
>> ds.read(15, 45)  # lon, lat
                  sm  sm_uncertainty  flag  ...  mode  sensor            t0
1991-01-01  0.424880        0.094507     0  ...     1       2   7670.175000
1991-01-02       NaN             NaN    24  ...     2       2           NaN
1991-01-03       NaN             NaN     8  ...     0       2           NaN
...              ...             ...   ...  ...   ...     ...           ...
2023-12-29  0.495448        0.039983     0  ...     3   21536  19720.051575
2023-12-30  0.426107        0.055060     0  ...     3   16416  19721.147066
2023-12-31  0.390103        0.030294     0  ...     3   21600  19722.117129

Supported Products

At the moment this package supports ESA CCI soil moisture data versions 3 to 9 in netCDF format (reading and time series creation) with a spatial sampling of 0.25 degrees.

Contribute

We are happy if you want to contribute. Please raise an issue explaining what is missing or if you find a bug. We will also gladly accept pull requests against our master branch for new features or bug fixes.

Setup

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

git clone git@github.com:TUW-GEO/esa_cci_sm.git --recursive esa_cci_sm
cd ./esa_cci_sm
conda create -n esa_cci_sm python=3.12
conda activate esa_cci_sm
pip install -e .[testing]

To checkout our testdata files, you need to have Git LFS installed on your machine.

Guidelines

If you want to contribute please follow these steps:

  • Fork the esa_cci_sm repository to your account

  • Clone the repository, make sure you use git clone ... --recursive to also get the test data repository.

  • make a new feature branch from the esa_cci_sm master branch

  • Add your feature

  • Please include tests for your contributions in one of the test directories. We use pytest so a simple function called test_my_feature is enough

  • submit a pull request to our master branch

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

esa_cci_sm-0.5.0.tar.gz (388.0 kB view details)

Uploaded Source

Built Distribution

esa_cci_sm-0.5.0-py2.py3-none-any.whl (60.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file esa_cci_sm-0.5.0.tar.gz.

File metadata

  • Download URL: esa_cci_sm-0.5.0.tar.gz
  • Upload date:
  • Size: 388.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.20

File hashes

Hashes for esa_cci_sm-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b53d32897cd4cc1aa73997ba224c08310772bd6f8cb47d63b89c24f2f26d4100
MD5 f6f87cdd1c7840596b50d74b3343b20c
BLAKE2b-256 45ff613dd58c64561e5f50b99f681e91fa05a1a6fbcb9ab1d6cc5ee9108e5e1f

See more details on using hashes here.

File details

Details for the file esa_cci_sm-0.5.0-py2.py3-none-any.whl.

File metadata

  • Download URL: esa_cci_sm-0.5.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 60.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.20

File hashes

Hashes for esa_cci_sm-0.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5a0db992a73dd8a2e7a2260d18c4010fc91f5db4d9b4cbe8e59eae464d6dd12a
MD5 b014258d095f2048e5e32571d1770456
BLAKE2b-256 2344e7facc6f0ddd0a6f8e022f1fe0227f36c9518ccd52ac1dd16fec9921c941

See more details on using hashes here.

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