예제 #1
0
    def plot_section(self):
        # self.matplotlib_widget.fig.clf()
        colormap = self.control_widget.colormap_ComboBox.currentText()
        if self.control_widget.wiggle_CheckBox.checkState() == Qt.Checked:
            kind = 'vawt'
        else:
            kind = 'img'

        ax = self.matplotlib_widget.axes
        ax.cla()
        for idx in range(self.control_widget.data_listWidget.count()):
            # for data_item in self.control_widget.data_listWidget.items:
            item = self.control_widget.data_listWidget.item(idx)
            if self.control_widget.il_radioButton.isChecked() is True:
                if item.checkState() == Qt.Checked:
                    data_path = Path(CONF.data_root) / CONF.current_survey / \
                        "Seismics" / ".{}".format(item.text())
                    if data_path.exists() is True:
                        if not hasattr(self, "data_{}".format(item.text())):
                            # check if data has already been loaded
                            # create new seis object if not
                            self.new_seis_object(item.text())
                        self.status.emit("Reading data ...")
                        seis_object = getattr(self,
                                              "data_{}".format(item.text()))
                        self.status.emit("Plotting ...")
                        seis_object.plot(ppp.InlineIndex(
                            self.control_widget.inline_SpinBox.value()),
                                         ax,
                                         kind=kind,
                                         cm=colormap)
                        self.matplotlib_widget.fig.canvas.draw()
                        self.status.emit("")
                    else:
                        self.statusBar().showMessage(
                            "can not find data file {}".format(item.text))

            elif self.control_widget.cl_radioButton.isChecked() is True:
                if item.checkState() == Qt.Checked:
                    data_path = Path(CONF.data_root) / CONF.current_survey / \
                        "Seismics" / ".{}".format(item.text())
                    if data_path.exists() is True:
                        if not hasattr(self, "data_{}".format(item.text())):
                            # check if data has already been loaded
                            # create new seis object if not
                            self.new_seis_object(item.text())
                        self.status.emit("Reading data ...")
                        seis_object = getattr(self,
                                              "data_{}".format(item.text()))
                        self.status.emit("Plotting ...")
                        seis_object.plot(ppp.CrlineIndex(
                            self.control_widget.crline_SpinBox.value()),
                                         ax,
                                         kind=kind,
                                         cm=colormap)
                        self.matplotlib_widget.fig.canvas.draw()
                        self.status.emit("")
                    else:
                        self.statusBar().showMessage(
                            "can not find data file {}".format(item.text))
def average_to_interval(input_object, output_object):
    input_seisegy = ppp.SeiSEGY(str(input_object.path))
    output_seisegy = ppp.SeiSEGY(str(output_object.path))
    twt = np.array(list(input_seisegy.depths()))
    for il in input_seisegy.inlines():
        input_data_inline = input_seisegy.inline(il)
        output_data_inline = np.copy(input_data_inline)
        for idx in range(input_seisegy.nNorth):
            output_data_inline[idx] = ppp.avg2int(twt, input_data_inline[idx])
        output_seisegy.update(ppp.InlineIndex(il), output_data_inline)
def velocity_to_density_conversion(input_object, output_object, c, d):
    input_seisegy = ppp.SeiSEGY(str(input_object.path))
    output_seisegy = ppp.SeiSEGY(str(output_object.path))
    # twt = np.array(list(input_seisegy.depths()))
    for il in input_seisegy.inlines():
        input_data_inline = input_seisegy.inline(il)
        output_data_inline = np.copy(input_data_inline)
        for idx in range(input_seisegy.nNorth):
            output_data_inline[idx] = ppp.gardner(input_data_inline[idx], c, d)
        output_seisegy.update(ppp.InlineIndex(il), output_data_inline)
예제 #4
0
def obp_calculation(input_object, output_object):
    input_seisegy = ppp.SeiSEGY(str(input_object.path))
    stepDepth = input_seisegy.survey_setting.stepDepth
    output_seisegy = ppp.SeiSEGY(str(output_object.path))
    # depth = np.array(list(input_seisegy.depths()))
    for il in input_seisegy.inlines():
        input_data_inline = input_seisegy.inline(il)
        output_data_inline = np.copy(input_data_inline)
        for idx in range(input_seisegy.nNorth):
            output_data_inline[idx] = ppp.obp_trace(input_data_inline[idx],
                                                    stepDepth)
        output_seisegy.update(ppp.InlineIndex(il), output_data_inline)
예제 #5
0
def test__seisegy():
    seis_cube = ppp.SeiSEGY("test/data/f3_sparse.sgy")
    # test generators
    assert list(seis_cube.inlines()) == list(range(200, 641, 20))
    assert list(seis_cube.crlines())[-1] == 1200
    assert list(seis_cube.inline_crlines())[-1] == (640, 1200)
    assert list(seis_cube.depths())[-1] == 1100
    # test retrieve data
    first_test_cdp_data = seis_cube.data(ppp.CdpIndex((200, 700)))
    assert (seis_cube.data(ppp.InlineIndex(200))[0] == \
        first_test_cdp_data).all()
    assert (seis_cube.data(ppp.CrlineIndex(700))[0] == \
        first_test_cdp_data).all()
    assert seis_cube.data(ppp.DepthIndex(1100))[0][0] == \
        first_test_cdp_data[-1]
    assert seis_cube.valid_cdp((199, 400)) == (200, 400)
    assert str(seis_cube) == repr(seis_cube)
예제 #6
0
def eaton_calculation(obp_object, vel_object, output_object, a, b, n):
    obp_seisegy = ppp.SeiSEGY(str(obp_object.path))
    vel_seisegy = ppp.SeiSEGY(str(vel_object.path))
    output_seisegy = ppp.SeiSEGY(str(output_object.path))
    # preparation
    depth = np.array(list(obp_seisegy.depths()))
    vn = ppp.normal(depth, a, b)
    hydrostatic = ppp.hydrostatic_trace(depth)
    # actual calcualtion
    for il in obp_seisegy.inlines():
        obp_data_inline = obp_seisegy.inline(il)
        vel_data_inline = vel_seisegy.inline(il)
        output_data_inline = np.copy(obp_data_inline)
        for idx in range(obp_seisegy.nNorth):
            output_data_inline[idx] = ppp.eaton(
                vel_data_inline[idx], vn, hydrostatic,
                obp_data_inline[idx], n=n)
        output_seisegy.update(ppp.InlineIndex(il), output_data_inline)
예제 #7
0
def bowers_calculation(obp_object, vel_object, output_object, a, b):
    obp_seisegy = ppp.SeiSEGY(str(obp_object.path))
    vel_seisegy = ppp.SeiSEGY(str(vel_object.path))
    output_seisegy = ppp.SeiSEGY(str(output_object.path))

    # actual calcualtion
    for il in obp_seisegy.inlines():
        obp_data_inline = obp_seisegy.inline(il)
        vel_data_inline = vel_seisegy.inline(il)
        output_data_inline = np.copy(obp_data_inline)
        for idx in range(obp_seisegy.nNorth):
            output_data_inline[idx] = ppp.bowers(vel_data_inline[idx],
                                                 obp_data_inline[idx],
                                                 1,
                                                 start_idx=-1,
                                                 a=a,
                                                 b=b,
                                                 vmax=5000,
                                                 end_idx=None)
        output_seisegy.update(ppp.InlineIndex(il), output_data_inline)
예제 #8
0
def test__InlineIndex():
    assert ppp.InlineIndex(1).value == 1