From fcf35c8e3d6c05245441f9a2491699d8a21b1e0c Mon Sep 17 00:00:00 2001 From: Lee de Mora Date: Tue, 16 Aug 2022 06:26:08 +0100 Subject: [PATCH 1/2] pre-merge --- bgcval2/analysis_timeseries.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bgcval2/analysis_timeseries.py b/bgcval2/analysis_timeseries.py index 83d1f6e1..d5b16e43 100755 --- a/bgcval2/analysis_timeseries.py +++ b/bgcval2/analysis_timeseries.py @@ -4451,14 +4451,14 @@ def modeldustsum(nc, keys): av[name]['Dimensions'] = 1 -##### -# Calling timeseriesAnalysis -# This is where the above settings is passed to timeseriesAnalysis, for the actual work to begin. -# We loop over all fiels in the first layer dictionary in the autovificiation, av. -# -# Once the timeseriesAnalysis has completed, we save all the output shelves in a dictionairy. -# At the moment, this dictioary is not used, but we could for instance open the shelve to highlight specific data, -# (ie, andy asked to produce a table showing the final year of data. + ##### + # Calling timeseriesAnalysis + # This is where the above settings is passed to timeseriesAnalysis, for the actual work to begin. + # We loop over all fiels in the first layer dictionary in the autovificiation, av. + # + # Once the timeseriesAnalysis has completed, we save all the output shelves in a dictionairy. + # At the moment, this dictioary is not used, but we could for instance open the shelve to highlight specific data, + # (ie, andy asked to produce a table showing the final year of data. for name in list(av.keys()): print(name, av[name]) From 99e1e381c41349f2068285dac1c6503412c71089 Mon Sep 17 00:00:00 2001 From: Lee de Mora Date: Tue, 16 Aug 2022 06:41:28 +0100 Subject: [PATCH 2/2] fixed a couple bugs introduced by PR #41 --- bgcval2/analysis_compare.py | 2 +- bgcval2/analysis_timeseries.py | 100 ++++++++++++++------------------- 2 files changed, 43 insertions(+), 59 deletions(-) diff --git a/bgcval2/analysis_compare.py b/bgcval2/analysis_compare.py index ee434be7..c10382bc 100755 --- a/bgcval2/analysis_compare.py +++ b/bgcval2/analysis_compare.py @@ -3996,7 +3996,7 @@ def load_yml_and_run(compare_yml, config_user): for jobID in jobs: analysis_timeseries( jobID=jobID, - analysisSuite=suites[jobID], + suites=suites[jobID], config_user=config_user ) diff --git a/bgcval2/analysis_timeseries.py b/bgcval2/analysis_timeseries.py index ba84b3aa..9f5f30a8 100755 --- a/bgcval2/analysis_timeseries.py +++ b/bgcval2/analysis_timeseries.py @@ -160,7 +160,7 @@ def analysis_timeseries( The strictFileCheck switch checks that the data/model netcdf files exist. It fails if the switch is on and the files no not exist. - analysisSuite chooses a set of fields to look at. + suites chooses a set of fields to look at. regions selects a list of regions, default is 'all', which is the list supplied by Andy Yool. @@ -168,7 +168,7 @@ def analysis_timeseries( :param clean: deletes old images if true :param annual: Flag for monthly or annual model data. :param strictFileCheck: CStrickt check for model and data files. Asserts if no files are found. - :param analysisSuite: Which data to analyse, ie level1, physics only, debug, etc + :param suites: Which data to analyse, ie level1, physics only, debug, etc :param regions: """ @@ -1165,14 +1165,7 @@ def caldiafrac(nc, keys): 'units': 'mmol O2/m^3' } - if analysisSuite.lower() == 'spinup': - av[name]['layers'] = layerList - else: - av[name]['layers'] = [ - 'Surface', - '500m', - '1000m', - ] #layerList + av[name]['layers'] = layerList av[name]['regions'] = regionList av[name]['metrics'] = metricList @@ -1669,26 +1662,26 @@ def convertmeqm3TOumolkg(nc, keys): av[name]['datadetails'] = {'name': '', 'units': ''} av[name]['dataFile'] = '' av[name]['datasource'] = '' - if analysisSuite.lower() == 'fast': - av[name]['Dimensions'] = 2 - av[name]['modeldetails'] = { - 'name': name, - 'vars': [ - 'OCN_PH', - ], - 'convert': ukp.NoChange, - 'units': 'pH', - } - else: - av[name]['Dimensions'] = 3 - av[name]['modeldetails'] = { - 'name': name, - 'vars': [ - 'PH3', - ], - 'convert': ukp.NoChange, - 'units': 'pH', - } +# if analysisSuite.lower() == 'fast': +# av[name]['Dimensions'] = 2 +# av[name]['modeldetails'] = { +# 'name': name, +# 'vars': [ +# 'OCN_PH', +# ], +# 'convert': ukp.NoChange, +# 'units': 'pH', +# } +# else: + av[name]['Dimensions'] = 3 + av[name]['modeldetails'] = { + 'name': name, + 'vars': [ + 'PH3', + ], + 'convert': ukp.NoChange, + 'units': 'pH', + } #av[name]['datadetails'] = {'name': name, 'vars':['Alk',], 'convert': convertmeqm3TOumolkg,'units':'meq/m^3',} av[name]['layers'] = [ @@ -3009,20 +3002,15 @@ def meanLandMask(nc, keys): 'units': 'degrees C' } - tregions = [ - 'Global', 'ignoreInlandSeas', 'Equator10', 'AtlanticSOcean', - 'SouthernOcean', 'ArcticOcean', 'Remainder', - 'NorthernSubpolarAtlantic', 'NorthernSubpolarPacific', 'WeddelSea', - 'Cornwall' - ] - tregions.extend(PierceRegions) - #tregions = ['Global',] - if analysisSuite.lower() == 'spinup': - av[name]['layers'] = layerList - av[name]['regions'] = regionList - else: - av[name]['layers'] = layerList - av[name]['regions'] = tregions + #tregions = [ + # 'Global', 'ignoreInlandSeas', 'Equator10', 'AtlanticSOcean', + # 'SouthernOcean', 'ArcticOcean', 'Remainder', + # 'NorthernSubpolarAtlantic', 'NorthernSubpolarPacific', 'WeddelSea', + # 'Cornwall' + #] + #tregions.extend(PierceRegions) + av[name]['layers'] = layerList + av[name]['regions'] = regionList av[name]['metrics'] = metricList #try: @@ -3070,18 +3058,14 @@ def meanLandMask(nc, keys): 'units': 'PSU' } - salregions = [ - 'Global', 'ignoreInlandSeas', 'Equator10', 'AtlanticSOcean', - 'SouthernOcean', 'ArcticOcean', 'Remainder', - 'NorthernSubpolarAtlantic', 'NorthernSubpolarPacific', 'WeddelSea' - ] - salregions.extend(PierceRegions) - if analysisSuite.lower() in ['spinup', 'salinity']: - av[name]['layers'] = layerList - av[name]['regions'] = regionList - else: - av[name]['layers'] = layerList - av[name]['regions'] = salregions + #salregions = [ + # 'Global', 'ignoreInlandSeas', 'Equator10', 'AtlanticSOcean', + # 'SouthernOcean', 'ArcticOcean', 'Remainder', + # 'NorthernSubpolarAtlantic', 'NorthernSubpolarPacific', 'WeddelSea' + #] + #salregions.extend(PierceRegions) + av[name]['layers'] = layerList + av[name]['regions'] = regionList av[name]['metrics'] = metricList av[name]['datasource'] = 'WOA' @@ -4565,7 +4549,7 @@ def singleTimeSeriesProfile(jobID, key): if key in FullDepths: analysis_timeseries( jobID=jobID, - analysisSuite=[ + suites=[ key, ], ) @@ -4577,7 +4561,7 @@ def singleTimeSeries( ): # try: analysis_timeseries(jobID=jobID, - analysisSuite=[ + suites=[ key, ], strictFileCheck=False) #clean=1)