Skip to content

Commit

Permalink
Fixup --showabsorption without --showemission and --nostack
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Feb 14, 2024
1 parent 275fc27 commit 545aa5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions artistools/spectra/plotspectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,15 +694,19 @@ def make_emissionabsorption_plot(
linecolor = emissioncomponentplot.get_color()
else:
linecolor = None
plotobjects.append(mpatches.Patch(color=linecolor))

if args.showabsorption:
axis.plot(
(absorptioncomponentplot,) = axis.plot(
arraylambda_angstroms,
-x.array_flambda_absorption * scalefactor,
color=linecolor,
linewidth=1,
)
if not args.showemission:
linecolor = absorptioncomponentplot.get_color()

plotobjects.append(mpatches.Patch(color=linecolor))

elif contributions_sorted_reduced:
if args.showemission:
stackplot = axis.stackplot(
Expand Down
4 changes: 3 additions & 1 deletion artistools/spectra/spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,9 @@ def get_emprocesslabel(emtype: int) -> str:
)
)

assert array_flambda_emission_total is not None
if array_flambda_emission_total is None:
array_flambda_emission_total = np.zeros_like(array_lambda, dtype=float)

assert array_lambda is not None

return contribution_list, array_flambda_emission_total, array_lambda
Expand Down

0 comments on commit 545aa5c

Please sign in to comment.