Skip to content

Commit c325173

Browse files
committed
Fixed problematic scape sequences.
1 parent 3229141 commit c325173

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/astrohack/cassegrain_ray_tracing.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,21 +364,22 @@ def plot_radial_projection_from_rt_xds(
364364
horn_inter = horn_intercepts[ipnt]
365365
incoming = incoming_light[ipnt]
366366

367+
inf_str = "\u221e"
367368
# Plot incident light
368369
origin = pr_pnt - inf * incoming
369-
add_rz_ray_to_plot(ax, origin, pr_pnt, 'yellow', '-', '$\infty$->Pr', sign)
370+
add_rz_ray_to_plot(ax, origin, pr_pnt, 'yellow', '-', f'{inf_str}->Pr', sign)
370371

371372
# Plot primary reflection
372373
if np.all(np.isnan(sc_pnt)): # Ray does not touch secondary
373374
dest = pr_pnt + inf * pr_ref
374-
add_rz_ray_to_plot(ax, pr_pnt, dest, 'red', '--', 'Pr->$\infty$', sign)
375+
add_rz_ray_to_plot(ax, pr_pnt, dest, 'red', '--', f'Pr->{inf_str}', sign)
375376
else:
376377
add_rz_ray_to_plot(ax, pr_pnt, sc_pnt, 'yellow', '--', 'Pr->Sc', sign)
377378

378379
# Plot secondary reflection
379380
if np.all(np.isnan(horn_inter)): # Ray does not touch horn
380381
dest = sc_pnt + inf * sc_ref
381-
add_rz_ray_to_plot(ax, sc_pnt, dest, 'red', '-.', 'sc->$\infty$', sign)
382+
add_rz_ray_to_plot(ax, sc_pnt, dest, 'red', '-.', f'Sc->{inf_str}', sign)
382383
else:
383384
add_rz_ray_to_plot(ax, sc_pnt, horn_inter, 'yellow', '-.', 'Sc->Horn', sign)
384385

src/astrohack/core/cassegrain_ray_tracing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,8 @@ def title_from_input_parameters(inpt_dict):
345345
title += (f'Focus offset = ({inpt_dict["x_focus_offset"]}, {inpt_dict["y_focus_offset"]}, '
346346
f'{inpt_dict["z_focus_offset"]}) [{inpt_dict["focus_offset_unit"]}], ')
347347
title += f'Phase offset = {inpt_dict["phase_offset"]} [{inpt_dict["phase_unit"]}], '
348-
title += f'$\lambda$ = {inpt_dict["observing_wavelength"]} [{inpt_dict["wavelength_unit"]}]'
348+
lambda_char = "\u03bb"
349+
title += f'{lambda_char} = {inpt_dict["observing_wavelength"]} [{inpt_dict["wavelength_unit"]}]'
349350
return title
350351

351352

0 commit comments

Comments
 (0)