Skip to content

Commit 2ff29be

Browse files
committed
update
1 parent 908a51c commit 2ff29be

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Exec/science/xrb_spherical/analysis/slice.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
def slice(fnames:List[str], fields:List[str],
1616
loc: str = "top", widthScale: float = 3.0,
17-
dr: Optional: float = 0.15,
17+
dr: Optional[float] = None,
1818
theta: Optional[float] = None) -> None:
1919
"""
2020
A slice plot of the datasets for different field parameters for Spherical2D geometry.
@@ -58,9 +58,14 @@ def slice(fnames:List[str], fields:List[str],
5858
# Process information for each dataset
5959

6060
# Some geometry properties
61-
rr = ds.domain_right_edge[0].in_units("km")
6261
rl = ds.domain_left_edge[0].in_units("km")
63-
dr = dr * rr.units
62+
if dr is None:
63+
rr = ds.domain_right_edge[0].in_units("km")
64+
dr = rr - rl
65+
else:
66+
dr = dr * rl.units
67+
rr = rl + dr
68+
6469
r_center = 0.5 * dr + rl
6570

6671
thetar = ds.domain_right_edge[1]
@@ -122,7 +127,8 @@ def slice(fnames:List[str], fields:List[str],
122127
[rr*np.sin(theta), rr*np.cos(theta)],
123128
coord_system="plot",
124129
color="k",
125-
linestyle="--")
130+
linewidth=1.5,
131+
linestyle="-.")
126132

127133
plot = sp.plots[field]
128134
plot.figure = fig
@@ -181,7 +187,7 @@ def slice(fnames:List[str], fields:List[str],
181187
parser.add_argument('-t', '--theta', type=float,
182188
help="""user defined theta center location of the plot domain.
183189
Alternative way of defining plotting center""")
184-
parser.add_argument('-r', '--dr', default=0.15, type=float,
190+
parser.add_argument('-r', '--dr', type=float,
185191
help="""Distance between upper r and lower r shown in the SlicePlot.
186192
Assumed in unit km. This is used to control center and width of the SlicePlot""")
187193
parser.add_argument('-w', '--width', default=4.0, type=float,

Exec/science/xrb_spherical/analysis/slice_sequence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
help="field parameters for plotting, e.g. enuc abar.")
1919
parser.add_argument('-w', '--width', default=4.0, type=float,
2020
help="scaling for the domain width of the slice plot")
21-
parser.add_argument('-r', '--dr', default=0.15, type=float,
21+
parser.add_argument('-r', '--dr', type=float,
2222
help="""Distance between upper r and lower r shown in the SlicePlot.
2323
Assumed in unit km. This is used to control center and width of the SlicePlot""")
2424
parser.add_argument('--jobs', '-j', default=1, type=int,

0 commit comments

Comments
 (0)