[mngseg] update
This commit is contained in:
@@ -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,12 +264,13 @@ 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)
|
||||||
|
|
||||||
# (optional) make the image for each scale
|
|
||||||
for s in range(fit_min, fit_max + 1):
|
|
||||||
scale_images(wt, M, label, scale=s)
|
|
||||||
|
|
||||||
# (optional) plot the histogram for each scale
|
if scale_image:
|
||||||
plot_each_scale(S11a, wav_k, q, label, coherent=True)
|
# (optional) make the image for each scale
|
||||||
|
for s in range(fit_min, fit_max + 1):
|
||||||
|
scale_images(wt, M, label, scale=s)
|
||||||
|
# (optional) plot the histogram for each scale
|
||||||
|
plot_each_scale(S11a, wav_k, q, label, coherent=True)
|
||||||
|
|
||||||
# calc Fourier power spectrum for comparison
|
# calc Fourier power spectrum for comparison
|
||||||
tab_k, spec_k = powspec(imzm, reso=1)
|
tab_k, spec_k = powspec(imzm, reso=1)
|
||||||
|
|||||||
Reference in New Issue
Block a user