From f19e0aa05d89e83f9b5aa669fd5f53a7ed8cc75e Mon Sep 17 00:00:00 2001 From: Nathan Von Hagen Date: Wed, 8 Dec 2021 19:24:48 +0000 Subject: [PATCH 01/10] all quirks fixed and runs smoothly --- ppmpy/ppm.py | 214 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 206 insertions(+), 8 deletions(-) diff --git a/ppmpy/ppm.py b/ppmpy/ppm.py index 9f3b671..a8b52eb 100644 --- a/ppmpy/ppm.py +++ b/ppmpy/ppm.py @@ -6515,7 +6515,7 @@ def spacetime_diagram(self, var_name, nt, fig, tlim=None, rlim=None, vlim=None, @savefig space_time.png width=6in In [136]: F4 = ppm.yprofile('F4') .....: import matplotlib.pyplot as plt - .....: fig2 = plt.figure(19) + .....: fig2 = pl.figure(19) .....: F4.spacetime_diagram('Ek',5,fig2) ''' @@ -8199,8 +8199,8 @@ def bucket_map(rprofile, quantity, limits = None, ticks = None, file_name = None theta2 = theta2[0:n_rows, :] value = value[0:n_rows] - #ifig = 1; plt.close(ifig); fig = plt.figure(ifig, figsize = (9, 4)) - #ifig = 1; plt.close(ifig); fig = plt.figure(ifig, figsize = (3.39, 2.4)) + #ifig = 1; pl.close(ifig); fig = pl.figure(ifig, figsize = (9, 4)) + #ifig = 1; pl.close(ifig); fig = pl.figure(ifig, figsize = (3.39, 2.4)) pl.clf() gs = gridspec.GridSpec(2, 1, height_ratios = [12, 1]) ax0 = pl.subplot(gs[0]) @@ -8239,7 +8239,7 @@ def bucket_map(rprofile, quantity, limits = None, ticks = None, file_name = None } cmap = LinearSegmentedColormap('my_cmap', cmap_points, gamma = gamma) #cmap_name = 'gist_earth_r' - #cmap = plt.get_cmap(cmap_name) + #cmap = pl.get_cmap(cmap_name) for i in range(phi2.shape[0]): t = (value[i] - cmap_min)/(cmap_max - cmap_min) if t < 0: t = 0. @@ -8262,10 +8262,10 @@ def fmt(x, pos): cb = ColorbarBase(ax1, cmap = cmap, norm = norm, ticks = ticks, \ format = ticker.FuncFormatter(fmt), orientation='horizontal') cb.set_label(r'$\Delta$r$_\mathrm{ub}$ / Mm') - #ropplt.tight_layout(h_pad = 2.) + #roppl.tight_layout(h_pad = 2.) pl.show() if file_name is not None: - #plt.savefig(file_name + '_' + cmap_name + '.pdf', bbox_inches = 'tight', facecolor = 'w', dpi = 332.7) + #pl.savefig(file_name + '_' + cmap_name + '.pdf', bbox_inches = 'tight', facecolor = 'w', dpi = 332.7) pl.savefig(file_name, bbox_inches = 'tight', facecolor = 'w', dpi = 332.7) def plot_Mollweide(rp_set, dump_min, dump_max, r1, r2, output_dir = None, Filename = None, ifig = 2): @@ -9050,8 +9050,8 @@ def plot_entr_v_ut(cases,c0, Ncycles,r1,r2, comp,metric,label,ifig = 3, label = 'MA07') pl.xlabel(r'log$_{10}$(v$_\perp$ / km s$^{-1}$)') pl.ylabel(r'log$_{10} ( \dot{\mathrm{M}}_\mathrm{e}$ / M$_\odot$ s$^{-1}$])') - #plt.xlim((0.9, 2.3)) - #plt.ylim((-9., -3.)) + #pl.xlim((0.9, 2.3)) + #pl.ylim((-9., -3.)) pl.legend(loc = 4) pl.tight_layout() @@ -11772,6 +11772,204 @@ def get_spherical_coordinates(self, theta, phi): else: return None +# ============================================================================ + + def __data_setup(self, varloc, dump, num_rays): + ''' + Grabs and organizes the data needed to run ray_analysis. + ''' + + run_res = self._rprofset.get('Nx',dump) #grabbing the run resolution + run_res = int(run_res) + + + data_points = int(run_res/4) + + radii = np.linspace(0,2685, data_points) + + ux = self.get('ux',fname=dump) + uy = self.get('uy',fname=dump) + uz = self.get('uz',fname=dump) + + npoints = self.sphericalHarmonics_lmax(2685)[-1] + gridlines = 0.1 + + #loading the data + u_r,u_theta,u_phi = self.get_spherical_components(ux, uy, uz) + ur_r, theta_r, phi_r = self.get_spherical_interpolation(u_r, 2685, npoints=npoints, plot_mollweide=True) + num_direcs = int(len(theta_r)) + + ind = np.random.randint(0, num_direcs, num_rays) #the directions you are looking outwards in + + + if varloc=='|ut|': + data = np.sqrt(np.power(u_theta,2.0) + np.power(u_phi,2.0)) + else: + data = self.get(varloc,fname=dump) + + avg_ray = [np.mean(self.get_spherical_interpolation(data, i, npoints=npoints, plot_mollweide=True)[0]) for i in radii] + avg_ray = np.array(avg_ray) + + all_rays = [self.get_spherical_interpolation(data, i, npoints=npoints, plot_mollweide=True)[0] for i in radii ] + all_rays = np.array(all_rays) + + # correcting for the proper units + if varloc=='|ut|': + avg_ray = avg_ray * 1e3 + all_rays = all_rays * 1e3 + elif varloc=='|w|': + avg_ray = avg_ray * 1e6 + all_rays = all_rays * 1e6 + + return [avg_ray, all_rays, data_points, ind, radii] + + def __data_sort(self, data, data_points, ind,num_rays): + ''' + Sorts the data from __data_setup into dictionaries for ease of use in ray_analysis + ''' + iter_list = [int(i) for i in range(num_rays)] + i=0 + rays=[] + while i Date: Wed, 8 Dec 2021 19:27:56 +0000 Subject: [PATCH 02/10] added needed imports and variables --- ppmpy/ppm.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ppmpy/ppm.py b/ppmpy/ppm.py index a8b52eb..79deea9 100644 --- a/ppmpy/ppm.py +++ b/ppmpy/ppm.py @@ -111,6 +111,8 @@ import ipywidgets as widgets from datetime import date import pickle +from random import shuffle +from itertools import cycle # import collections # FH: turn of logging as described here: # https://github.com/matplotlib/matplotlib/issues/14523 @@ -118,6 +120,12 @@ import logging logging.getLogger('matplotlib').setLevel(logging.ERROR) +# provides a cycle of different line styles and markers for plotting in a colour blind friendly manner +lll= 2*['-', '--', ':', '-.'] +markers = ['X','h','<','>','s','^','d','X','p'] +shuffle(lll) +CB_color_cycle = ['#4daf4a', '#a65628', '#984ea3','#ff7f00', '#f781bf', '#377eb8','#999999', '#e41a1c', '#dede00'] + # The unit of G in the code is 10^{-3} g cm^3 s^{-2}. G_code = nuconst.grav_const*1000. # code unit of gravitaional code_mass = 5.025e-07 # code unit of mass in solar masses From 73bc1b2a280def2ce6e937b83c464bbbabeadcc4 Mon Sep 17 00:00:00 2001 From: Nathan von Hagen Date: Thu, 9 Dec 2021 22:19:17 +0000 Subject: [PATCH 03/10] fixed --- ppmpy/ppm.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ppmpy/ppm.py b/ppmpy/ppm.py index 79deea9..a8b52eb 100644 --- a/ppmpy/ppm.py +++ b/ppmpy/ppm.py @@ -111,8 +111,6 @@ import ipywidgets as widgets from datetime import date import pickle -from random import shuffle -from itertools import cycle # import collections # FH: turn of logging as described here: # https://github.com/matplotlib/matplotlib/issues/14523 @@ -120,12 +118,6 @@ import logging logging.getLogger('matplotlib').setLevel(logging.ERROR) -# provides a cycle of different line styles and markers for plotting in a colour blind friendly manner -lll= 2*['-', '--', ':', '-.'] -markers = ['X','h','<','>','s','^','d','X','p'] -shuffle(lll) -CB_color_cycle = ['#4daf4a', '#a65628', '#984ea3','#ff7f00', '#f781bf', '#377eb8','#999999', '#e41a1c', '#dede00'] - # The unit of G in the code is 10^{-3} g cm^3 s^{-2}. G_code = nuconst.grav_const*1000. # code unit of gravitaional code_mass = 5.025e-07 # code unit of mass in solar masses From ae7161bff4cbf8a0c6fde777a8fbf866a7c0bf35 Mon Sep 17 00:00:00 2001 From: Nathan von Hagen Date: Thu, 9 Dec 2021 22:22:01 +0000 Subject: [PATCH 04/10] bug fixes --- ppmpy/ppm.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ppmpy/ppm.py b/ppmpy/ppm.py index a8b52eb..b317f78 100644 --- a/ppmpy/ppm.py +++ b/ppmpy/ppm.py @@ -111,6 +111,10 @@ import ipywidgets as widgets from datetime import date import pickle +from random import shuffle +from itertools import cycle +from scipy import stats +from multiprocessing import Pool # import collections # FH: turn of logging as described here: # https://github.com/matplotlib/matplotlib/issues/14523 @@ -118,6 +122,12 @@ import logging logging.getLogger('matplotlib').setLevel(logging.ERROR) +# provides a cycle of different line styles and markers for plotting in a colour blind friendly manner +lll= 2*['-', '--', ':', '-.'] +markers = ['X','h','<','>','s','^','d','X','p'] +shuffle(lll) +CB_color_cycle = ['#4daf4a', '#a65628', '#984ea3','#ff7f00', '#f781bf', '#377eb8','#999999', '#e41a1c', '#dede00'] + # The unit of G in the code is 10^{-3} g cm^3 s^{-2}. G_code = nuconst.grav_const*1000. # code unit of gravitaional code_mass = 5.025e-07 # code unit of mass in solar masses From b3e6ba594fc3098629382ad863eafaadd764cfde Mon Sep 17 00:00:00 2001 From: Nathan von Hagen Date: Thu, 9 Dec 2021 22:25:03 +0000 Subject: [PATCH 05/10] sk-plot --- ppmpy/ppm.py | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/ppmpy/ppm.py b/ppmpy/ppm.py index b317f78..64a87be 100644 --- a/ppmpy/ppm.py +++ b/ppmpy/ppm.py @@ -11979,6 +11979,53 @@ def ray_analysis(self, varloc, fname, xlim = [0,2685] ,num_rays = 96, logy = Fal pl.show() # ============================================================================ + def sk_plot(self, fname, ifig=1): + ''' + Makes the SK plot. + + Parameters + ---------- + fname: + The dump you would like to see. + ifig: + The figure number defaulted to 1. + + ''' + # setting up the needed radii to see the convective boundary and learning the run id + radii = np.linspace(1400, 1600) + run_name = self._run_id + + + # Loading the data needed to create the plot + ux = self.get(1, fname=fname) + uy = self.get(2, fname=fname) + uz = self.get(3, fname=fname) + ur, utheta, uphi = self.get_spherical_components(ux, uy, uz) + + def __processRad(rad): + #Get utheta_r and uphi_r values and the skew/ kurtosis + print("Processing Radius: {}".format(rad), end='\r') + npoints = self.sphericalHarmonics_lmax(rad)[-1] + ur_r = self.get_spherical_interpolation(ur, rad, npoints=npoints, plot_mollweide=True)[0] + ur_r *= 1e3 + kurt = stats.kurtosis(ur_r) + skew = stats.skew(ur_r) + SK = kurt * skew + return [SK] + + # loading the data + plot_val = [__processRad(i) for i in radii] + plot_val = np.array(plot_val) + + pl.close(ifig);pl.figure(ifig, figsize=(12.5,6)) + pl.plot(radii, plot_val, 'tab:blue') + pl.xlim(1400,1600);pl.title('{} - S$\cdot$K - Dump {}'.format(run_name, fname));pl.xlabel('Radii (Mm)');pl.ylabel('S$\cdot$K') + + pl.tight_layout() + pl.show() + + + def get_spherical_interpolation(self, varloc, radius, fname=None, npoints=5000, method='trilinear', logvar=False, plot_mollweide=False, get_igrid=False): From f41debbbcc50237e92426a025aad9be0b62277db Mon Sep 17 00:00:00 2001 From: Nathan Von Hagen Date: Wed, 15 Dec 2021 20:23:27 +0000 Subject: [PATCH 06/10] fixed a typo that outputted wrong plot title --- ppmpy/ppm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ppmpy/ppm.py b/ppmpy/ppm.py index 64a87be..6410449 100644 --- a/ppmpy/ppm.py +++ b/ppmpy/ppm.py @@ -11903,7 +11903,7 @@ def ray_analysis(self, varloc, fname, xlim = [0,2685] ,num_rays = 96, logy = Fal pl.plot(radii,needed_data[0] ,'-r',markevery=25, label = 'Spherically Averaged') pl.title('{} - {} : Dump {}'.format(run_name,varloc,fname));pl.xlim(xlim);pl.legend() - if varloc=='Ut': + if varloc=='|uy|': pl.ylabel('|Ut| : km/s') elif varloc== '|w|': pl.ylabel('$ | \omega | / \mathrm{\mu Hz}$') @@ -11926,7 +11926,7 @@ def ray_analysis(self, varloc, fname, xlim = [0,2685] ,num_rays = 96, logy = Fal pl.title('{} - {} : Dump {}'.format(run_name,varloc,fname));pl.xlim(xlim);pl.legend() - if varloc=='Ut': + if varloc=='|ut|': pl.ylabel('|Ut| : km/s') elif varloc== '|w|': pl.ylabel('$ | \omega | / \mathrm{\mu Hz}$') @@ -11955,7 +11955,7 @@ def ray_analysis(self, varloc, fname, xlim = [0,2685] ,num_rays = 96, logy = Fal pl.xlabel('Radius (Mm)');pl.xlim(xlim);pl.legend() - if varloc=='Ut': + if varloc=='|ut|': pl.ylabel('|Ut| : km/s') elif varloc== '|w|': pl.ylabel('$ | \omega | / \mathrm{\mu Hz}$') From 5473963c92bc15d4dfa2bd4b7b88f62ddce8c9d0 Mon Sep 17 00:00:00 2001 From: Nathan Von Hagen Date: Wed, 15 Dec 2021 20:45:00 +0000 Subject: [PATCH 07/10] fixes --- ppmpy/ppm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppmpy/ppm.py b/ppmpy/ppm.py index 6410449..0e1ee71 100644 --- a/ppmpy/ppm.py +++ b/ppmpy/ppm.py @@ -11903,7 +11903,7 @@ def ray_analysis(self, varloc, fname, xlim = [0,2685] ,num_rays = 96, logy = Fal pl.plot(radii,needed_data[0] ,'-r',markevery=25, label = 'Spherically Averaged') pl.title('{} - {} : Dump {}'.format(run_name,varloc,fname));pl.xlim(xlim);pl.legend() - if varloc=='|uy|': + if varloc=='|ut|': pl.ylabel('|Ut| : km/s') elif varloc== '|w|': pl.ylabel('$ | \omega | / \mathrm{\mu Hz}$') From 005d1ce51c0a554b926d8224976e1df7c28a6a05 Mon Sep 17 00:00:00 2001 From: Nathan Von Hagen Date: Wed, 15 Dec 2021 22:23:46 +0000 Subject: [PATCH 08/10] fixing sk plot --- ppmpy/ppm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ppmpy/ppm.py b/ppmpy/ppm.py index 0e1ee71..bf7d650 100644 --- a/ppmpy/ppm.py +++ b/ppmpy/ppm.py @@ -11979,7 +11979,7 @@ def ray_analysis(self, varloc, fname, xlim = [0,2685] ,num_rays = 96, logy = Fal pl.show() # ============================================================================ - def sk_plot(self, fname, ifig=1): + def sk_plot(self, fname, xlim = [1400,1600], ifig=1): ''' Makes the SK plot. @@ -11992,7 +11992,7 @@ def sk_plot(self, fname, ifig=1): ''' # setting up the needed radii to see the convective boundary and learning the run id - radii = np.linspace(1400, 1600) + radii = np.linspace(1200, 1900) run_name = self._run_id @@ -12019,7 +12019,7 @@ def __processRad(rad): pl.close(ifig);pl.figure(ifig, figsize=(12.5,6)) pl.plot(radii, plot_val, 'tab:blue') - pl.xlim(1400,1600);pl.title('{} - S$\cdot$K - Dump {}'.format(run_name, fname));pl.xlabel('Radii (Mm)');pl.ylabel('S$\cdot$K') + pl.xlim(xlim);pl.title('{} - S$\cdot$K - Dump {}'.format(run_name, fname));pl.xlabel('Radii (Mm)');pl.ylabel('S$\cdot$K') pl.tight_layout() pl.show() From 28cb2769c4fa15f2983cacb4ae379d0b431c3967 Mon Sep 17 00:00:00 2001 From: Nathan Von Hagen Date: Wed, 15 Dec 2021 22:29:54 +0000 Subject: [PATCH 09/10] more fixes --- ppmpy/ppm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppmpy/ppm.py b/ppmpy/ppm.py index bf7d650..e4a8bb1 100644 --- a/ppmpy/ppm.py +++ b/ppmpy/ppm.py @@ -11992,7 +11992,7 @@ def sk_plot(self, fname, xlim = [1400,1600], ifig=1): ''' # setting up the needed radii to see the convective boundary and learning the run id - radii = np.linspace(1200, 1900) + radii = np.linspace(1200, 1900, 175) run_name = self._run_id From ba6f6ce05dbb0b9daa18b67deb758422227afb2a Mon Sep 17 00:00:00 2001 From: Nathan Von Hagen Date: Wed, 15 Dec 2021 22:52:32 +0000 Subject: [PATCH 10/10] sk plot data point update and dataonly option in radial ray --- ppmpy/ppm.py | 136 +++++++++++++++++++++++++++------------------------ 1 file changed, 73 insertions(+), 63 deletions(-) diff --git a/ppmpy/ppm.py b/ppmpy/ppm.py index e4a8bb1..fb6cc98 100644 --- a/ppmpy/ppm.py +++ b/ppmpy/ppm.py @@ -11851,7 +11851,7 @@ def __data_sort(self, data, data_points, ind,num_rays): rays_data[ray_id] = raydir return [rays_data] - def ray_analysis(self, varloc, fname, xlim = [0,2685] ,num_rays = 96, logy = False, singleplot = False, ifig = 1): + def ray_analysis(self, varloc, fname, xlim = [0,2685] ,num_rays = 96, logy = False, dataonly = False, singleplot = False, ifig = 1): ''' Takes one of 3 variables and creates a radial ray analysis plot in comparison to the spherical average. @@ -11867,6 +11867,8 @@ def ray_analysis(self, varloc, fname, xlim = [0,2685] ,num_rays = 96, logy = Fal The number of rays you would like analyzed. A factor of 4 if you would like to see the 4 panel plot. logy: Would you like the log of the y value (useful for FV mostly) + dataonly: + If True, returns the values found for radii, all rays, and the average ray in that order [radii, rays, avg] singleplot: If you would like only one plot, otherwise defaults to 4 subplots ifig: @@ -11896,88 +11898,93 @@ def ray_analysis(self, varloc, fname, xlim = [0,2685] ,num_rays = 96, logy = Fal linecycle = cycle(lll) colour_cycle = cycle(CB_color_cycle) - if singleplot == True: - pl.close(ifig); pl.figure(ifig, figsize=(12.5,6)) - for i in iter_list: - pl.plot(radii, data_rays[0][i], next(linecycle), c = next(colour_cycle), linewidth=0.5) - pl.plot(radii,needed_data[0] ,'-r',markevery=25, label = 'Spherically Averaged') - pl.title('{} - {} : Dump {}'.format(run_name,varloc,fname));pl.xlim(xlim);pl.legend() + if dataonly==False: + if singleplot == True: + pl.close(ifig); pl.figure(ifig, figsize=(12.5,6)) + for i in iter_list: + pl.plot(radii, data_rays[0][i], next(linecycle), c = next(colour_cycle), linewidth=0.5) + pl.plot(radii,needed_data[0] ,'-r',markevery=25, label = 'Spherically Averaged') + pl.title('{} - {} : Dump {}'.format(run_name,varloc,fname));pl.xlim(xlim);pl.legend() - if varloc=='|ut|': - pl.ylabel('|Ut| : km/s') - elif varloc== '|w|': - pl.ylabel('$ | \omega | / \mathrm{\mu Hz}$') - else: - pl.ylabel('FV') + if varloc=='|ut|': + pl.ylabel('|Ut| : km/s') + elif varloc== '|w|': + pl.ylabel('$ | \omega | / \mathrm{\mu Hz}$') + else: + pl.ylabel('FV') - if logy==True: - pl.yscale('log') + if logy==True: + pl.yscale('log') - pl.tight_layout() - pl.show() + pl.tight_layout() + pl.show() - elif singleplot == False: + elif singleplot == False: - pl.close(ifig); pl.figure(ifig, figsize=(12.5,6)) - pl.subplot(2,2,1) - for i in iter_list[0:ind1]: - pl.plot(radii, data_rays[0][i], next(linecycle), c = next(colour_cycle), linewidth=0.5) - pl.plot(radii,needed_data[0] ,'-',markevery=25, label = 'Spherically Averaged') - pl.title('{} - {} : Dump {}'.format(run_name,varloc,fname));pl.xlim(xlim);pl.legend() + pl.close(ifig); pl.figure(ifig, figsize=(12.5,6)) + pl.subplot(2,2,1) + for i in iter_list[0:ind1]: + pl.plot(radii, data_rays[0][i], next(linecycle), c = next(colour_cycle), linewidth=0.5) + pl.plot(radii,needed_data[0] ,'-',markevery=25, label = 'Spherically Averaged') + pl.title('{} - {} : Dump {}'.format(run_name,varloc,fname));pl.xlim(xlim);pl.legend() - if varloc=='|ut|': - pl.ylabel('|Ut| : km/s') - elif varloc== '|w|': - pl.ylabel('$ | \omega | / \mathrm{\mu Hz}$') - else: - pl.ylabel('FV') + if varloc=='|ut|': + pl.ylabel('|Ut| : km/s') + elif varloc== '|w|': + pl.ylabel('$ | \omega | / \mathrm{\mu Hz}$') + else: + pl.ylabel('FV') - if logy==True: - pl.yscale('log') + if logy==True: + pl.yscale('log') - pl.subplot(2,2,2) - for i in iter_list[ind2:ind3]: - pl.plot(radii, data_rays[0][i], next(linecycle), c = next(colour_cycle), linewidth=0.5) - pl.plot(radii,needed_data[0],'-',markevery=25, label = 'Spherically Averaged') - pl.title('{} : {} - Dump {}'.format(run_name,varloc,fname));pl.xlim(xlim);pl.legend() + pl.subplot(2,2,2) + for i in iter_list[ind2:ind3]: + pl.plot(radii, data_rays[0][i], next(linecycle), c = next(colour_cycle), linewidth=0.5) + pl.plot(radii,needed_data[0],'-',markevery=25, label = 'Spherically Averaged') + pl.title('{} : {} - Dump {}'.format(run_name,varloc,fname));pl.xlim(xlim);pl.legend() - if logy==True: - pl.yscale('log') + if logy==True: + pl.yscale('log') - pl.subplot(2,2,3) - for i in iter_list[ind4:ind5]: - pl.plot(radii, data_rays[0][i], next(linecycle), c = next(colour_cycle), linewidth=0.5) - pl.plot(radii,needed_data[0],'-',markevery=25, label = 'Spherically Averaged') - pl.xlabel('Radius (Mm)');pl.xlim(xlim);pl.legend() + pl.subplot(2,2,3) + for i in iter_list[ind4:ind5]: + pl.plot(radii, data_rays[0][i], next(linecycle), c = next(colour_cycle), linewidth=0.5) + pl.plot(radii,needed_data[0],'-',markevery=25, label = 'Spherically Averaged') + pl.xlabel('Radius (Mm)');pl.xlim(xlim);pl.legend() - if varloc=='|ut|': - pl.ylabel('|Ut| : km/s') - elif varloc== '|w|': - pl.ylabel('$ | \omega | / \mathrm{\mu Hz}$') - else: - pl.ylabel('FV') + if varloc=='|ut|': + pl.ylabel('|Ut| : km/s') + elif varloc== '|w|': + pl.ylabel('$ | \omega | / \mathrm{\mu Hz}$') + else: + pl.ylabel('FV') - if logy==True: - pl.yscale('log') + if logy==True: + pl.yscale('log') - pl.subplot(2,2,4) - for i in iter_list[ind6:ind7]: - pl.plot(radii, data_rays[0][i],next(linecycle), c = next(colour_cycle), linewidth=0.5) - pl.plot(radii,needed_data[0],'-',markevery=25, label = 'Spherically Averaged') - pl.xlabel('Radius (Mm)');pl.xlim(xlim);pl.legend() + pl.subplot(2,2,4) + for i in iter_list[ind6:ind7]: + pl.plot(radii, data_rays[0][i],next(linecycle), c = next(colour_cycle), linewidth=0.5) + pl.plot(radii,needed_data[0],'-',markevery=25, label = 'Spherically Averaged') + pl.xlabel('Radius (Mm)');pl.xlim(xlim);pl.legend() - if logy==True: - pl.yscale('log') + if logy==True: + pl.yscale('log') - pl.tight_layout() - pl.show() - + pl.tight_layout() + pl.show() + else: + rays = data_rays[0] + avg = needed_data[0] + return radii, rays, avg + # ============================================================================ def sk_plot(self, fname, xlim = [1400,1600], ifig=1): ''' @@ -11992,7 +11999,10 @@ def sk_plot(self, fname, xlim = [1400,1600], ifig=1): ''' # setting up the needed radii to see the convective boundary and learning the run id - radii = np.linspace(1200, 1900, 175) + res = int(self._rprofset.get('Nx',fname)) # the run resolution + ratio = 2685/(res/4) # the ratio of Mm to points + data_points = 900/ratio # the representative number of data points for 900Mm of data based on the total number available in 2685Mm + radii = np.linspace(1000, 1900,int(data_points)) run_name = self._run_id