def imshow_sw(dat,seis_coord = None,well_files = None,horfiles = None,rockprop = None) : minval = 0 maxval = np.max(dat) fig, ax = plt.subplots() divider = make_axes_locatable(ax) cax = divider.append_axes('right', size='5%', pad=0.05) if (seis_coord is None): pos =ax.imshow(dat,interpolation='bicubic',cmap = 'nipy_spectral', aspect='auto',vmin = 0,vmax =maxval) fig.colorbar(pos, cax=cax, orientation='vertical') else: #dist = calc_dist(seis_coord)[0] tmin = seis_coord['tseis'][0] tmax = seis_coord['tseis'][-1] xmin = 0 xmax = dat.shape[1]*seis_coord['bins'][0] pos = ax.imshow(dat,interpolation='bicubic',cmap = 'nipy_spectral', aspect='auto',vmin =0,vmax =maxval,\ extent = [xmin,xmax,tmax,tmin]) nwells = well_files.size numm = 40 wellcoord = seis_coord['wellcoord'] for i in range(nwells): wlog = mfun.load_obj(well_files[i]) rho = wlog.Rhob if (rho is None): raise Exception ('Density log does not exist') wtmin = np.int(wlog.time[0]) wtmax = np.int(wlog.time[-1]) if(wtmin < tmin): wtmin = tmin elif( wtmax > tmax): wtmax = tmax zone = np.array([wtmin,wtmax], dtype = int) rho = mfun.segment_logs(zone,wlog.time,rho)[0] wxmin = xmin + wellcoord['indx'][i]*seis_coord['bins'][0] wxmax = wxmin + numm ai_mat = np.tile(rho,[numm,1]).T ax.imshow(ai_mat,interpolation='bicubic',cmap = 'nipy_spectral', aspect='auto',vmin = 0,vmax =maxval,\ extent = [wxmin,wxmax,wtmax,wtmin]) if(horfiles is not None): nhor = horfiles.size indx = seis_coord['coord_indx'] hor_x = np.arange(xmin,xmax,seis_coord['bins'][0]) # temp for xd in range(nhor): hor = mfun.load_obj(horfiles[xd]) hor_y = hor.Z[indx] ax.plot(hor_x,hor_y,'k') fig.colorbar(pos, cax=cax, orientation='vertical') ax.autoscale() ax.set_xlabel('Distance(m)') ax.set_ylabel('Time(ms)') if (rockprop is None): rockprop = 'Porosity' ax.set_title(rockprop)
w19_19A.apply_TD() w19_19A_time = well() w19_19A_time = mfun.load_obj('well_files//volve//time//w19A') # debug zone = np.zeros(2) if (w19_19A.time [0] >= w19_19A_time.time[0] ): zone[0] = w19_19A.time[0] else: zone[0] = w19_19A_time.time[0] if (w19_19A.time [-1]<=w19_19A_time.time[-1] ): zone[1] = w19_19A_time.time[-1] else: zone[1] = w19_19A.time[-1] zone[0] = 2350 zone[1] = 2515 w19_19A.calc_Vp() ax2.plot(w19_19A.time,w19_19A.Vp) vp_time_zn,new_time_zn = mfun.segment_logs(zone,w19_19A.time,w19_19A.Vp) org_vp_time_zn,org_time_zn = mfun.segment_logs(zone,w19_19A_time.time,w19_19A_time.Vp) fig, (ax1, ax2) = plt.subplots(2,1) ax1.plot(new_time_zn,vp_time_zn) ax2.plot(org_time_zn,org_vp_time_zn) w19_19A.save_obj('w19_19A_jan2020',w19_19A)
def predict_ver2(params, wlog, LOGS, tseis): dt = tseis[1] - tseis[0] nwells, nlogs = LOGS.size logs = mfun.cell(nwells, nlogs) for i in range(nwells): t1 = np.min(tseis) t2 = np.min(LOGS[i, 0]) - dt upper = np.arange(t1, t2 + dt, dt) z = upper if (upper.size == 0): upperzone_data = z # there is data above the horizon else: if (wlog == 'AI'): scal = 1 upperzone_data = scal * fcompactntrend_AI(z, params) elif (wlog == 'Vp'): scal = 1 upperzone_data = scal * fcompactntrend_vp(z, params) elif (wlog == 'Vs'): scal = 1 upperzone_data = scal * fcompactntrend_vs(z, params) elif (wlog == 'Rhob'): upperzone_data = fcompactntrend_rho(z, params) elif (wlog == 'GR'): upperzone_data = fcompactntrend_gr(z, params) else: raise Exception('not yet coded for this lognames') t2 = np.max(tseis) t1 = np.max(LOGS[i, 0]) + dt lower = np.arange(t1, t2 + dt, dt) z = lower if (lower.size == 0): lowerzone_data = lower # there is data beneath tseis else: if (wlog == 'AI'): scal = 1 lowerzone_data = scal * fcompactntrend_AI(z, params) elif (wlog == 'Vp'): scal = 1 lowerzone_data = scal * fcompactntrend_vp(z, params) elif (wlog == 'Vs'): scal = 1 lowerzone_data = scal * fcompactntrend_vs(z, params) elif (wlog == 'Rhob'): scal = 1 lowerzone_data = fcompactntrend_rho(z, params) elif (wlog == 'GR'): lowerzone_data = fcompactntrend_gr(z, params) else: raise Exception('not yet coded for this lognames') if (upper.size == 0 and lower.size != 0): zone = np.array([np.min(tseis), LOGS[i, 0][-1]], dtype=int) data, t = mfun.segment_logs(zone, LOGS[i, 0], LOGS[i, 3]) dat_out = np.concatenate((data, lowerzone_data), axis=None) elif (upper.size != 0 and lower.size == 0): zone = np.array([LOGS[i, 0][0], tseis[-1]], dtype=int) data, t = mfun.segment_logs(zone, LOGS[i, 0], LOGS[i, 3]) dat_out = np.concatenate((upperzone_data, data), axis=None) elif (upper.size == 0 and lower.size == 0): zone = np.array([np.min(tseis), np.max(tseis)], dtype=int) data, t = mfun.segment_logs(zone, LOGS[i, 0], LOGS[i, 3]) dat_out = data else: #upper and lower zone zero dat_out = np.concatenate( (upperzone_data, LOGS[i, 3], lowerzone_data), axis=None) logs[i, 0] = tseis logs[i, 1] = LOGS[i, 1] logs[i, 2] = LOGS[i, 2] logs[i, 3] = dat_out return logs