simviz.py¶
SimulationViz
¶
flowchart TD
erosionfront.visualization.simviz.SimulationViz[SimulationViz]
erosionfront.visualization.base.GraphingBase[GraphingBase]
erosionfront.visualization.base.GraphingBase --> erosionfront.visualization.simviz.SimulationViz
click erosionfront.visualization.simviz.SimulationViz href "" "erosionfront.visualization.simviz.SimulationViz"
click erosionfront.visualization.base.GraphingBase href "" "erosionfront.visualization.base.GraphingBase"
XXXX
Parameters¶
XXX
Attributes¶
TBD
Returns¶
XXX
Methods:
-
create_figure–Initialize a :mod:
Pyplot <matplotlib.pyplot>figure. -
get_aspect–Get aspect ratio of graph.
-
get_fonts–Fetch the names of all the font families available on the system.
-
naturalize–Adjust graph aspect ratio into 'natural' ratio.
-
plot_front_segment–Plot near-base cut of final time slice surface & regression fit.
-
plot_initial_surface–Plot initial surface x-z curve.
-
plot_retreat_speed–Plot estimated horizontal retreat speed vs time T.
-
plot_shocks–Plot near-base cut of final time slice surface & regression fit.
-
plot_time_slices–Plot selection of front-propagation time T(x,z) slices.
-
plot_φ–Image grid of phi function (could be signed distance, β, ξ, etc).
-
stretch–Stretch graph axes by respective factors.
Source code in erosionfront/visualization/base.py
create_figure
¶
create_figure(
fig_name: str, fig_size: tuple[float, float] | None = None, dpi: int | None = None
) -> Figure
Initialize a :mod:Pyplot <matplotlib.pyplot> figure.
Set its size and dpi, set the font size, choose the Arial font family if possible, and append it to the figures dictionary.
Parameters¶
fig_name: name of figure; used as key in figures dictionary fig_size: optional width and height of figure in inches dpi: rasterization resolution
Returns¶
:obj:Pyplot figure <matplotlib.figure.Figure>:
reference to :mod:MatPlotLib/Pyplot <matplotlib.pyplot>
figure
Source code in erosionfront/visualization/base.py
get_aspect
¶
get_aspect(axes: Axes) -> float
Get aspect ratio of graph.
Parameters¶
axes:
the axes object of the figure
Returns¶
float: aspect ratio
Source code in erosionfront/visualization/base.py
get_fonts
¶
Fetch the names of all the font families available on the system.
Source code in erosionfront/visualization/base.py
naturalize
¶
Adjust graph aspect ratio into 'natural' ratio.
Source code in erosionfront/visualization/base.py
plot_front_segment
¶
plot_front_segment(
fig_name: str,
sim: LevelSetSolver,
z_range: tuple[float, float] = (0.1, 0.4),
title_font_size: int = 11,
fig_size: tuple[float, float] = (5, 5),
) -> None
Plot near-base cut of final time slice surface & regression fit.
Parameters¶
fig_name: str sim: LevelSetSolver z_range: tuple[float, float]=(0.1, 0.4,) title_font_size: int=12 fig_size: tuple[float, float]=(5, 5,)
Attributes¶
Uses create_figure (adds to fig dict).
Source code in erosionfront/visualization/simviz.py
plot_initial_surface
¶
plot_initial_surface(
fig_name: str,
initial_surface: (
StraightLineSurface
| ErrorFunctionSurface
| SemiCircularArcSurface
| QuarterCircularArcSurface
),
gma: GeometricMechanicsAnalysis | None = None,
title_font_size: int = 12,
fig_size: tuple[float, float] = (7, 5),
) -> None
Plot initial surface x-z curve.
Parameters¶
fig_name: str initial_surface: ErrorFunctionSurface | StraightLineSurface title_font_size: int=12 fig_size: tuple[float, float]=(7, 5,)
Attributes¶
Uses create_figure (adds to fig dict).
Source code in erosionfront/visualization/simviz.py
plot_retreat_speed
¶
plot_retreat_speed(
fig_name: str,
sim: LevelSetSolver,
z_levels: tuple = (0.8, 0.4, 0.2),
z_limits: tuple[float, float] = (0.8, 3),
title_font_size: int = 11,
fig_size: tuple[float, float] = (7, 3),
) -> Sequence
Plot estimated horizontal retreat speed vs time T.
Parameters¶
fig_name: str sim: LevelSetSolver z_levels: tuple=(0.8, 0.4, 0.2,) z_limits: tuple[float, float]=(0.8, 3,) title_font_size: int=12 fig_size: tuple[float, float]=(7, 3,)
Attributes¶
Uses create_figure (adds to fig dict).
Source code in erosionfront/visualization/simviz.py
plot_shocks
¶
plot_shocks(
fig_name: str,
sim: LevelSetSolver,
title_font_size: int = 11,
fig_size: tuple[float, float] = (6, 6),
) -> None
Plot near-base cut of final time slice surface & regression fit.
Parameters¶
fig_name: str sim: LevelSetSolver z_range: tuple[float, float]=(0.1, 0.4,) title_font_size: int=12 fig_size: tuple[float, float]=(5, 5,)
Attributes¶
Uses create_figure (adds to fig dict).
Source code in erosionfront/visualization/simviz.py
plot_time_slices
¶
plot_time_slices(
fig_name: str,
sim: LevelSetSolver,
x_limits: tuple[float | None, float | None] | None = None,
z_min: float | None = -0.05,
z_max: float | None = 1.05,
pc_slicing: float = 10,
pc_labeling: float = 20,
title_font_size: int = 11,
legend_font_size: int = 9,
fig_size: tuple[float, float] = (7, 5),
) -> None
Plot selection of front-propagation time T(x,z) slices.
Parameters¶
fig_name: str Name used as key in figure dictionary. sim: LevelSetSolver Instance of level-set solver providing solution data. x_limits: tuple[float|None, float|None] | None = None Min/max x coordinates on graph. z_min: float | None=-0.05 Minimum z coordinate on graph. z_max: float | None=1.05 Maximum z coordinate on graph. pc_slicing: float = 10 Period of slice plotting as percentage of total number of steps. pc_labeling: float = 20 Period of slice labeling as percentage of total number of steps. title_font_size: int=11 Size of title text. legend_font_size: int=9 Size of legend text. fig_size: tuple[float, float]=(7, 5,) Figure size (in inches!).
Attributes¶
Uses create_figure (adds to fig dict).
Source code in erosionfront/visualization/simviz.py
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | |
plot_φ
¶
plot_φ(
fig_name: str,
sim: LevelSetSolver,
do_φ: bool = False,
do_φ_everywhere: bool = False,
do_φ_next: bool = False,
do_dφdx: bool = False,
do_dφdz: bool = False,
do_dTdx: bool = False,
do_dTdz: bool = False,
do_beta: bool = False,
do_speed: bool = False,
do_aux: bool = False,
do_ξ0: bool = False,
do_arrival_time: bool = False,
do_fix_ticks: bool = False,
cbar_ticks: NDArray | None = None,
clip: tuple[float, float] = (-0.2, 0.2),
title_font_size: int = 11,
fig_size: tuple[float, float] = (8, 6),
) -> None
Image grid of phi function (could be signed distance, β, ξ, etc).
Parameters¶
fig_name: str sim: LevelSetSolver title_font_size: int=12 do_φ: bool=False do_φ_everywhere: bool=False do_φ_next: bool=False do_dTdx: bool=False do_dTdz: bool=False do_beta: bool=False do_speed: bool=False do_travel_time: bool=False do_arrival_time: bool=False do_fix_ticks: bool=False cbar_ticks: NDArray | None=None clip: tuple[float, float]=(-0.2, 0.2,) fig_size: tuple[float, float]=(8, 6,)
Attributes¶
Uses create_figure (adds to fig dict).
Source code in erosionfront/visualization/simviz.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
stretch
¶
stretch(
fig: Figure,
xs: tuple[float, float] | None = None,
ys: tuple[float, float] | None = None,
) -> None
Stretch graph axes by respective factors.