Skip to content

Commit

Permalink
python code style
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewEichmann-NOAA committed Jul 27, 2023
1 parent 02e3ed1 commit bf27a51
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 63 deletions.
100 changes: 50 additions & 50 deletions scripts/exgdas_global_marine_analysis_vrfy.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@
#######################################

data_file = os.path.join(comout, f'{RUN}.t'+cyc+'z.ocninc.nc')
config = plot_config(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],
config = plot_config(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]},
colormap = 'RdBu',
comout = os.path.join(comout, 'vrfy', 'incr'))
colormap='RdBu',
comout=os.path.join(comout, 'vrfy', 'incr'))
OcnIncPlotter = StatePlotter(config)
OcnIncPlotter.plot()

Expand All @@ -63,16 +63,16 @@
#######################################

data_file = os.path.join(comout, f'{RUN}.t'+cyc+'z.ice.incr.nc')
config = plot_config(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],
config = plot_config(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]},
colormap = 'RdBu',
projs = ['North', 'South'],
comout = os.path.join(comout, 'vrfy', 'incr'))
colormap='RdBu',
projs=['North', 'South'],
comout=os.path.join(comout, 'vrfy', 'incr'))
IceIncPlotter = StatePlotter(config)
IceIncPlotter.plot()

Expand All @@ -81,15 +81,15 @@
#######################################

data_file = os.path.join(comout, f'{RUN}.t'+cyc+'z.iceana.nc')
config = plot_config(grid_file = grid_file,
data_file = data_file,
variables_horiz = ['aicen', 'hicen', 'hsnon'],
allbounds = {'aicen': [0.0, 1.0],
config = plot_config(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]},
colormap = 'jet',
projs = ['North', 'South','Global'],
comout = os.path.join(comout, 'vrfy', 'ana'))
colormap='jet',
projs=['North', 'South','Global'],
comout=os.path.join(comout, 'vrfy', 'ana'))
IceAnaPlotter = StatePlotter(config)
IceAnaPlotter.plot()

Expand All @@ -98,15 +98,15 @@
#######################################

data_file = os.path.join(com_ice_history, f'{RUN}.t{gcyc}z.icef006.nc')
config = plot_config(grid_file = grid_file,
data_file = data_file,
variables_horiz = ['aice_h', 'hs_h', 'hi_h'],
allbounds = {'aice_h': [0.0, 1.0],
config = plot_config(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]},
colormap = 'jet',
projs = ['North', 'South','Global'],
comout = os.path.join(comout, 'vrfy', 'bkg'))
colormap='jet',
projs=['North', 'South', 'Global'],
comout=os.path.join(comout, 'vrfy', 'bkg'))
IceBkgPlotter = StatePlotter(config)
IceBkgPlotter.plot()

Expand All @@ -115,14 +115,14 @@
#######################################

data_file = os.path.join(comout, f'{RUN}.t'+cyc+'z.ocnana.nc')
config = plot_config(grid_file = grid_file,
data_file = data_file,
variables_horiz = ['ave_ssh', 'Temp', 'Salt'],
allbounds = {'ave_ssh': [-1.8, 1.3],
config = plot_config(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]},
colormap = 'jet',
comout = os.path.join(comout, 'vrfy', 'ana'))
colormap='jet',
comout=os.path.join(comout, 'vrfy', 'ana'))
OcnAnaPlotter = StatePlotter(config)
OcnAnaPlotter.plot()

Expand All @@ -131,14 +131,14 @@
#######################################

data_file = os.path.join(com_ocean_history, f'{RUN}.t{gcyc}z.ocnf006.nc')
config = plot_config(grid_file = grid_file,
data_file = data_file,
variables_horiz = ['ave_ssh', 'Temp', 'Salt'],
allbounds = {'ave_ssh': [-1.8, 1.3],
config = plot_config(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]},
colormap = 'jet',
comout = os.path.join(comout, 'vrfy', 'bkg'))
colormap='jet',
comout=os.path.join(comout, 'vrfy', 'bkg'))
OcnBkgPlotter = StatePlotter(config)
OcnBkgPlotter.plot()

Expand All @@ -147,16 +147,16 @@
#######################################

data_file = os.path.join(comout, f'{RUN}.t'+cyc+'z.ocn.bkgerr_stddev.nc')
config = plot_config(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],
config = plot_config(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]},
colormap = 'jet',
comout = os.path.join(comout, 'vrfy', 'bkgerr'))
colormap='jet',
comout=os.path.join(comout, 'vrfy', 'bkgerr'))
BkgErrPlotter = StatePlotter(config)
BkgErrPlotter.plot()

Expand Down
26 changes: 13 additions & 13 deletions ush/soca/soca_vrfy.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def plot_config(grid_file=[],
bounds=[],
colormap=[],
max_depth=np.nan,
max_depths = [700.0, 5000.0],
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',
Expand All @@ -36,22 +36,22 @@ def plot_config(grid_file=[],
Prepares the configuration for the plotting functions below
"""
config = {}
config['comout'] = comout # output directory
config['comout'] = comout # output directory
config['grid file'] = 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['lats'] = lats # all the lats to plot
config['lat'] = lat # the lat being currently plotted
config['max depths'] = max_depths # all the max depths to plot
config['max depth'] = max_depth # the max depth currently plotted
config['horiz variables'] = variables_horiz # all the vars for horiz plots
config['zonal variables'] = variables_zonal # all the vars for zonal plots
config['variable'] = variable # the variable currently plotted
config['projs'] = projs # all the projections etc.
config['proj'] = proj
config['max depths'] = max_depths # all the max depths to plot
config['max depth'] = max_depth # the max depth currently plotted
config['horiz variables'] = variables_horiz # all the vars for horiz plots
config['zonal variables'] = variables_zonal # all the vars for zonal plots
config['variable'] = variable # the variable currently plotted
config['projs'] = projs # all the projections etc.
config['proj'] = proj
return config


Expand Down Expand Up @@ -130,7 +130,7 @@ def __init__(self, config_dict):

def plot(self):
# Loop over variables, slices (horiz and vertical) and projections ... and whatever else is needed

#######################################
# zonal slices

Expand Down

0 comments on commit bf27a51

Please sign in to comment.