diff --git a/latest/_modules/compass/landice/tests/calving_dt_convergence/dt_convergence_test.html b/latest/_modules/compass/landice/tests/calving_dt_convergence/dt_convergence_test.html index 647b843cd0..1a1b131012 100644 --- a/latest/_modules/compass/landice/tests/calving_dt_convergence/dt_convergence_test.html +++ b/latest/_modules/compass/landice/tests/calving_dt_convergence/dt_convergence_test.html @@ -112,13 +112,14 @@

Source code for compass.landice.tests.calving_dt_convergence.dt_convergence_test

-from compass.testcase import TestCase
-from compass.landice.tests.calving_dt_convergence.run_model import RunModel
+import matplotlib.cm
+import matplotlib.pyplot as plt
+import netCDF4
 # from compass.validate import compare_variables  # not currently used
 import numpy
-import netCDF4
-import matplotlib.pyplot as plt
-import matplotlib.cm
+
+from compass.landice.tests.calving_dt_convergence.run_model import RunModel
+from compass.testcase import TestCase
 
 
 
@@ -146,7 +147,7 @@

Source code for compass.landice.tests.calving_dt_convergence.dt_convergence_ test_group : compass.landice.tests.calving_dt_convergence.CalvingDtConvergence The test group that this test case belongs to - """ + """ # noqa: E501 self.name = f'calving_dt_convergence_test_{mesh}_{calving}_{velo}' subdir = f'{mesh}.{calving}.{velo}' super().__init__(test_group=test_group, name=self.name, subdir=subdir) @@ -198,7 +199,8 @@

Source code for compass.landice.tests.calving_dt_convergence.dt_convergence_ ax[3].set_ylabel('# warnings', color='c') ax2 = ax[3].twinx() ax2.set_ylabel('fraction with warnings', color='g') - colors = matplotlib.cm.jet(numpy.linspace(0, 1, len(self.fractions))) + jet = matplotlib.colormaps['jet'] + colors = jet(numpy.linspace(0, 1, len(self.fractions))) nWarn = numpy.zeros([len(self.fractions)]) nTimesteps = numpy.zeros([len(self.fractions)]) @@ -212,7 +214,7 @@

