Commit 733f095c authored by Willi Rath's avatar Willi Rath

Merge branch 'develop' into 'master'

Render MIMOC and MIMOC_cf

See merge request !56
parents 1d4db832 14f1b107
......@@ -7,7 +7,7 @@ before_script:
test:
stage: test
script:
- pytest --cov=data_repo_renderer --cov-report term-missing --cov-fail-under=90 -v tests/
- pytest --cov=data_repo_renderer --cov-report term-missing --cov-fail-under=85 -v tests/
style:
stage: test
......
......@@ -461,13 +461,19 @@ def cli_run_renderer(argvec=None):
GitUpdate(yaml_dict, output_file=update_script)
# append all data download lines
for data in yaml_dict["data"]:
data["method"](data, output_file=update_script)
# append all data download lines (if any)
try:
for data in yaml_dict["data"]:
data["method"](data, output_file=update_script)
except KeyError as e:
pass
# append all doc download lines
for doc in yaml_dict["doc"]:
doc["method"](doc, output_file=update_script)
# append all doc download lines (if any)
try:
for doc in yaml_dict["doc"]:
doc["method"](doc, output_file=update_script)
except KeyError as e:
pass
PostProcessing(yaml_dict, output_file=update_script)
GitFinalize(yaml_dict, output_file=update_script)
......
repo_name: MIMOC_cf
people: Willi Rath (<wrath@geomar.de>)
http_path_remote: https://git.geomar.de/data/MIMOC_cf
git_path_remote: git@git.geomar.de:data/MIMOC_cf.git
repo_description: |
A CF compliant version of MIMOC (See
<https://www.pmel.noaa.gov/mimoc/index.html> and
<https://git.geomar.de/data/MIMOC/>.)
prefixes: data doc
pre_processing:
- git rm -r _non_cf_data
- GIT_LFS_SKIP_SMUDGE=1 git submodule add git@git.geomar.de:data/MIMOC.git _non_cf_data || echo "non-CF submodule exitst"
- (cd _non_cf_data; git pull; git lfs pull; git describe;)
- pwd
post_processing:
- util/make_CF_compliant.sh
- util/convert_to_netCDF4_classic.sh
#!/bin/bash
function _convert_to_nc4c {
infile=$1
tmpfile=_tmp_`date +%s%N`_`basename ${infile}`
nccopy -s -7 -d 1 \
-c"sigma0/1,latitude/90,longitude/90" \
-c"pressure/1,latitude/90,longitude/90" \
-c"latitude/90,longitude/90" \
-c"time/1,sigma0/1,latitude/90,longitude/90" \
-c"time/1,pressure/1,latitude/90,longitude/90" \
-c"time/1,latitude/90,longitude/90" \
${infile} ${tmpfile}
cdo diff ${tmpfile} ${infile} && mv ${tmpfile} ${infile}
}
export -f _convert_to_nc4c
find data -type f -name \*.nc -print0 | \
xargs -0 -n1 -P8 -I {} bash -c "_convert_to_nc4c {}"
This diff is collapsed.
#!/bin/bash
(cd _non_cf_data/ && echo Using MIMOC "`git describe`";)
for month in {01..12}; do
echo "==== month" ${month} "===="
for f in _non_cf_data/data/MIMOC*month${month}.nc; do
infile=$f
outfile=data/`basename $f .nc`_cf.nc
util/make_CF_compliant.py ${month} ${infile} ${outfile}
done
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment