@@ -560,18 +560,18 @@ def plot_scalar_field(step, fieldname, ridges, trenches):
560560 """Plot scalar field with plate information."""
561561 fig , axis , _ , _ = field .plot_scalar (step , fieldname )
562562
563- # plotting continents
564- concfld = step .fields ['c' ].values [0 , :, :, 0 ]
565- continentsfld = np .ma .masked_where (
566- concfld < 3 , concfld ) # plotting continents, to-do
567- continentsfld = continentsfld / continentsfld
568- cbar = conf .field .colorbar
569- conf .field .colorbar = False
570- field .plot_scalar (step , 'c' , continentsfld , axis ,
571- cmap = 'cool_r' , vmin = 0 , vmax = 0 )
572- cmap2 = plt .cm .ocean
573- cmap2 .set_over ('m' )
574- conf .field .colorbar = cbar
563+ if conf . plates . continents :
564+ concfld = step .fields ['c' ].values [0 , :, :, 0 ]
565+ continentsfld = np .ma .masked_where (
566+ concfld < 3 , concfld ) # plotting continents, to-do
567+ continentsfld = continentsfld / continentsfld
568+ cbar = conf .field .colorbar
569+ conf .field .colorbar = False
570+ field .plot_scalar (step , 'c' , continentsfld , axis ,
571+ cmap = 'cool_r' , vmin = 0 , vmax = 0 )
572+ cmap2 = plt .cm .ocean
573+ cmap2 .set_over ('m' )
574+ conf .field .colorbar = cbar
575575
576576 # plotting velocity vectors
577577 field .plot_vec (axis , step , 'sx' if conf .plates .stress else 'v' )
@@ -630,7 +630,6 @@ def main_plates(sdat):
630630 timestep = step .isnap
631631 print ('Treating snapshot' , timestep )
632632
633- rcmb = step .geom .rcmb
634633 # topography
635634 fname = sdat .filename ('sc' , timestep = timestep , suffix = '.dat' )
636635 topo = np .genfromtxt (str (fname ))
@@ -648,31 +647,6 @@ def main_plates(sdat):
648647 # plot scalar field with position of trenches and ridges
649648 plot_scalar_field (step , conf .plates .field , ridges , trenches )
650649
651- # plot stress field with position of trenches and ridges
652- if 'str' in conf .plates .plot :
653- fig , axis , _ , _ = field .plot_scalar (step , 'sII' ,
654- vmin = 0 , vmax = 300 )
655-
656- # Annotation with time and step
657- axis .text (1. , 0.9 , str (round (time , 0 )) + ' My' ,
658- transform = axis .transAxes )
659- axis .text (1. , 0.1 , str (timestep ),
660- transform = axis .transAxes )
661-
662- # Put arrow where ridges and trenches are
663- plot_plate_limits_field (axis , rcmb , ridges , trenches )
664-
665- saveplot (fig , 's' , timestep , close = conf .plates .zoom is None )
666-
667- # Zoom
668- if conf .plates .zoom is not None :
669- axis .set_xlim (xzoom - ladd , xzoom + radd )
670- axis .set_ylim (yzoom - dadd , yzoom + uadd )
671- saveplot (fig , 'szoom' , timestep )
672-
673- # calculate stresses in the lithosphere
674- lithospheric_stress (step , trenches , ridges , time )
675-
676650
677651def cmd ():
678652 """Implementation of plates subcommand.
0 commit comments