#!/usr/bin/env python
#
# Data Quality Checker also known as DQC
#
# Read the README.md for more detailed information
#
#       Barcelona Supercomputing Center - Centro Nacional de Supercomputacion
#       Earth Sciences Department - Computational Earth Sciences
#
#     Authors:
#       Joan Sala Calero (joan.sala@bsc.es)

import glob
import json

# Read all datasets
all_datasets = []
for f in glob.glob('./conf/*ly*json'):
    with open(f, 'r') as fp:
        prods = json.load(fp)
        for p in prods:
            p['sample'] = 'yes'
            all_datasets.append(p)

# Write all products in one file (with sample)
with open('./conf/all.json', 'w') as fw:
    json.dump(all_datasets, fw, indent=4)