1313
1414def detect_plates_vzcheck (step , vz_thres_ratio = 0 ):
1515 """Detect plates and check with vz and plate size."""
16- v_z = step .fields ['v3' ][0 , :- 1 , :, 0 ]
17- v_x = step .fields ['v2' ][0 , :, :, 0 ]
18- tcell = step .fields ['T' ][0 , :, :, 0 ]
16+ v_z = step .fields ['v3' ]. values [0 , :- 1 , :, 0 ]
17+ v_x = step .fields ['v2' ]. values [0 , :, :, 0 ]
18+ tcell = step .fields ['T' ]. values [0 , :, :, 0 ]
1919 n_z = step .geom .nztot
2020 nphi = step .geom .nptot
2121 r_c = step .geom .r_centers
@@ -68,7 +68,7 @@ def detect_plates_vzcheck(step, vz_thres_ratio=0):
6868
6969def detect_plates (step , vrms_surface , fids , time ):
7070 """Detect plates using derivative of horizontal velocity."""
71- vphi = step .fields ['v2' ][0 , :, :, 0 ]
71+ vphi = step .fields ['v2' ]. values [0 , :, :, 0 ]
7272 ph_coord = step .geom .p_centers
7373
7474 if step .sdat .par ['boundaries' ]['air_layer' ]:
@@ -123,7 +123,7 @@ def detect_plates(step, vrms_surface, fids, time):
123123
124124 dv_ridge = dvph2 [arggreat_dv ]
125125 if 'age' in conf .plates .plot :
126- agefld = step .fields ['age' ][0 , :, :, 0 ]
126+ agefld = step .fields ['age' ]. values [0 , :, :, 0 ]
127127 age_surface = np .ma .masked_where (agefld [:, indsurf ] < 0.00001 ,
128128 agefld [:, indsurf ])
129129 age_surface_dim = age_surface * vrms_surface * \
@@ -180,9 +180,9 @@ def plot_plate_limits_field(axis, rcmb, ridges, trenches):
180180def plot_plates (step , time , vrms_surface , trench , ridge , agetrench ,
181181 topo , fids ):
182182 """Handle plotting stuff."""
183- vphi = step .fields ['v2' ][0 , :, :, 0 ]
184- tempfld = step .fields ['T' ][0 , :, :, 0 ]
185- concfld = step .fields ['c' ][0 , :, :, 0 ]
183+ vphi = step .fields ['v2' ]. values [0 , :, :, 0 ]
184+ tempfld = step .fields ['T' ]. values [0 , :, :, 0 ]
185+ concfld = step .fields ['c' ]. values [0 , :, :, 0 ]
186186 timestep = step .isnap
187187
188188 if step .sdat .par ['boundaries' ]['air_layer' ]:
@@ -296,7 +296,7 @@ def plot_plates(step, time, vrms_surface, trench, ridge, agetrench,
296296
297297 # plotting velocity and second invariant of stress
298298 if 'str' in conf .plates .plot :
299- stressfld = step .fields ['sII' ][0 , :, :, 0 ]
299+ stressfld = step .fields ['sII' ]. values [0 , :, :, 0 ]
300300 fig0 , (ax1 , ax2 ) = plt .subplots (2 , 1 , sharex = True , figsize = (12 , 8 ))
301301 ax1 .plot (step .geom .p_walls , vphi [:, indsurf ], label = 'Vel' )
302302 ax1 .axhline (y = 0 , xmin = 0 , xmax = 2 * np .pi ,
@@ -344,7 +344,7 @@ def plot_plates(step, time, vrms_surface, trench, ridge, agetrench,
344344
345345 # plotting velocity and age at surface
346346 if 'age' in conf .plates .plot :
347- agefld = step .fields ['age' ][0 , :, :, 0 ]
347+ agefld = step .fields ['age' ]. values [0 , :, :, 0 ]
348348 age_surface = np .ma .masked_where (
349349 agefld [:, indsurf ] < 0.00001 , agefld [:, indsurf ])
350350 age_surface_dim = (age_surface * vrms_surface * conf .scaling .ttransit /
@@ -467,7 +467,7 @@ def lithospheric_stress(step, trench, ridge, time):
467467 timestep = step .isnap
468468 base_lith = step .geom .rcmb + 1 - 0.105
469469
470- stressfld = step .fields ['sII' ][0 , :, :, 0 ]
470+ stressfld = step .fields ['sII' ]. values [0 , :, :, 0 ]
471471 r_centers = np .outer (np .ones (stressfld .shape [0 ]), step .geom .r_centers )
472472 stressfld = np .ma .masked_where (r_centers < base_lith , stressfld )
473473
@@ -485,10 +485,10 @@ def lithospheric_stress(step, trench, ridge, time):
485485 saveplot (fig , 'lith' , timestep )
486486
487487 # velocity
488- vphi = step .fields ['v2' ][0 , :, :, 0 ]
488+ vphi = step .fields ['v2' ]. values [0 , :, :, 0 ]
489489
490490 # position of continents
491- concfld = step .fields ['c' ][0 , :, :, 0 ]
491+ concfld = step .fields ['c' ]. values [0 , :, :, 0 ]
492492 if step .sdat .par ['boundaries' ]['air_layer' ]:
493493 # we are a bit below the surface; delete "-some number"
494494 # to be just below
@@ -612,12 +612,12 @@ def main_plates(sdat):
612612 agetrenches , topo , fids )
613613
614614 # prepare for continent plotting
615- concfld = step .fields ['c' ][0 , :, :, 0 ]
615+ concfld = step .fields ['c' ]. values [0 , :, :, 0 ]
616616 continentsfld = np .ma .masked_where (
617617 concfld < 3 , concfld ) # plotting continents, to-do
618618 continentsfld = continentsfld / continentsfld
619619
620- temp = step .fields ['T' ][0 , :, :, 0 ]
620+ temp = step .fields ['T' ]. values [0 , :, :, 0 ]
621621 tgrad = (temp [:, isurf - 1 ] - temp [:, isurf ]) / \
622622 (step .geom .r_centers [isurf ] - step .geom .r_centers [isurf - 1 ])
623623
@@ -626,7 +626,7 @@ def main_plates(sdat):
626626 io_surface (timestep , time , fids [4 ], topo [:, 1 ])
627627 if 'age' in conf .plates .plot :
628628 io_surface (timestep , time , fids [5 ],
629- step .fields ['age' ][0 , :, isurf , 0 ])
629+ step .fields ['age' ]. values [0 , :, isurf , 0 ])
630630
631631 # plot viscosity field with position of trenches and ridges
632632 etamin , _ = sdat .scale (1e-2 , 'Pa' )
0 commit comments