Source code for compass.landice.tests.calving_dt_convergence.dt_convergence_ ax[0].plot(yr[1:], calv[1:], '-', label=f'{frac:.2f}', color=colors[i]) - ax[1].plot(yr[1:], (calv[1:]*deltat[1:]).cumsum(), '-', + ax[1].plot(yr[1:], (calv[1:] * deltat[1:]).cumsum(), '-', color=colors[i]) ratio = f.variables['dtCalvingCFLratio'][:] @@ -228,7 +230,7 @@

Source code for compass.landice.tests.calving_dt_convergence.dt_convergence_ nWarn[i] = logcontents.count("WARNING: Failed to ablate") nTimesteps[i] = logcontents.count("Starting timestep number") ax[3].plot(frac, nWarn[i], 'co') - ax2.plot(frac, nWarn[i]/nTimesteps[i], 'gx') + ax2.plot(frac, nWarn[i] / nTimesteps[i], 'gx') f.close() i += 1 diff --git a/latest/_modules/compass/landice/tests/eismint2/standard_experiments/visualize.html b/latest/_modules/compass/landice/tests/eismint2/standard_experiments/visualize.html index 51a9c14c89..2284e0382b 100644 --- a/latest/_modules/compass/landice/tests/eismint2/standard_experiments/visualize.html +++ b/latest/_modules/compass/landice/tests/eismint2/standard_experiments/visualize.html @@ -114,8 +114,9 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualize

 import datetime
-import netCDF4
+
 import matplotlib.pyplot as plt
+import netCDF4
 import numpy as np
 from scipy.interpolate import griddata
 
@@ -138,7 +139,7 @@ 

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz ---------- test_case : compass.landice.tests.eismint2.standard_experiments.StandardExperiments The test case this step belongs to - """ + """ # noqa: E501 super().__init__(test_case=test_case, name='visualize')

@@ -196,8 +197,8 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz # open supplied MPAS output file and get variables needed filein = netCDF4.Dataset(filename, 'r') - xCell = filein.variables['xCell'][:]/1000.0 - yCell = filein.variables['yCell'][:]/1000.0 + xCell = filein.variables['xCell'][:] / 1000.0 + yCell = filein.variables['yCell'][:] / 1000.0 xtime = filein.variables['xtime'][:] nCells = len(filein.dimensions['nCells']) nVertLevels = len(filein.dimensions['nVertLevels']) @@ -229,16 +230,17 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz # make an educated guess about how big the markers should be. if nCells**0.5 < 100.0: - markersize = max(int(round(3600.0/(nCells**0.5))), 1) + markersize = max(int(round(3600.0 / (nCells**0.5))), 1) # use hexes if the points are big enough, otherwise just dots markershape = 'h' else: - markersize = max(int(round(1800.0/(nCells**0.5))), 1) + markersize = max(int(round(1800.0 / (nCells**0.5))), 1) markershape = '.' logger.info('Using a markersize of {}'.format(markersize)) fig = plt.figure(1, facecolor='w') - fig.suptitle('Payne et al. Fig. 1, 3, 6, 9, or 11', fontsize=10, fontweight='bold') + fig.suptitle('Payne et al. Fig. 1, 3, 6, 9, or 11', fontsize=10, + fontweight='bold') iceIndices = np.where(thickness[timelev, :] > 10.0)[0] plt.scatter(xCell[iceIndices], yCell[iceIndices], markersize, @@ -264,7 +266,8 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz plt.savefig('EISMINT2-{}-basaltemp.png'.format(experiment), dpi=150) # ================ - # STEADY STATE MAPS - panels b and c are switched and with incorrect units in the paper + # STEADY STATE MAPS - panels b and c are switched and with incorrect + # units in the paper # ================ fig = plt.figure(2, facecolor='w', figsize=(12, 6), dpi=72) fig.suptitle('Payne et al. Fig. 2 or 4', fontsize=10, fontweight='bold') @@ -278,7 +281,7 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz edgecolors='none') # add contours of ice thickness over the top - contour_intervals = np.linspace(0.0, 5000.0, int(5000.0/250.0)+1) + contour_intervals = np.linspace(0.0, 5000.0, int(5000.0 / 250.0) + 1) _contour_mpas(thickness[timelev, :], nCells, xCell, yCell, contour_levs=contour_intervals) @@ -293,8 +296,8 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz flux = np.zeros((nCells,)) for k in range(nVertLevels): - speedLevel = (uReconstructX[timelev, :, k:k+2].mean(axis=1)**2 + - uReconstructY[timelev, :, k:k+2].mean(axis=1)**2)**0.5 + speedLevel = (uReconstructX[timelev, :, k:k + 2].mean(axis=1)**2 + + uReconstructY[timelev, :, k:k + 2].mean(axis=1)**2)**0.5 flux += speedLevel * thickness[timelev, :] * layerThicknessFractions[k] plt.scatter(xCell[iceIndices], yCell[iceIndices], markersize, @@ -302,8 +305,8 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz edgecolors='none') # add contours over the top - contour_intervals = np.linspace(0.0, 20.0, 11) - _contour_mpas(flux * 3600.0*24.0*365.0 / 10000.0, nCells, xCell, yCell, + contour_intervals = np.linspace(0.0, 20.0, 11) + _contour_mpas(flux * 3600.0 * 24.0 * 365.0 / 10000.0, nCells, xCell, yCell, contour_levs=contour_intervals) ax.set_aspect('equal') plt.title('Final flux (m$^2$ a$^{-1}$ / 10000)') @@ -325,7 +328,7 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz if flwa[timelev, :, :].max() > 0.0: # NOT SURE WHICH LEVEL FLWA SHOULD COME FROM - so taking column average _contour_mpas( - flwa[timelev, :, :].mean(axis=1) * 3600.0*24.0*365.0 / 1.0e-17, + flwa[timelev, :, :].mean(axis=1) * 3600.0 * 24.0 * 365.0 / 1.0e-17, nCells, xCell, yCell) ax.set_aspect('equal') # Note: the paper's figure claims units of 10$^{-25}$ Pa$^{-3}$ a$^{-1}$ @@ -341,7 +344,8 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz # DIVIDE EVOLUTION TIME SERIES # ================ fig = plt.figure(3, facecolor='w') - fig.suptitle('Payne et al. Fig. 5, 7, or 8', fontsize=10, fontweight='bold') + fig.suptitle('Payne et al. Fig. 5, 7, or 8', fontsize=10, + fontweight='bold') # get indices for given time if experiment == 'b': @@ -358,14 +362,15 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz # panel a - thickness fig.add_subplot(211) timeInd = np.nonzero(years <= endTime)[0][0:] - plt.plot(years[timeInd]/1000.0, thickness[timeInd, divideIndex], 'k.-') + plt.plot(years[timeInd] / 1000.0, thickness[timeInd, divideIndex], 'k.-') plt.ylabel('Thickness (m)') # panel b - basal temperature fig.add_subplot(212) # skip the first index cause basalTemperature isn't calculated then timeInd = np.nonzero(years <= endTime)[0][1:] - plt.plot(years[timeInd]/1000.0, basalTemperature[timeInd, divideIndex], 'k.-') + plt.plot(years[timeInd] / 1000.0, basalTemperature[timeInd, divideIndex], + 'k.-') plt.ylabel('Basal temperature (K)') plt.xlabel('Time (kyr)') @@ -422,8 +427,8 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz 'min/mean/max of community', fontsize=10, fontweight='bold') fig.add_subplot(151) - volume = ((thickness[timelev, iceIndices] * areaCell[iceIndices]).sum() - / 1000.0**3 / 10.0**6) + volume = ((thickness[timelev, iceIndices] * areaCell[iceIndices]).sum() / + 1000.0**3 / 10.0**6) # benchmark results plt.plot(np.zeros((3,)), bench['volume'], 'k*') if bench['stattype'] == 'relative': @@ -600,7 +605,7 @@

Source code for compass.landice.tests.eismint2.standard_experiments.visualiz if len(contour_levs) == 1: im = plt.contour(xi, yi, zi) else: - im = plt.contour(xi, yi, zi, contour_levs, cmap=plt.cm.jet) + im = plt.contour(xi, yi, zi, contour_levs, cmap=plt.get_cmap('jet')) # to see the raw data on top # plt.scatter(xCell, yCell, c=temperature[timelev,:,-1], s=100, diff --git a/latest/_modules/compass/ocean/tests/global_convergence/cosine_bell/analysis.html b/latest/_modules/compass/ocean/tests/global_convergence/cosine_bell/analysis.html index 33d2e1a1ae..21cca7c4dd 100644 --- a/latest/_modules/compass/ocean/tests/global_convergence/cosine_bell/analysis.html +++ b/latest/_modules/compass/ocean/tests/global_convergence/cosine_bell/analysis.html @@ -256,21 +256,20 @@

Source code for compass.ocean.tests.global_convergence.cosine_bell.analysis< # find time since the beginning of run ds = xr.open_dataset(f'{mesh_name}_output.nc') for j in range(len(ds.xtime)): - tt = str(ds.xtime[j].values) - tt.rfind('_') - DY = float(tt[10:12]) - 1 - if DY == pd: + time_string = str(np.strings.decode(ds.xtime[j].values)) + day = float(time_string[8:10]) - 1 + if day == pd: sliceTime = j break - HR = float(tt[13:15]) - MN = float(tt[16:18]) - t = 86400.0 * DY + HR * 3600. + MN + hour = float(time_string[11:13]) + min = float(time_string[14:16]) + t = 86400.0 * day + hour * 3600. + min # find new location of blob center # center is based on equatorial velocity - R = init.sphere_radius - distTrav = 2.0 * 3.14159265 * R / (86400.0 * pd) * t + r = init.sphere_radius + distTrav = 2.0 * np.pi * r / (86400.0 * pd) * t # distance in radians is - distRad = distTrav / R + distRad = distTrav / r newLon = lonCent + distRad if newLon > 2.0 * np.pi: newLon -= 2.0 * np.pi @@ -279,12 +278,12 @@

Source code for compass.ocean.tests.global_convergence.cosine_bell.analysis< tracer = np.zeros_like(init.tracer1[0, :, 0].values) latC = init.latCell.values lonC = init.lonCell.values - temp = R * np.arccos(np.sin(latCent) * np.sin(latC) + - np.cos(latCent) * np.cos(latC) * np.cos( - lonC - newLon)) + temp = r * np.arccos(np.sin(latCent) * np.sin(latC) + + (np.cos(latCent) * np.cos(latC) * + np.cos(lonC - newLon))) mask = temp < radius tracer[mask] = psi0 / 2.0 * ( - 1.0 + np.cos(3.1415926 * temp[mask] / radius)) + 1.0 + np.cos(np.pi * temp[mask] / radius)) # oad forward mode data tracerF = ds.tracer1[sliceTime, :, 0].values @@ -292,7 +291,7 @@

