Skip to content

Commit

Permalink
cosmetic changes to spash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
AlainPlattner committed Mar 15, 2023
1 parent 86ba148 commit 5abab57
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 76 deletions.
24 changes: 12 additions & 12 deletions gprpy/gprpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def prepProfileFig(self, color="gray", contrast=1.0, yrng=None, xrng=None, asp=N
max(self.twtt)+dt/2.0,
min(self.twtt)-dt/2.0],
aspect="auto",vmin=-stdcont/contrast, vmax=stdcont/contrast)
plt.gca().set_ylabel("two-way travel time [ns]")
plt.gca().set_ylabel("time [ns]")
plt.gca().invert_yaxis()
if yrng is not None:
yrng=[np.max(yrng),np.min(yrng)]
Expand Down Expand Up @@ -452,7 +452,7 @@ def flipProfile(self):
def alignTraces(self):
'''
Aligns the traces in the profile such that their maximum
amplitudes align at the average two-way travel time of the
amplitudes align at the average travel time of the
maximum amplitudes.
'''
# Store previous state for undo
Expand Down Expand Up @@ -1061,10 +1061,10 @@ def normalize(self):

def linStackedAmplitude(self,vmin=0.01,vmax=0.35,vint=0.01):
'''
Calculates the linear stacked amplitudes for each two-way
Calculates the linear stacked amplitudes for each
travel time sample and the provided velocity range
by summing the pixels of the data that follow a line given
by the two-way travel time zero offset and the velocity.
by the travel time zero offset and the velocity.
INPUT:
vmin minimal velocity for which to calculate the
Expand All @@ -1089,10 +1089,10 @@ def linStackedAmplitude(self,vmin=0.01,vmax=0.35,vint=0.01):

def hypStackedAmplitude(self,vmin=0.01,vmax=0.35,vint=0.01):
'''
Calculates the hyperbolic stacked amplitudes for each two-way
Calculates the hyperbolic stacked amplitudes for each
travel time sample and the provided velocity range
by summing the pixels of the data that follow a hyperbola given
by the two-way travel time apex and the velocity.
by the travel time apex and the velocity.
INPUT:
vmin minimal velocity for which to calculate the
Expand All @@ -1117,11 +1117,11 @@ def hypStackedAmplitude(self,vmin=0.01,vmax=0.35,vint=0.01):

def addLin(self,zerotwtt,vel):
'''
Adds an observed line given by its zero-offset two-way travel
Adds an observed line given by its zero-offset travel
time and velocity to the list of lines.
INPUT:
zerotwtt the zero-offset two-way travel time (intercept)
zerotwtt the zero-offset travel time (intercept)
of the observed line
vel the velocity (inverse slope) of the observed line
'''
Expand All @@ -1135,11 +1135,11 @@ def addLin(self,zerotwtt,vel):

def addHyp(self,zerotwtt,vel):
'''
Adds an observed hyperbola given by its apex two-way
Adds an observed hyperbola given by its apex
travel time and velocity to the list of lines.
INPUT:
zerotwtt the apex two-way travel time of the observed line
zerotwtt the apex travel time of the observed line
vel the velocity of the observed line
'''
# Store previous state for undo
Expand Down Expand Up @@ -1208,7 +1208,7 @@ def prepCWFig(self, contrast=1.0, color="gray", yrng=None, xrng=None, showlnhp=F
max(self.twtt)+dt/2.0,
min(self.twtt)-dt/2.0],
aspect="auto",vmin=-stdcont/contrast, vmax=stdcont/contrast)
plt.gca().set_ylabel("two-way travel time [ns]")
plt.gca().set_ylabel("time [ns]")
plt.gca().invert_yaxis()
if yrng is not None:
yrng=[np.max(yrng),np.min(yrng)]
Expand Down Expand Up @@ -1302,7 +1302,7 @@ def prepStAmpFig(self, whichstamp="lin", saturation=1.0, yrng=None, vrng=None):


plt.gca().set_xlabel("velocity [m/ns]")
plt.gca().set_ylabel("two-way travel time [ns]")
plt.gca().set_ylabel("time [ns]")
#plt.gca().invert_yaxis()
plt.gca().set_title(title)
plt.gca().get_xaxis().set_visible(True)
Expand Down
54 changes: 26 additions & 28 deletions gprpy/gprpyCWGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ def __init__(self,master):
adata.set_title('data')
adata.get_yaxis().tick_right()
adata.get_yaxis().set_label_position('right')
adata.set_ylabel('two-way travel time [ns]', fontsize=mpl.rcParams['font.size'])
adata.set_ylabel('time [ns]', fontsize=mpl.rcParams['font.size'])

