Commit 654857ca authored by BorjaEst's avatar BorjaEst
Browse files

Merge branch 'master' into test

# Conflicts:
#	.sqa/config.yml
#	Jenkinsfile
#	README.md
#	o3skim/scripts/norm.py
#	o3skim/scripts/skim.py
parents cb3f4717 b09c5d57
#!/usr/bin/groovy
@Library(['github.com/indigo-dc/jenkins-pipeline-library@release/2.1.0']) _
def projectConfig
pipeline {
agent any
stages {
stage('SQA baseline dynamic stages') {
steps {
......
......@@ -11,6 +11,10 @@ from o3skim.standardization import esacci_function, sbuv_function
import o3skim
# Script logger setup
logger = logging.getLogger("o3norm")
# Parser for script inputs
parser = argparse.ArgumentParser(
prog=f"o3norm", description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter,
......@@ -131,18 +135,18 @@ def run_command(command, parameter, verbosity, target, **kwargs):
format='%(asctime)s %(name)-24s %(levelname)-8s %(message)s')
# Common operations
logging.info("Program start")
logger.info("Program start")
# Loading of DataArray and attributes
logging.info("Data loading and standardization of %s", parameter[0])
logger.info("Data loading and standardization of %s", parameter[0])
dataset = command(parameter, **kwargs)
# Saving
logging.info("Staving result into %s.nc", target)
logger.info("Staving result into %s.nc", target)
o3skim.save(dataset, target)
# End of program
logging.info("End of program")
logger.info("End of program")
if __name__ == '__main__':
......
......@@ -10,6 +10,10 @@ import o3skim
import xarray as xr
# Script logger setup
logger = logging.getLogger("o3norm")
# Parser for script inputs
parser = argparse.ArgumentParser(
prog=f"o3skim", description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
......@@ -53,25 +57,25 @@ def run_command(verbosity, operations, output, paths):
format='%(asctime)s %(name)-24s %(levelname)-8s %(message)s')
# Common operations
logging.info("Program start")
logger.info("Program start")
# Loading of DataArray and attributes
logging.info("Data loading from %s", paths)
logger.info("Data loading from %s", paths)
dataset = xr.open_mfdataset(paths)
# Processing of skimming operations
logging.info("Data skimming using %s", operations)
logger.info("Data skimming using %s", operations)
skimmed = o3skim.process(dataset, operations)
# Saving
logging.info("Staving result into %s", output)
logger.info("Staving result into %s", output)
for variable in skimmed:
variable_ds = skimmed[variable].to_dataset()
variable_ds.attrs = skimmed.attrs
o3skim.save(variable_ds, f"{output}/{variable}")
# End of program
logging.info("End of program")
logger.info("End of program")
if __name__ == '__main__':
......
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