# -----basemap params---------------------- 'xmin': -101, 'xmax': -94, 'ymin': 33.5, 'ymax': 37.1, 'projection': 'merc', # or 'cea' 'aea' for equal area projections } #--------------------------1--------------------------------------------- # load data #------------------------------------------------------------------------ os.chdir(data_dir) # load seismicity and well data using loadtxt mSeis = np.loadtxt(file_eq).T #:TODO data-time to decimal years aTime = funcs.dateTime2decYr(mSeis[1], mSeis[2], mSeis[3], mSeis[4], mSeis[5], mSeis[6]) mSeis = np.array([aTime, mSeis[7], mSeis[8], mSeis[-1]]) #TODO: select most recent seismic events sel = np.logical_and(mSeis[0] >= 2014.5, mSeis[0] < 2016) mWells = np.loadtxt(file_well).T #--------------------------2--------------------------------------------- # map view, select boundaries of seismicity #------------------------------------------------------------------------ #no where in the problem does it say to plot wells, not sure why that was in the skeleton code lon_0, lat_0 = .5 * (dPar['xmin'] + dPar['xmax']), .5 * (dPar['ymin'] + dPar['ymax']) m = Basemap(llcrnrlon=dPar['xmin'], urcrnrlon=dPar['xmax'],
dt_map = 6. / 12 k = 200 YR = 2005, MO = 12, DY = 15, HR = 20, MN = 40, SC = 5, #--------------------------1--------------------------------------------- # load data #------------------------------------------------------------------------ #os.chdir( data_dir) # load seismicity and well data using loadtxt mSeis = np.loadtxt(file_eq).T #TODO: convert date-time to decimal year use seis_utils.dateTime2decYr aTime = seis_utils.dateTime2decYr(YR, MO, DY, HR, MN, SC) #print(aTime) mBeis = np.array(mSeis[1], dtype=object) mSeis = np.array([aTime, mSeis[7], mSeis[8], mSeis[-1]], dtype=object) mWells = np.loadtxt(file_well).T #print(mSeis) #print(mWells) #--------------------------2--------------------------------------------- # earthquake rates, cumulative number #------------------------------------------------------------------------ # plot rate and cumulative number of events if dPar['showRate'] == True: plt.figure(1) ax = plt.subplot(211) # compute seismicity rates using seis_utils.eqRate
# -----basemap params---------------------- 'xmin': -101, 'xmax': -94, 'ymin': 33.5, 'ymax': 37.1, 'projection': 'aea', # or 'cea' 'aea' for equal area projections } #--------------------------1--------------------------------------------- # load data #------------------------------------------------------------------------ os.chdir(data_dir) # load seismicity and well data using loadtxt mSeis = np.loadtxt(file_eq).T #:TODO data-time to decimal years aTime = seis_utils.dateTime2decYr(file_eq).T mSeis = np.array([aTime, mSeis[7], mSeis[8], mSeis[-1]]) #TODO: select most recent seismic events sel = np.logical_and(file_eq[1] >= 2017) mSeis = mSeis.T[sel].T mWells = np.loadtxt(file_well).T #--------------------------2--------------------------------------------- # map view, select boundaries of seismicity #------------------------------------------------------------------------ plt.figure(1) ax1 = plt.subplot(111) #:TODO plot wells Basemap.plot(mWells[2], mWells[3], 'ro') #:TODO plot seismicity Basemap.plot(mSeis[7], mSeis[8], 'bo')
'tmin' : 2011, 'areaOK' : 181*1e3,#in km # -----basemap params---------------------- 'xmin' : -101, 'xmax' : -94, 'ymin' : 33.5, 'ymax' : 37.1, 'projection' : 'aea',# or 'cea' 'aea' for equal area projections } #--------------------------1--------------------------------------------- # load data #------------------------------------------------------------------------ os.chdir( data_dir) # load seismicity and well data using loadtxt mSeis = np.loadtxt( file_eq).T #:TODO data-time to decimal years aTime = seis_utils.dateTime2decYr( mSeis[1], mSeis[2], mSeis[3], mSeis[4], mSeis[5], mSeis[6]) mSeis = np.array( [aTime, mSeis[7], mSeis[8], mSeis[-1]]) #TODO: select most recent seismic events sel = mSeis[0] >= dPar['tmin'] mSeis = mSeis.T[sel].T mWells = np.loadtxt( file_well).T #--------------------------2--------------------------------------------- # map view, select boundaries of seismicity #------------------------------------------------------------------------ plt.figure(1) ax1 = plt.subplot(111) #:TODO plot wells aX_we, aY_we = mWells[2], mWells[3] plot_we = plt.scatter( aX_we, aY_we, c = 'b', s = 1.0) #:TODO plot seismicity
os.chdir(data_dir) # load seismicity and well data using loadtxt mSeis = np.loadtxt(file_eq).T aTime = np.array([]) num_Events = len(file_eq) YR = mSeis[1] MO = mSeis[2] DAY = mSeis[3] HR = mSeis[4] MIN = mSeis[5] SEC = mSeis[6] #TODO: convert date-time to decimal year use seis_utils.dateTime2decYr aTime = seis_utils.dateTime2decYr(YR, MO, DAY, HR, MIN, SEC) mLoc_seis = np.array([aTime, mSeis[7], mSeis[8], mSeis[-1]]) mWells = np.loadtxt(file_well).T mLoc_wells = np.array([mWells[1], mWells[3], mWells[2]]) #--------------------------2--------------------------------------------- # earthquake rates, cumulative number #------------------------------------------------------------------------ # plot rate and cumulative number of events if dPar['showRate'] == True: plt.figure(1) ax1 = plt.subplot(211) # compute seismicity rates using seis_utils.eqRate aBin, aRates = seis_utils.eqRate(aTime, dPar.get('k')) #TODO: plot seismicity rates
'ymax': 37.1, 'projection': 'merc', # or 'aea' for equal area projections } #--------------------------1--------------------------------------------- # load data #------------------------------------------------------------------------ #os.chdir( data_dir) # load seismicity and well data using loadtxt mSeis = np.loadtxt(file_eq).T aTime = np.array([]) for n in range(0, len(mSeis[1])): aTime = np.append( aTime, seis_utils.dateTime2decYr(mSeis[1][n], mSeis[2][n], mSeis[3][n], mSeis[4][n], mSeis[5][n], mSeis[6][n])) mSeis = np.array([aTime, mSeis[7], mSeis[8], mSeis[-1]]) mWells = np.loadtxt(file_well).T #--------------------------2--------------------------------------------- # earthquake rates, cumulative number #------------------------------------------------------------------------ # plot rate and cumulative number of events if dPar['showRate'] == True: plt.figure(1) ax = plt.subplot(211) seisDataNorm = seis_utils.eqRate(mSeis, 6)
'xmax': -94, 'ymin': 33.5, 'ymax': 37.1, 'projection': 'merc', # or 'aea' for equal area projections } seism_OK_Data = np.loadtxt('seism_OK.txt').T Wells_OK_Data = np.loadtxt('injWell_OK.txt').T #--------------------------1--------------------------------------------- # load data #------------------------------------------------------------------------ mSeis = np.loadtxt(file_eq).T aTime = seis_utils.dateTime2decYr(seism_OK_Data[1], seism_OK_Data[2], seism_OK_Data[3], seism_OK_Data[4], seism_OK_Data[5], seism_OK_Data[6]) mSeis = np.array([aTime, mSeis[7], mSeis[8], mSeis[-1]]) mWells = np.loadtxt(file_well).T #--------------------------2--------------------------------------------- # earthquake rates, cumulative number #------------------------------------------------------------------------ if dPar['showRate'] == True: plt.figure(1, figsize=(12, 5)) ax = plt.subplot(211) # compute seismicity rates aBin, aRate = seis_utils.eqRate(aTime, 200) plot1 = plt.plot(aBin, aRate) ax.set_ylabel('Earthquake Rate [ev/mo]')