alin.set_title('linear stacked amplitude')
ahyp.set_title('hyperbolic stacked amplitude')
ahyp.set_ylabel('two-way travel time [ns]', fontsize=mpl.rcParams['font.size'])
ahyp.set_ylabel('time [ns]', fontsize=mpl.rcParams['font.size'])

canvas = FigureCanvasTkAgg(fig, master=self.window)
canvas.get_tk_widget().grid(row=2,column=0,columnspan=rightcol,rowspan=figrowsp,sticky='nsew')
Expand Down Expand Up @@ -108,8 +108,8 @@ def __init__(self,master):
SetZeroTimeButton.config(height = 1, width = 2*halfwid)
SetZeroTimeButton.grid(row=3, column=rightcol, sticky='nsew',columnspan=colsp)
self.balloon.bind(SetZeroTimeButton,
"Set the two-way travel time that \n"
"that corresponds to the surface.")
"Set the travel time that \n"
"corresponds to the surface.")

# truncate Y
truncYButton = tk.Button(
Expand Down Expand Up @@ -170,7 +170,7 @@ def __init__(self,master):
NormalizeButton.grid(row=8, column=rightcol, sticky='nsew',columnspan=colsp)
self.balloon.bind(NormalizeButton,
"Normalizes each trace such that\n"
"they all have equal energy")
"they all have equal energy.")


# Gain
Expand All @@ -182,8 +182,8 @@ def __init__(self,master):
tpowButton.grid(row=9, column=rightcol, sticky='nsew')
self.balloon.bind(tpowButton,
"t-power gain. Increases the power of the\n"
"signal by a factor of (two-way travel time)^p,\n"
"where the user provides p. This gain is often\n"
"signal by a factor of (travel time)^p, where\n"
"the user provides p. This gain is typically\n"
"less aggressive than agc.")


Expand All @@ -209,8 +209,8 @@ def __init__(self,master):
LinStAmpButton.grid(row=10, column=rightcol, sticky='nsew',columnspan=colsp)
self.balloon.bind(LinStAmpButton,
"Calculate the linear stacked amplitude for\n"
"the selected velocity ranges and two-way\n"
"travel times.")
"the selected velocity ranges and travel\n"
"times.")

# Hyp Stacked Amplitude
HypStAmpButton = tk.Button(
Expand All @@ -219,13 +219,12 @@ def __init__(self,master):
self.plotStAmp(proj,a=ahyp,canvas=canvas,
stamp=proj.hypStAmp,
title='hyperbolic stacked amplitude',
ylabel='two-way travel time [ns]')])
ylabel='time [ns]')])
HypStAmpButton.config(height = 1, width = 2*halfwid)
HypStAmpButton.grid(row=11, column=rightcol, sticky='nsew',columnspan=colsp)
self.balloon.bind(HypStAmpButton,
"Calculate the hyperbolic stacked amplitude for\n"
"the selected velocity ranges and two-way travel\n"
"times.")
"the selected velocity ranges and travel times.")

# Add line on top of data
AddLinButton = tk.Button(
Expand All @@ -236,8 +235,8 @@ def __init__(self,master):
AddLinButton.grid(row=12,column=rightcol, sticky='nsew')
self.balloon.bind(AddLinButton,
"Draw line with chosen velocity\n"
"and intercept two-way travel time \n"
"on top of data.")
"and intercepttravel time on top \n"
"of data.")

# Draw hyperbola on top of data
AddHypButton = tk.Button(
Expand All @@ -248,8 +247,7 @@ def __init__(self,master):
AddHypButton.grid(row=12,column=rightcol+1, sticky='nsew')
self.balloon.bind(AddHypButton,
"Draw hyperbola with chosen velocity\n"
"and apex two-way travel time \n"
"on top of data.")
"and apex travel time on top of data.")

# Remove most recent line
RemLinButton = tk.Button(
Expand All @@ -260,7 +258,7 @@ def __init__(self,master):
RemLinButton.grid(row=13,column=rightcol, sticky='nsew')
self.balloon.bind(RemLinButton,
"Remove the most recently drawn\n"
"line from data")
"line from data.")

# Remove most recent hyperbola
RemHypButton = tk.Button(
Expand All @@ -271,7 +269,7 @@ def __init__(self,master):
RemHypButton.grid(row=13,column=rightcol+1, sticky='nsew')
self.balloon.bind(RemHypButton,
"Remove the most recently drawn\n"
"hyperbola from data")
"hyperbola from data.")

