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