Beispiel #1
0
    def calc_inverse_likelihood(self,
                                hurst_chardist_opt_variables,
                                *params):
        hurst_related_exponent, characteristic_dist = hurst_chardist_opt_variables
        fft_well_log, list_wave_number = params

        log_abs_fft_noise = mg.calc_log_abs_fft_noise(fft_well_log,
                                                      list_wave_number,
                                                      hurst_related_exponent,
                                                      characteristic_dist)
        half_num_value = np.floor(log_abs_fft_noise.size / 2)
        first_half_median = np.median(log_abs_fft_noise[:half_num_value])
        second_half_median = np.median(log_abs_fft_noise[half_num_value + 1:])
        with warnings.catch_warnings(record=True) as w:
            # Cause all warnings to always be triggered.
            warnings.simplefilter("always")
            out = np.abs(first_half_median - second_half_median)
            if len(w):
                # do something with the first warning
                print w[0].message
                print "hurst_related_exponent = %g, characteristic_dist=%g" % (hurst_related_exponent,
                                                                               characteristic_dist)
                print "first_half_median = %g, second_half_median=%g" % (first_half_median, second_half_median)
                raise
        return out
Beispiel #2
0
    def calc_inverse_likelihood(self,
                                hurst_chardist_opt_variables,
                                *params):
        hurst_related_exponent, characteristic_dist = hurst_chardist_opt_variables
        fft_well_log, list_wave_number = params

        log_abs_fft_noise = mg.calc_log_abs_fft_noise(fft_well_log,
                                                      list_wave_number,
                                                      hurst_related_exponent,
                                                      characteristic_dist)
        return np.var(log_abs_fft_noise)
Beispiel #3
0
    def calc_inverse_likelihood(self,
                                hurst_chardist_opt_variables,
                                *params):
        hurst_related_exponent, characteristic_dist = hurst_chardist_opt_variables
        fft_well_log, list_wave_number = params

        log_abs_fft_noise = mg.calc_log_abs_fft_noise(fft_well_log,
                                                      list_wave_number,
                                                      hurst_related_exponent,
                                                      characteristic_dist)

        num_fft_well_log = fft_well_log.size
                    # If noise is zero, log_abs_fft_noise = 0 vector,
                    # We prevent division of zero by adding non-zero constant to log_abs_fft_noise.
        log_abs_fft_noise = log_abs_fft_noise + 1
        sum_log_abs_fft_noise = np.sum(log_abs_fft_noise)
        semblance = sum_log_abs_fft_noise / (np.sqrt(sum_log_abs_fft_noise) * np.sqrt(num_fft_well_log))
        return np.abs(semblance - 1)