Ejemplo n.º 1
0
 def update(val):
     hurst_related_exponent = hurst_related_exp_slider.val
     characteristic_dist = characteristic_dist_slider.val
     von_karman_energy_spectrum = mg.calc_von_karman_energy_spectrum(list_wave_number,
                                                                     hurst_related_exponent,
                                                                     characteristic_dist)
     l.set_ydata(von_karman_energy_spectrum)
     hurst_related_exponent_two = hurst_related_exp_slider_two.val
     characteristic_dist_two = characteristic_dist_slider_two.val
     von_karman_energy_spectrum_two = mg.calc_von_karman_energy_spectrum(list_wave_number,
                                                                         hurst_related_exponent_two,
                                                                         characteristic_dist_two)
     l_two.set_ydata(von_karman_energy_spectrum_two)
     draw()
Ejemplo n.º 2
0
                                    # generate fft well log
            half_num_value_well_log_plus_one = np.floor(num_value_well_log) / 2 + 1
            list_wave_number_true = (np.arange(half_num_value_well_log_plus_one)
                                     / num_value_well_log)
                                    # --> generate noise
            gaussian_noise = np.random.normal(mean_gaussian_noise_time_domain,
                                              variance_gaussian_noise_time_domain_true,
                                              num_value_well_log)
            fft_gaussian_noise = np.fft.fft(gaussian_noise)
            fft_gaussian_noise_truncate = fft_gaussian_noise[0:half_num_value_well_log_plus_one]
            if no_noise:
                fft_gaussian_noise_truncate = 1

            von_karman_energy_spectrum_true = mg.calc_von_karman_energy_spectrum(list_wave_number_true,
                                                                                 hurst_related_exponent_true,
                                                                                 characteristic_dist_true)

            fft_well_log_true = np.multiply(np.sqrt(von_karman_energy_spectrum_true), fft_gaussian_noise_truncate)

                                    # calculate the true likelihood
            params = (fft_well_log_true, list_wave_number_true)
            inverse_likelihood_true = likelihood_measure.calc_inverse_likelihood(
                (hurst_related_exponent_true, characteristic_dist_true),
                *params)
            unique_to_function_call_logger.info("----> true values")
            unique_to_function_call_logger.info('b_true = %g, H_true = %g, inverse_likelihood_true = %g,' %
                                                (characteristic_dist_true,
                                                 hurst_related_exponent_true,
                                                 inverse_likelihood_true))
Ejemplo n.º 3
0
import model_generation as mg

if __name__ == '__main__':
    from pylab import *
    from matplotlib.widgets import Slider, Button, RadioButtons

    ax = subplot(111)
    subplots_adjust(left=0.25, bottom=0.50)
    support_start = 0.0
    support_stop = 1.0
    support_step = 0.001
    list_wave_number = arange(support_start, support_stop, support_step) 
    hurst_related_exponent_initial = 0.5
    characteristic_dist_initial = 3
    von_karman_energy_spectrum = mg.calc_von_karman_energy_spectrum(list_wave_number,
                                                                    hurst_related_exponent_initial,
                                                                    characteristic_dist_initial)
    l, = plot(list_wave_number, von_karman_energy_spectrum, lw=2, color='red')
    l_two, = plot(list_wave_number, von_karman_energy_spectrum, lw=2, color='blue')

    axis([support_start, support_stop, -10, 10])

    axcolor = 'lightgoldenrodyellow'
    axis_character_dist = axes([0.25, 0.10, 0.65, 0.03], axisbg=axcolor)
    axis_hurst_related_exp = axes([0.25, 0.15, 0.65, 0.03], axisbg=axcolor)
    axis_character_dist_two = axes([0.25, 0.20, 0.65, 0.03], axisbg=axcolor)
    axis_hurst_related_exp_two = axes([0.25, 0.25, 0.65, 0.03], axisbg=axcolor)

    hurst_related_exp_min = -0.25
    hurst_related_exp_max = 1
    characteristic_dist_min = 0