示例#1
0
def Get_Cr_PointSet(wells,Seg = None):
    i=0
    for well in wells:
        try:
            ac_data = RawData.get_column_floatData(well, columname)
            depth = RawData.get_well_depthdata(well)
        except:
            continue
            #depth = np.arange(0,len(ac_data)).tolist()
        '''
        
        if(Seg.if_exist_segment(well, "龙潭组")):
            ac_data = Seg.get_segment_columndata(well, "龙潭组", "ac")
            depth = Seg.get_segment_depthdata(well,"龙潭组")
        else:
            continue
        '''
        
        #if well in ["well96","well121","well94","well90"]:
        #    continue
        tmp = depth[0]
        for j in range(len(depth)):
            depth[j] -= tmp
        data_preprocesser.data_except_invalid(depth,ac_data)
        x,y = data_preprocesser.getkeypoint_from_rawdata(depth,ac_data)
        InitAndProcess_Cr(depth,ac_data,x,y,well + "龙潭组")
        xdata.append(x)
        ydata.append(y)

        i+=1
        if(i == 21):
            break

    return xdata,ydata
示例#2
0
data = []
RawData = rawdata_provider.RawDataProvider()
wells = RawData.get_well_allnames()
Seg = well_segment_provider.WellSegmentProvider()

i = 0
#读取数据
z = []
for well in wells:
    ac_data = RawData.get_column_floatData(well, "ac")
    if (Seg.if_exist_segment(well, "龙潭组")):
        ac_data = Seg.get_segment_columndata(well, "龙潭组", "ac")
        depth = np.arange(0, len(ac_data), 1 / 8).tolist()
        data_preprocesser.data_except_invalid(depth, ac_data)
        x, y = data_preprocesser.getkeypoint_from_rawdata(depth,
                                                          ac_data,
                                                          threshold=1)
        tmp = []
        for j in range(len(y) - 1):
            tmp += list(
                np.arange(y[j], y[j + 1],
                          (y[j + 1] - y[j]) / (x[j + 1] - x[j]) / 8))
        data.append(tmp)
    i += 1
    if (i == 4):
        break

data_set = np.zeros((10000, 1000))
re_set = np.zeros(10000)
for i in range(4):
    for j in range(len(data[i])):
示例#3
0
            well] = well_central_frequency  #再建立一个字典,用于储存所有井的所有指标的中心频率

        #创建图片的存储路径
        save_path_each_well_before = os.path.join(save_path_before, well)
        os.mkdir(save_path_each_well_before)
        save_path_each_well_after = os.path.join(save_path_after, well)
        os.mkdir(save_path_each_well_after)

        for detecting_name in detecting_names:

            ac_data = RawDataProvider.get_column_floatData(
                well, detecting_name)
            depth = RawDataProvider.get_well_depthdata(well)
            #fill_invaliddata_use_aver(ac_data)#对井中的特性数据做预处理,将无效值用总体有效平均值代替

            new_depth, new_data = getkeypoint_from_rawdata(
                depth, ac_data)  #对数据做了三个预处理操作包括:去除无效值,平滑处理,曲线粗化
            sampling_rate = 8000  #采样频率

            #这里构造一个字典,记录这些数据的中心频率
            fc = pywt.central_frequency('mexh')  #中心频率,cgau8对应的中心频率是0.7
            well_central_frequency[detecting_name] = fc

            filter('nan', new_data)
            if len(new_data) > 20:

                #绘制原信号图并保存
                pic_str = save_path_each_well_before + '\\' + well + '_' + detecting_name + '.png'
                plt.figure(i)
                plt.plot(new_depth, new_data)
                plt.savefig(pic_str)
                i += 1
#需要分析的井
wellname_to_analysis = rawdata_provider.RawDataProvider().get_well_allnames()
#需要分析的曲线
columnname_to_analysis = "GR"
depths = []
datas = []

depths_keypoint = []
datas_keypoint = []

for i in range(len(wellname_to_analysis)):
    depth = rawdata_getter.get_well_depthdata(wellname_to_analysis[i])
    data = rawdata_getter.get_column_floatData(wellname_to_analysis[i],columnname_to_analysis)
    data_preprocesser.fill_invaliddata_use_aver(data)

    depth_key,data_key= data_preprocesser.getkeypoint_from_rawdata(depth,data)
    depths.append(depth)
    datas.append(data)

    depths_keypoint.append(depth_key)
    datas_keypoint.append(data_key)
    print("len_depth:"+str(len(depth_key)))
    print("len_data:"+str(len(data_key)))
    #simple_log_plot.plot_2_log(depths_keypoint[i],datas_keypoint[i],"depth","data",depths[i],datas[i],"depth1","data2")

info_1 = data_preprocesser.get_rake_ratio_and_linelen(depths_keypoint[0],datas_keypoint[0])
for i in range(len(wellname_to_analysis)):
    info_2 = data_preprocesser.get_rake_ratio_and_linelen(depths_keypoint[i],datas_keypoint[i])
    distance,list = fastdtw.fastdtw(info_1,info_2)
    simple_log_plot.correlation_plot_for_2well(depths_keypoint[0],datas_keypoint[0],depths_keypoint[i],datas_keypoint[i],map=list,xlabel="depth",ylabel=columnname_to_analysis)