Source code for compass.ocean.tests.global_convergence.cosine_bell.analysis< init.close() ds.close() - return rmseValue, init.dims['nCells']

+ return rmseValue, init.sizes['nCells']
diff --git a/latest/_modules/compass/ocean/tests/sphere_transport/process_output.html b/latest/_modules/compass/ocean/tests/sphere_transport/process_output.html index f66fe2f6b1..9f38df01c7 100644 --- a/latest/_modules/compass/ocean/tests/sphere_transport/process_output.html +++ b/latest/_modules/compass/ocean/tests/sphere_transport/process_output.html @@ -112,12 +112,13 @@

Source code for compass.ocean.tests.sphere_transport.process_output

-import matplotlib.pyplot as plt
-from matplotlib.gridspec import GridSpec
-from matplotlib.colors import ListedColormap
+from importlib import resources
+
 import matplotlib
+import matplotlib.pyplot as plt
 import numpy as np
-from importlib import resources
+from matplotlib.colors import ListedColormap
+from matplotlib.gridspec import GridSpec
 
 
 def appx_mesh_size(dataset):
@@ -385,8 +386,8 @@ 

Source code for compass.ocean.tests.sphere_transport.process_output

map_file_found = False try: with resources.open_text( - "compass.ocean.tests.sphere_transport.resources", cmap_filename) \ - as f: + "compass.ocean.tests.sphere_transport.resources", + cmap_filename) as f: flines = f.readlines() map_file_found = True except BaseException: @@ -402,7 +403,7 @@

