Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#835 - Improvements to trending.plot_wfs_obs_delta & wfe_histogram_pl… #836

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading