Skip to content

Commit

Permalink
Minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosertoli committed Oct 26, 2023
1 parent 8ea9691 commit b7b7364
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
11 changes: 8 additions & 3 deletions indica/plotters/plot_time_evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
# "cxff_pi:vtor",
# "cxff_tws_c:ti",
# "cxff_tws_c:vtor",
# "ts:te",
# "ts:ne",
"ts:te",
"ts:ne",
# "lines",
]

Expand Down Expand Up @@ -69,7 +69,10 @@ def plot_st40_data(

set_plot_rcparams(fig_style)
xr.set_options(keep_attrs=True)
colors = CMAP(np.linspace(0.75, 0.1, len(pulses), dtype=float))
if len(pulses) > 1:
colors = CMAP(np.linspace(0.75, 0.1, len(pulses), dtype=float))
else:
colors = ["blue"]

raw: dict = {quant: {} for quant in quantities}
binned = deepcopy(raw)
Expand Down Expand Up @@ -104,6 +107,8 @@ def plot_st40_data(
plt.autoscale()
save_figure(fig_path, f"{quantity}", save_fig=save_fig)

return data, st40


def plot_data(data, quantity: str, pulse: int, tplot: float, key="raw", color=None):
str_to_add = ""
Expand Down
16 changes: 14 additions & 2 deletions indica/workflows/load_modelling_plasma.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def plot_data_bckc_comparison(
(_bckc).plot(
label=label,
color=COLORS["bckc"],
linewidth=rcParams["lines.linewidth"] * 1.5,
linewidth=rcParams["lines.linewidth"],
alpha=alpha,
)
del label
Expand Down Expand Up @@ -699,6 +699,18 @@ def example_params(example: str, all_runs: bool = False):
tend=0.11,
tplot=0.1,
),
"michail_10014": dict(
comment="predictive ASTRA",
pulse_code=36010014,
pulse=10014,
equil="efit",
equil_run=0,
code="astra",
runs=["RUN24"],
tstart=0.03,
tend=0.1,
tplot=0.07,
),
"aleksei_11228": dict(
comment="ASTRA using TS and invented Ti shapes",
pulse=11228,
Expand Down Expand Up @@ -803,5 +815,5 @@ def example_params(example: str, all_runs: bool = False):

if __name__ == "__main__":
plt.ioff()
example_run()
example_run(example="alsu_11314")
plt.show()

0 comments on commit b7b7364

Please sign in to comment.