Source code for compass.ocean.tests.sphere_transport.process_output

result = ListedColormap(rgb, name=cmap_filename) else: print("error reading ncl colormap. using matplotlib default instead.") - result = matplotlib.cm.get_cmap() + result = matplotlib.pyplot.get_cmap() return result
@@ -492,8 +493,7 @@

Source code for compass.ocean.tests.sphere_transport.process_output

cmap="seismic", vmin=diffmin, vmax=diffmax) - lcm = axes[9].tricontourf(xc, yc, dataset.variables["layerThickness"] - [0, :, 1]) + axes[9].tricontourf(xc, yc, dataset.variables["layerThickness"][0, :, 1]) axes[9].set_ylabel('layer thickness') axes[10].tricontourf(xc, yc, dataset.variables["layerThickness"] [0, :, 1]) @@ -517,8 +517,8 @@

Source code for compass.ocean.tests.sphere_transport.process_output

axes[9 + i].set_xticklabels(xticklabels) for i in range(9): axes[i].set_xticklabels([]) - cb1 = fig.colorbar(cm, ax=axes[8]) - cb2 = fig.colorbar(tcm, ax=axes[5]) + fig.colorbar(cm, ax=axes[8]) + fig.colorbar(tcm, ax=axes[5]) # cb3 = fig.colorbar(lcm, ax=axes[11]) fig.suptitle(tcname)
diff --git a/latest/_modules/compass/ocean/tests/tides/analysis.html b/latest/_modules/compass/ocean/tests/tides/analysis.html index e2322fcc5a..d5fd0335d0 100644 --- a/latest/_modules/compass/ocean/tests/tides/analysis.html +++ b/latest/_modules/compass/ocean/tests/tides/analysis.html @@ -112,17 +112,18 @@

Source code for compass.ocean.tests.tides.analysis

-from compass.step import Step
+import os
 
-import netCDF4
-import matplotlib.pyplot as plt
-import matplotlib.cm as cm
-import numpy as np
 import cartopy.crs as ccrs
 import cartopy.feature as cfeature
-import os
+import matplotlib.pyplot as plt
+import netCDF4
+import numpy as np
+from matplotlib import colormaps
 from mpas_tools.logging import check_call
 
+from compass.step import Step
+
 
 
[docs] @@ -227,7 +228,7 @@

Source code for compass.ocean.tests.tides.analysis

# Write coordinate file for OTPS2 f = open('lat_lon', 'w') for i in range(nCells): - f.write(str(lat_grid[i])+' '+str(lon_grid[i])+'\n') + f.write(f'{lat_grid[i]} {lon_grid[i]} \n') f.close()
@@ -248,7 +249,7 @@

Source code for compass.ocean.tests.tides.analysis

