diff --git a/scripts/exgdas_global_marine_analysis_vrfy.py b/scripts/exgdas_global_marine_analysis_vrfy.py index 88a33f49b..fa72a148b 100755 --- a/scripts/exgdas_global_marine_analysis_vrfy.py +++ b/scripts/exgdas_global_marine_analysis_vrfy.py @@ -48,11 +48,11 @@ config = plotConfig(grid_file=grid_file, data_file=data_file, lats=np.arange(-60, 60, 10), - variables_zonal=['Temp', 'Salt'], - variables_horiz=['Temp', 'Salt', 'ave_ssh'], - allbounds={'Temp': [-0.5, 0.5], - 'Salt': [-0.1, 0.1], - 'ave_ssh': [-0.1, 0.1]}, + variables_zonal={'Temp': [-0.5, 0.5], + 'Salt': [-0.1, 0.1]}, + variables_horiz={'Temp': [-0.5, 0.5], + 'Salt': [-0.1, 0.1], + 'ave_ssh': [-0.1, 0.1]}, colormap='RdBu', comout=os.path.join(comout, 'vrfy', 'incr')) ocnIncPlotter = statePlotter(config) @@ -66,10 +66,9 @@ config = plotConfig(grid_file=grid_file, data_file=data_file, lats=np.arange(-60, 60, 10), - variables_horiz=['aicen', 'hicen', 'hsnon'], - allbounds={'aicen': [-0.2, 0.2], - 'hicen': [-0.5, 0.5], - 'hsnon': [-0.1, 0.1]}, + variables_horiz={'aicen': [-0.2, 0.2], + 'hicen': [-0.5, 0.5], + 'hsnon': [-0.1, 0.1]}, colormap='RdBu', projs=['North', 'South'], comout=os.path.join(comout, 'vrfy', 'incr')) @@ -83,10 +82,9 @@ data_file = os.path.join(comout, f'{RUN}.t'+cyc+'z.iceana.nc') config = plotConfig(grid_file=grid_file, data_file=data_file, - variables_horiz=['aicen', 'hicen', 'hsnon'], - allbounds={'aicen': [0.0, 1.0], - 'hicen': [0.0, 4.0], - 'hsnon': [0.0, 0.5]}, + variables_horiz={'aicen': [0.0, 1.0], + 'hicen': [0.0, 4.0], + 'hsnon': [0.0, 0.5]}, colormap='jet', projs=['North', 'South', 'Global'], comout=os.path.join(comout, 'vrfy', 'ana')) @@ -100,10 +98,9 @@ data_file = os.path.join(com_ice_history, f'{RUN}.t{gcyc}z.icef006.nc') config = plotConfig(grid_file=grid_file, data_file=data_file, - variables_horiz=['aice_h', 'hs_h', 'hi_h'], - allbounds={'aice_h': [0.0, 1.0], - 'hs_h': [0.0, 4.0], - 'hi_h': [0.0, 0.5]}, + variables_horiz={'aice_h': [0.0, 1.0], + 'hs_h': [0.0, 4.0], + 'hi_h': [0.0, 0.5]}, colormap='jet', projs=['North', 'South', 'Global'], comout=os.path.join(comout, 'vrfy', 'bkg')) @@ -117,10 +114,9 @@ data_file = os.path.join(comout, f'{RUN}.t'+cyc+'z.ocnana.nc') config = plotConfig(grid_file=grid_file, data_file=data_file, - variables_horiz=['ave_ssh', 'Temp', 'Salt'], - allbounds={'ave_ssh': [-1.8, 1.3], - 'Temp': [-1.8, 34.0], - 'Salt': [30, 38]}, + variables_horiz={'ave_ssh': [-1.8, 1.3], + 'Temp': [-1.8, 34.0], + 'Salt': [30, 38]}, colormap='jet', comout=os.path.join(comout, 'vrfy', 'ana')) ocnAnaPlotter = statePlotter(config) @@ -133,10 +129,9 @@ data_file = os.path.join(com_ocean_history, f'{RUN}.t{gcyc}z.ocnf006.nc') config = plotConfig(grid_file=grid_file, data_file=data_file, - variables_horiz=['ave_ssh', 'Temp', 'Salt'], - allbounds={'ave_ssh': [-1.8, 1.3], - 'Temp': [-1.8, 34.0], - 'Salt': [30, 38]}, + variables_horiz={'ave_ssh': [-1.8, 1.3], + 'Temp': [-1.8, 34.0], + 'Salt': [30, 38]}, colormap='jet', comout=os.path.join(comout, 'vrfy', 'bkg')) ocnBkgPlotter = statePlotter(config) @@ -150,11 +145,11 @@ config = plotConfig(grid_file=grid_file, data_file=data_file, lats=np.arange(-60, 60, 10), - variables_zonal=['Temp', 'Salt'], - variables_horiz=['Temp', 'Salt', 'ave_ssh'], - allbounds={'Temp': [0, 2], - 'Salt': [0, 0.2], - 'ave_ssh': [0, 0.1]}, + variables_zonal={'Temp': [0, 2], + 'Salt': [0, 0.2]}, + variables_horiz={'Temp': [0, 2], + 'Salt': [0, 0.2], + 'ave_ssh': [0, 0.1]}, colormap='jet', comout=os.path.join(comout, 'vrfy', 'bkgerr')) bkgErrPlotter = statePlotter(config) diff --git a/ush/soca/soca_vrfy.py b/ush/soca/soca_vrfy.py index 248505711..2c8d602a0 100755 --- a/ush/soca/soca_vrfy.py +++ b/ush/soca/soca_vrfy.py @@ -19,14 +19,13 @@ def plotConfig(grid_file=[], data_file=[], variable=[], levels=[], - allbounds=[], bounds=[], colormap=[], max_depth=np.nan, max_depths=[700.0, 5000.0], comout=[], - variables_horiz=[], - variables_zonal=[], + variables_horiz={}, + variables_zonal={}, lat=np.nan, lats=np.arange(-60, 60, 10), proj='set me', @@ -41,7 +40,6 @@ def plotConfig(grid_file=[], config['fields file'] = data_file config['levels'] = [1] config['colormap'] = colormap - config['all bounds'] = allbounds config['bounds'] = bounds config['lats'] = lats # all the lats to plot config['lat'] = lat # the lat being currently plotted @@ -140,15 +138,18 @@ def plot(self): for max_depth in self.config['max depths']: self.config['max depth'] = max_depth - for variable in self.config['zonal variables']: - bounds = self.config['all bounds'][variable] + variableBounds = self.config['zonal variables'] + for variable in variableBounds.keys(): + bounds = variableBounds[variable] self.config.update({'variable': variable, 'bounds': bounds}) plotZonalSlice(self.config) ####################################### # Horizontal slices for proj in self.config['projs']: - for variable in self.config['horiz variables']: - bounds = self.config['all bounds'][variable] + + variableBounds = self.config['horiz variables'] + for variable in variableBounds.keys(): + bounds = variableBounds[variable] self.config.update({'variable': variable, 'bounds': bounds, 'proj': proj}) plotHorizontalSlice(self.config)