[mngseg] update

This commit is contained in:
Noe Brucy
2021-07-06 14:53:28 +02:00
parent 85310d848b
commit 477ea0eafc
+4 -3
View File
@@ -158,7 +158,7 @@ def plot_components_power_spectrum(
): ):
# plot power spectra # plot power spectra
plt.figure(figsize=(5, 5)) plt.figure(1, figsize=(5, 5))
plt.plot(tab_k, spec_k, color="black", label="Fourier PS", linewidth=1.5) plt.plot(tab_k, spec_k, color="black", label="Fourier PS", linewidth=1.5)
plt.plot(wav_k, S1a[0, :], "s", color="black", label="Wavelet PS", markersize=6) plt.plot(wav_k, S1a[0, :], "s", color="black", label="Wavelet PS", markersize=6)
plt.plot(wav_k, S1a[1, :], "D", color="blue", label="Coherent PS", markersize=4) plt.plot(wav_k, S1a[1, :], "D", color="blue", label="Coherent PS", markersize=4)
@@ -236,7 +236,7 @@ def load_results(label):
return wav_k, S1a, wt, S11a, q return wav_k, S1a, wt, S11a, q
def analyse_sim(im, load=False): def analyse_sim(im, load=False, scale_image=False):
""" Do the MnGseg analysis """ """ Do the MnGseg analysis """
meanim = np.mean(im) meanim = np.mean(im)
imzm = im - meanim imzm = im - meanim
@@ -264,10 +264,11 @@ def analyse_sim(im, load=False):
# make images of the Gaussian and coherent part # make images of the Gaussian and coherent part
make_images(im, wt, M, meanim, label) make_images(im, wt, M, meanim, label)
if scale_image:
# (optional) make the image for each scale # (optional) make the image for each scale
for s in range(fit_min, fit_max + 1): for s in range(fit_min, fit_max + 1):
scale_images(wt, M, label, scale=s) scale_images(wt, M, label, scale=s)
# (optional) plot the histogram for each scale # (optional) plot the histogram for each scale
plot_each_scale(S11a, wav_k, q, label, coherent=True) plot_each_scale(S11a, wav_k, q, label, coherent=True)