'comment': '! 2. latitude/longitude/<time> file'}, {'inp': 'z', 'comment': '! 3. z/U/V/u/v'}, - {'inp': con, + {'inp': con, 'comment': '! 4. tidal constituents to include'}, {'inp': 'AP', 'comment': '! 5. AP/RI'}, @@ -264,10 +265,10 @@

Source code for compass.ocean.tests.tides.analysis

os.mkdir('inputs') # Write the setup_con file - f = open('inputs/'+con+'_setup', 'w') + f = open(f'inputs/{con}_setup', 'w') for line in lines: spaces = 28 - len(line['inp']) - f.write(line['inp'] + spaces*' ' + line['comment'] + '\n') + f.write(line['inp'] + spaces * ' ' + line['comment'] + '\n') f.close() # Write the Model_atlas_con file @@ -313,18 +314,18 @@

Source code for compass.ocean.tests.tides.analysis

line_sp = line.split() if line_sp[2] != '*************': val = float(line_sp[2]) - self.mesh_AP[con]['amp'][start+i] = val + self.mesh_AP[con]['amp'][start + i] = val else: - self.mesh_AP[con]['amp'][start+i] = -9999 + self.mesh_AP[con]['amp'][start + i] = -9999 if line_sp[3] != 'Site': val = float(line_sp[3]) if val < 0: val = val + 360.0 - self.mesh_AP[con]['phase'][start+i] = val + self.mesh_AP[con]['phase'][start + i] = val else: - self.mesh_AP[con]['phase'][start+i] = -9999
+ self.mesh_AP[con]['phase'][start + i] = -9999
@@ -397,7 +398,7 @@

Source code for compass.ocean.tests.tides.analysis

""" plt.switch_backend('agg') - cmap_reversed = cm.get_cmap('Spectral_r') + cmap_reversed = colormaps['Spectral_r'] # Initialize plotting variables TW = 2 # Tick width @@ -410,8 +411,8 @@

Source code for compass.ocean.tests.tides.analysis

lon_grid = np.mod(data_nc.variables['lonCell'][:] + np.pi, 2.0 * np.pi) - np.pi - lon_grid = lon_grid*180.0/np.pi - lat_grid = data_nc.variables['latCell'][:]*180.0/np.pi + lon_grid = lon_grid * 180.0 / np.pi + lat_grid = data_nc.variables['latCell'][:] * 180.0 / np.pi nCells = lon_grid.size data1 = np.zeros((nCells)) @@ -429,14 +430,14 @@

Source code for compass.ocean.tests.tides.analysis

# Use these to fix up the plots subplot_ticks = [[np.linspace(0, 0.65, 10), np.linspace(0, 0.65, 10), np.linspace(0, 0.13, 10), np.linspace(0, 0.13, 10)], - [np.linspace(0, 1.4, 10), np.linspace(0, 1.4, 10), + [np.linspace(0, 1.40, 10), np.linspace(0, 1.40, 10), np.linspace(0, 0.22, 10), np.linspace(0, 0.25, 10)], [np.linspace(0, 0.22, 10), np.linspace(0, 0.22, 10), np.linspace(0, 0.05, 10), np.linspace(0, 0.05, 10)], - [np.linspace(0, 0.5, 10), np.linspace(0, 0.5, 10), + [np.linspace(0, 0.50, 10), np.linspace(0, 0.50, 10), np.linspace(0, 0.08, 10), np.linspace(0, 0.08, 10)], - [np.linspace(0, 0.7, 10), np.linspace(0, 0.7, 10), - np.linspace(0, 0.5, 10), np.linspace(0, 0.5, 10)]] + [np.linspace(0, 0.70, 10), np.linspace(0, 0.70, 10), + np.linspace(0, 0.50, 10), np.linspace(0, 0.50, 10)]] for i, con in enumerate(constituent_list): @@ -453,39 +454,45 @@

Source code for compass.ocean.tests.tides.analysis

data2_phase[:] = data_nc.variables[ f'{con}Phase{self.tpxo_version}'][:] - data1_phase = data1_phase*np.pi/180.0 - data2_phase = data2_phase*np.pi/180.0 + data1_phase = data1_phase * np.pi / 180.0 + data2_phase = data2_phase * np.pi / 180.0 # Calculate RMSE values - rmse_amp = 0.5*(data1 - data2)**2 - rmse_com = 0.5*(data2**2 + data1**2) \ - - data1*data2*np.cos(data2_phase - data1_phase) + rmse_amp = 0.5 * (data1 - data2)**2 + rmse_com = 0.5 * (data2**2 + data1**2) \ + - data1 * data2 * np.cos(data2_phase - data1_phase) # Calculate mean (global) values - idx = np.where((depth > 20) - & (rmse_com < 1000) & (rmse_amp < 1000)) + idx = np.where((depth > 20) & (rmse_com < 1000) & + (rmse_amp < 1000)) area_tot = np.sum(area[idx]) - glo_rmse_amp = np.sqrt(np.sum(rmse_amp[idx]*area[idx])/area_tot) - glo_rmse_com = np.sqrt(np.sum(rmse_com[idx]*area[idx])/area_tot) + glo_rmse_amp = np.sqrt(np.sum(rmse_amp[idx] * area[idx]) / + area_tot) + glo_rmse_com = np.sqrt(np.sum(rmse_com[idx] * area[idx]) / + area_tot) print('Global RMSE (Amp) = ', glo_rmse_amp) print('Global RMSE (Com) = ', glo_rmse_com) # Calculate shallow RMSE (<=1000m) - idx = np.where((depth > 20) & (depth < 1000) - & (np.abs(lat_grid) < 66) - & (rmse_com < 1000) & (rmse_amp < 1000)) + idx = np.where((depth > 20) & (depth < 1000) & + (np.abs(lat_grid) < 66) & + (rmse_com < 1000) & (rmse_amp < 1000)) area_tot = np.sum(area[idx]) - shal_rmse_amp = np.sqrt(np.sum(rmse_amp[idx]*area[idx])/area_tot) - shal_rmse_com = np.sqrt(np.sum(rmse_com[idx]*area[idx])/area_tot) + shal_rmse_amp = np.sqrt(np.sum(rmse_amp[idx] * area[idx]) / + area_tot) + shal_rmse_com = np.sqrt(np.sum(rmse_com[idx] * area[idx]) / + area_tot) print('Shallow RMSE (Amp) = ', shal_rmse_amp) print('Shallow RMSE (Com) = ', shal_rmse_com) # Calculate deep RMSE (>1000m) - idx = np.where((depth >= 1000) & (np.abs(lat_grid) < 66) - & (rmse_com < 1000) & (rmse_amp < 1000)) + idx = np.where((depth >= 1000) & (np.abs(lat_grid) < 66) & + (rmse_com < 1000) & (rmse_amp < 1000)) area_tot = np.sum(area[idx]) - deep_rmse_amp = np.sqrt(np.sum(rmse_amp[idx]*area[idx])/area_tot) - deep_rmse_com = np.sqrt(np.sum(rmse_com[idx]*area[idx])/area_tot) + deep_rmse_amp = np.sqrt(np.sum(rmse_amp[idx] * area[idx]) / + area_tot) + deep_rmse_com = np.sqrt(np.sum(rmse_com[idx] * area[idx]) / + area_tot) print('Deep RMSE (Amp) = ', deep_rmse_amp) print('Deep RMSE (Com) = ', deep_rmse_com) @@ -500,7 +507,7 @@

Source code for compass.ocean.tests.tides.analysis

f'{con} RMSE (Complex) [m]'] for subplot in range(0, 4): - ax = fig.add_subplot(2, 2, subplot+1, + ax = fig.add_subplot(2, 2, subplot + 1, projection=ccrs.PlateCarree()) ax.set_title(subplot_title[subplot], fontsize=20) levels = subplot_ticks[i][subplot][:] @@ -549,9 +556,9 @@

Source code for compass.ocean.tests.tides.analysis

cbar.ax.tick_params(labelsize=16) fig.tight_layout() - global_err = str(round(glo_rmse_com*100, 3)) - deep_err = str(round(deep_rmse_com*100, 3)) - shallow_err = str(round(shal_rmse_com*100, 3)) + global_err = str(round(glo_rmse_com * 100, 3)) + deep_err = str(round(deep_rmse_com * 100, 3)) + shallow_err = str(round(shal_rmse_com * 100, 3)) fig.suptitle(f'Complex RMSE: Global = {global_err} cm; ' f'Deep = {deep_err} cm; ' f'Shallow = {shallow_err} cm', @@ -575,7 +582,7 @@

Source code for compass.ocean.tests.tides.analysis

# Setup chunking for TPXO extraction with large meshes indices = np.arange(self.nCells) - nchunks = np.ceil(self.nCells/200000) + nchunks = np.ceil(self.nCells / 200000) index_chunks = np.array_split(indices, nchunks) # Initialize data structure for TPXO values