dkrz-cera
Provides an interface to the CERA database of the DKRZ (Deutsches Klimarechenzentrum)
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.3%) to scientific vocabulary
Repository
Provides an interface to the CERA database of the DKRZ (Deutsches Klimarechenzentrum)
Basic Info
- Host: GitHub
- Owner: markusritschel
- License: mit
- Language: Python
- Default Branch: main
- Size: 63.5 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
DKRZ-CERA
This package provides an interface to the CERA database of the DKRZ (Deutsches Klimarechenzentrum). This allows the user to scrape the database for CMIP data, for example, and prepare files for the remote download via Jblob, a program written in Java and provided by the DKRZ.
Installation
Clone this repo via
bash
git clone https://github.com/markusritschel/dkrz-cera
Then, in the new directory (cd dkrz-cera/) install the package via:
pip install .
or via
pip install -e .
if you plan on making changes to the code.
Alternatively, install directly from GitHub via
pip install 'git+https://github.com/markusritschel/dkrz-cera.git'
Usage
The database can be scraped by creating an instance of the Cera class and using it's search method:
python
from dkrz_cera import Cera
cera = Cera()
cera.search(variable_s='tas', model_s='ACCESS1-0', qc_experiment_s='historical')
This yields a CeraQuery object, which itself provides a tabular view of the request results by the .df attribute,
as well as a method to_jblob(), which creates a bash file executable by Jblob for eventually downloading the datasets from CERA.
When running this bash file, a directory structure gets created according to the CMIP standards, i.e.
<activity>/
<product>/
<institute>/
<model>/
<experiment>/
<frequency>/
<modeling realm>/
<MIP table>/
<ensemble member>/
<version number>/
<variable name>/
This structure is created by hands of the entry_name_s provided in each dataset.
(However, in some exceptions it can happen that this entrynames value is not complying the CMIP standards.)
The data sets get automatically downloaded into the respective directory.
While some of them are already downloaded as netCDF files, others exist primarily as zip files and still need to be extracted.
This can be done by using the function unzip_files() which takes the root path (parent of the <activity> directory)
as a mandatory argument.
Testing
Run make tests in the source directory to test the code.
This will execute both the unit tests and docstring examples (using pytest).
Run make lint to check code style consistency.
ToDos
- [x] Routine for scraping the CERA database based on multiple keywords
- [x] sort files depending on configuration file => creates directory structure automatically during jblob download
- [x] create intake-esm catalog files => this will be implemented in another package
- [ ] Try to validate CERA credentials if present
- [ ] Retrieve CERA credentials either from
.envfile or from environment variable viaos.getenv('CERA_USER') - [ ] implement click for command line tooling
Maintainer
Contact & Issues
For any questions or issues, please contact me via git@markusritschel.de or open an issue.
© Markus Ritschel 2024
Owner
- Name: Markus Ritschel
- Login: markusritschel
- Kind: user
- Location: Hamburg
- Company: Doctoral candidate at the University of Hamburg and Max-Planck-Institute for Meteorology
- Repositories: 2
- Profile: https://github.com/markusritschel
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Ritschel" given-names: "Markus" orcid: "https://orcid.org/0000-0000-0000-0000" title: "DKRZ-CERA" version: 0.1.0 doi: 10.5281/zenodo.1234 date-released: 2024-06-23 url: "https://github.com/markusritschel/dkrz-cera"