# Show ln hp toggle
ShowLnHpButton = tk.Button(
Expand All @@ -282,7 +280,7 @@ def __init__(self,master):
ShowLnHpButton.grid(row=14,column=rightcol, sticky='nsew',columnspan=colsp)
self.balloon.bind(ShowLnHpButton,
"Toggle on/off showing the\n"
"drawn lines / hyperbolae")
"drawn lines / hyperbolae.")

# Print figure
PrintFigButton = tk.Button(
Expand All @@ -304,7 +302,7 @@ def __init__(self,master):
HistButton.grid(row=16, column=rightcol, sticky='nsew',columnspan=colsp)
self.balloon.bind(HistButton,
'Writes a python script to reproduce the current \n'
'status as a\n'
'status.\n'
'\n'
'If the current data is from a .gpr file, \n'
'then the python script will contain all \n'
Expand Down Expand Up @@ -345,7 +343,7 @@ def __init__(self,master):
title='linear stacked amplitude'),
self.plotStAmp(proj,a=ahyp,canvas=canvas,stamp=proj.hypStAmp,
title='hyperbolic stacked amplitude',
ylabel='two-way travel time [ns]')])
ylabel='time [ns]')])
FullButton.config(height = 1, width = 2*halfwid)
FullButton.grid(row=0, column=1, sticky='nsew',rowspan=2)
self.balloon.bind(FullButton,"Resets x- and y-axis limits to full data.")
Expand Down Expand Up @@ -392,7 +390,7 @@ def __init__(self,master):
stamp=proj.linStAmp,title='linear stacked amplitude'),
self.plotStAmp(proj,a=ahyp,canvas=canvas,stamp=proj.hypStAmp,
title='hyperbolic stacked amplitude',
ylabel='two-way travel time [ns]')])
ylabel='time [ns]')])
YrngButton.config(height = 1, width = 2*halfwid)
YrngButton.grid(row=0, column=5, sticky='nsew',rowspan=2)
self.balloon.bind(YrngButton,"Set the y-axis display limits.")
Expand All @@ -418,7 +416,7 @@ def __init__(self,master):
colswitch.grid(row=0, column=7, sticky='nsew',rowspan=2)
self.balloon.bind(colswitch,
"Choose between gray-scale\n"
"and red-white-blue (rwb)\n"
"and blue-white-red (bwr)\n"
"data representation.")


Expand All @@ -431,7 +429,7 @@ def __init__(self,master):
stamp=proj.linStAmp,title='linear stacked amplitude'),
self.plotStAmp(proj,a=ahyp,canvas=canvas,stamp=proj.hypStAmp,
title='hyperbolic stacked amplitude',
ylabel='two-way travel time [ns]')])
ylabel='time [ns]')])
plotButton.config(height = 1, width = 2*halfwid)
plotButton.grid(row=0, column=8, sticky='nsew',rowspan=2)
self.balloon.bind(plotButton,
Expand Down Expand Up @@ -513,7 +511,7 @@ def plotCWData(self,proj,a,canvas):
elif self.dtype == "CMP":
a.set_xlabel("distance from midpoint [m]", fontsize=mpl.rcParams['font.size'])
a.set_title('data')
a.set_ylabel('two-way travel time [ns]', fontsize=mpl.rcParams['font.size'])
a.set_ylabel('time [ns]', fontsize=mpl.rcParams['font.size'])
a.get_xaxis().set_ticks_position('both')
a.get_yaxis().set_ticks_position('both')
# If we have any hyperbolae or lines, we need to plot them too:
Expand Down Expand Up @@ -630,7 +628,7 @@ def setZeroTime(self,proj):


def truncateY(self,proj):
maxY = sd.askfloat("Input","Maximum two-way travel time?")
maxY = sd.askfloat("Input","Maximum travel time?")
if maxY is not None:
proj.truncateY(maxY)

Expand Down Expand Up @@ -676,7 +674,7 @@ def addLin(self,proj):
self.showlnhp = True
vel = sd.askfloat("Input","Velocity?")
if vel is not None:
zerotwtt = sd.askfloat("Input","Zero two-way travel time?")
zerotwtt = sd.askfloat("Input","Zero travel time?")
if zerotwtt is not None:
proj.addLin(zerotwtt=zerotwtt,vel=vel)

Expand All @@ -685,7 +683,7 @@ def addHyp(self,proj):
self.showlnhp = True
vel = sd.askfloat("Input","Velocity?")
if vel is not None:
zerotwtt = sd.askfloat("Input","Zero two-way travel time?")
zerotwtt = sd.askfloat("Input","Zero travel time?")
if zerotwtt is not None:
proj.addHyp(zerotwtt=zerotwtt,vel=vel)

Expand Down
Loading

0 comments on commit 5abab57

Please sign in to comment.