Skip to content

Commit

Permalink
Merge pull request #836 from kulpster85/835_trending_full_filename_su…
Browse files Browse the repository at this point in the history
…pport

#835 - Improvements to trending.plot_wfs_obs_delta & wfe_histogram_pl…
  • Loading branch information
mperrin authored May 6, 2024
2 parents 5a20c76 + 760abc4 commit e6678bd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions webbpsf/trending.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ def wfe_histogram_plot(opdtable, start_date=None, end_date=None, thresh=None, pi
for row in opdtable1:
if download_opds:
full_file_path = os.path.join(webbpsf.utils.get_webbpsf_data_path(), 'MAST_JWST_WSS_OPDs', row['fileName'])
else:
full_file_path = row['fileName']
if 'rms_wfe' not in opdtable1.colnames:

if ote_only == False:
Expand Down Expand Up @@ -1441,7 +1443,7 @@ def plot_phase_retrieval_crosscheck(fn, vmax_fraction=1.0):
return fig


def plot_wfs_obs_delta(fn1, fn2, vmax_fraction=1.0):
def plot_wfs_obs_delta(fn1, fn2, vmax_fraction=1.0, download_opds=True):
""" Display comparison of two weak lens observations
This compares the actual measured WL data, not the derived wavefronts.
Expand All @@ -1462,8 +1464,9 @@ def plot_wfs_obs_delta(fn1, fn2, vmax_fraction=1.0):
"""
from skimage.registration import phase_cross_correlation

_ = webbpsf.mast_wss.mast_retrieve_opd(fn1)
_ = webbpsf.mast_wss.mast_retrieve_opd(fn2)
if download_opds:
_ = webbpsf.mast_wss.mast_retrieve_opd(fn1)
_ = webbpsf.mast_wss.mast_retrieve_opd(fn2)

opd, hdul1 = webbpsf.trending._read_opd(fn1)

Expand Down Expand Up @@ -1519,8 +1522,8 @@ def plot_wfs_obs_delta(fn1, fn2, vmax_fraction=1.0):

axes[0,0].set_ylabel("WLM8", fontsize=18)
axes[1,0].set_ylabel("WLP8", fontsize=18)
axes[0,0].set_title(f"Measured: \n{fn1}", fontsize=18)
axes[0,1].set_title(f"Measured: \n{fn2}", fontsize=18)
axes[0,0].set_title(f"Measured: \n{os.path.basename(fn1)}", fontsize=18)
axes[0,1].set_title(f"Measured: \n{os.path.basename(fn2)}", fontsize=18)
axes[0,2].set_title("Difference\n ", fontsize=18)

fig.suptitle(f"{hdul1[0].header['CORR_ID']}, {hdul1[0].header['TSTAMP'][:-3]} vs. {hdul2[0].header['CORR_ID']}, {hdul2[0].header['TSTAMP'][:-3]}", fontsize=20, fontweight='bold')
Expand Down

0 comments on commit e6678bd

Please sign in to comment.