Skip to content

Commit

Permalink
Minor fix to address reported issue #677
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyhawk172 committed Jul 21, 2023
1 parent c8432b3 commit 3114a77
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions webbpsf/trending.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ def basic_show_image(image, ax, vmax=.3, nanmask=1):
ax.set_yticks([])

# Make the plots
fig = plt.figure(constrained_layout=False, figsize=(16, 9), )
fig = plt.figure(constrained_layout=False, figsize=(16, 10), )

Check warning on line 1037 in webbpsf/trending.py

View check run for this annotation

Codecov / codecov/patch

webbpsf/trending.py#L1037

Added line #L1037 was not covered by tests

subfigs = fig.subfigures(2, 1, hspace=0.02, height_ratios=[2, 2], )

Expand Down Expand Up @@ -1081,9 +1081,9 @@ def basic_show_image(image, ax, vmax=.3, nanmask=1):
ee_measurements[ee_npix] = ees_at_rad # save for later

median_ee = np.median(ees_at_rad)
ee_ax_ylim = np.max([ee_ax_ylim, np.abs(ees_at_rad-median_ee).max()*1.1]) # display tweak: adjust the plot Y scale sensibly to its contents
ee_ax_ylim = np.max([ee_ax_ylim, np.abs((ees_at_rad-median_ee)/median_ee).max()*1.1]) # display tweak: adjust the plot Y scale sensibly to its contents

Check warning on line 1084 in webbpsf/trending.py

View check run for this annotation

Codecov / codecov/patch

webbpsf/trending.py#L1084

Added line #L1084 was not covered by tests

axes[1].plot_date(dates_array.plot_date, ees_at_rad-median_ee, ls='-', color=color,
axes[1].plot_date(dates_array.plot_date, (ees_at_rad - median_ee)/median_ee, ls='-', color=color,

Check warning on line 1086 in webbpsf/trending.py

View check run for this annotation

Codecov / codecov/patch

webbpsf/trending.py#L1086

Added line #L1086 was not covered by tests
label=f"$\Delta$EE within {ee_rad:.2f} arcsec ({ee_npix} pix)")

axes[1].text(0.01, 0.75-i*0.12, f'Median EE within {ee_rad:.2f} arcsec = {median_ee:.3f}', color=color,
Expand All @@ -1092,7 +1092,7 @@ def basic_show_image(image, ax, vmax=.3, nanmask=1):

axes[1].fill_between( [start_date.plot_date - 0.5, end_date.plot_date + 0.5], -0.03, 0.03, color='gray', alpha=0.1, label="±3% change (stability requirement)")
axes[1].set_xlabel("Date", fontsize=fs, fontweight='bold')
axes[1].set_ylabel(f"Change in \nEncircled Energy\n{instrument} {filter}", fontsize=fs, fontweight='bold')
axes[1].set_ylabel(f"% Change in \nEncircled Energy\n{instrument} {filter}", fontsize=fs, fontweight='bold')

Check warning on line 1095 in webbpsf/trending.py

View check run for this annotation

Codecov / codecov/patch

webbpsf/trending.py#L1095

Added line #L1095 was not covered by tests
axes[1].set_ylim(0.5, 1.0)
axes[1].axhline(0, ls=":", color='gray')
axes[1].set_ylim(-ee_ax_ylim, ee_ax_ylim)
Expand Down Expand Up @@ -1156,7 +1156,7 @@ def basic_show_image(image, ax, vmax=.3, nanmask=1):
basic_show_image(delta_opd * 1e6, ax=im_axes[2, plot_index], nanmask=nanmask, vmax=vmax_micron)
im_axes[2, plot_index].text(20, 20, f"{webbpsf.utils.rms(delta_opd, mask=apmask)*1e9:.1f}", color='yellow', fontsize=fs*0.6)

for i, l in enumerate(['WF Sensing', "Drifts", 'Corrections']):
for i, l in enumerate(['Measured\nWFE', "Drifts", 'Mirror\nCorrections']):

Check warning on line 1159 in webbpsf/trending.py

View check run for this annotation

Codecov / codecov/patch

webbpsf/trending.py#L1159

Added line #L1159 was not covered by tests
im_axes[i, 0].yaxis.set_visible(True)
im_axes[i, 0].set_ylabel(l + "\n\n", fontsize=fs, fontweight='bold')

Expand Down

0 comments on commit 3114a77

Please sign in to comment.