Skip to content

Commit 59ea1c2

Browse files
committed
Option to plot stress vector on field plates plot
1 parent a453d5a commit 59ea1c2

File tree

3 files changed

+4
-30
lines changed

3 files changed

+4
-30
lines changed

stagpy/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ def _index_collection(arg):
185185
('field',
186186
Conf('eta', True, None, {},
187187
True, 'field variable to plot with plates info')),
188+
('stress', switch_opt(
189+
False, None,
190+
'Plot deviatoric stress instead of velocity on field plots')),
188191
('vzcheck', switch_opt(False, None,
189192
'activate Colin\'s version with vz checking')),
190193
('timeprofile', switch_opt(False, None,

stagpy/phyvars.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@
269269
('sc', Varp('Topography')),
270270
('age', Varp('Age')),
271271
('str', Varp('Stress')),
272-
('sx', Varp('Principal deviatoric stress')),
273272
('ed', Varp('Strain rate')),
274273
))
275274

stagpy/plates.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ def plot_scalar_field(step, fieldname, ridges, trenches):
574574
conf.field.colorbar = cbar
575575

576576
# plotting velocity vectors
577-
field.plot_vec(axis, step, 'v')
577+
field.plot_vec(axis, step, 'sx' if conf.plates.stress else 'v')
578578

579579
# Put arrow where ridges and trenches are
580580
plot_plate_limits_field(axis, step.geom.rcmb, ridges, trenches)
@@ -673,34 +673,6 @@ def main_plates(sdat):
673673
# calculate stresses in the lithosphere
674674
lithospheric_stress(step, trenches, ridges, time)
675675

676-
# plotting the principal deviatoric stress field
677-
if 'sx' in conf.plates.plot:
678-
fig, axis, _, _ = field.plot_scalar(step, 'sII',
679-
alpha=0.1)
680-
681-
# plotting continents
682-
cbar = conf.field.colorbar
683-
conf.field.colorbar = False
684-
field.plot_scalar(step, 'c', continentsfld, axis,
685-
cmap='cool_r', vmin=0, vmax=0)
686-
cmap2 = plt.cm.ocean
687-
cmap2.set_over('m')
688-
conf.field.colorbar = cbar
689-
690-
# plotting principal deviatoric stress
691-
field.plot_vec(axis, step, 'sx')
692-
693-
# Annotation with time and step
694-
axis.text(1., 0.9, str(round(time, 0)) + ' My',
695-
transform=axis.transAxes)
696-
axis.text(1., 0.1, str(timestep),
697-
transform=axis.transAxes)
698-
699-
# Put arrow where ridges and trenches are
700-
plot_plate_limits_field(axis, rcmb, ridges, trenches)
701-
702-
saveplot(fig, 'sx', timestep)
703-
704676

705677
def cmd():
706678
"""Implementation of plates subcommand.

0 commit comments

Comments
 (0)