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

Account for no files in table, Fig 3401->3308 #462

Merged
merged 4 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
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
12 changes: 5 additions & 7 deletions docs/source/outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ In Stage 3:

Fig 3106: 2D drift fit (currently only produced for WFC3)

.. figure:: ../media/S3_out/fig3107_Curvature.png
.. figure:: ../media/S3_out/fig3107_file0_Curvature.png
:alt: Stage 3 trace curvature

Fig 3107: Measured, smoothed, and integer-rounded position of trace

- If ``isplots_S3`` = 3: ``Eureka!`` will plot the results of the background and optimal spectral extraction steps for each exposure in the observation.
- If ``isplots_S3`` = 3: ``Eureka!`` will plot the results of the background and optimal spectral extraction steps for each exposure in the observation as well as the cleaned median frame.

.. figure:: ../media/S3_out/fig3301_file0_int001_ImageAndBackground.png
:alt: Stage 3 background subtracted flux plot
Expand All @@ -86,12 +86,10 @@ In Stage 3:

Fig 3304: Residual Background Plot

- If ``isplots_S3`` = 4: ``Eureka!`` will plot the cleaned median frame.
.. figure:: ../media/S3_out/fig3308_file0_MedianFrame.png
:alt: Stage 3 clean median frame plot

.. figure:: ../media/S3_out/fig3401_file0_MedianFrame.png
:alt: Stage 3 clean median frame plot

Fig 3401: Clean Median Frame Plot
Fig 3308: Clean Median Frame Plot

- If ``isplots_S3`` = 5: ``Eureka!`` will plot the Subdata plots from the optimal spectral extraction step.

Expand Down
9 changes: 4 additions & 5 deletions src/eureka/S3_data_reduction/plots_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def curvature(meta, column_coms, smooth_coms, int_coms, m):


def median_frame(data, meta, m):
'''Plot the cleaned time-median frame. (Fig 3401)
'''Plot the cleaned time-median frame. (Fig 3308)

Parameters
----------
Expand All @@ -620,10 +620,10 @@ def median_frame(data, meta, m):
xmin, xmax = data.flux.x.min().values, data.flux.x.max().values
ymin, ymax = data.flux.y.min().values, data.flux.y.max().values
vmin = data.medflux.min().values
vmax = vmin + 2000
vmax = np.max([2000, vmin+2000])
cmap = plt.cm.plasma.copy()

plt.figure(3401, figsize=(8, 4))
plt.figure(3308, figsize=(8, 4))
plt.clf()
plt.title("Cleaned Median Frame")
plt.imshow(data.medflux, origin='lower', aspect='auto',
Expand All @@ -632,11 +632,10 @@ def median_frame(data, meta, m):
plt.colorbar()
plt.ylabel('Detector Pixel Position')
plt.xlabel('Detector Pixel Position')
plt.colorbar()
plt.tight_layout()

file_number = str(m).zfill(int(np.floor(np.log10(meta.num_data_files))+1))
fname = (f'figs{os.sep}fig3401_file{file_number}_MedianFrame' +
fname = (f'figs{os.sep}fig3308_file{file_number}_MedianFrame' +
plots.figure_filetype)
plt.savefig(meta.outputdir+fname, dpi=300)
if not meta.hide_plots:
Expand Down
1 change: 1 addition & 0 deletions src/eureka/lib/mastDownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def filterJWST(proposal_id, observation, visit, calib_level, subgroup):
sci_table2 = Observations.query_criteria(proposal_id=proposal_id,
obs_id=obsid2)

table = []
if len(sci_table) > 0:
# Get product list
data_products_by_id = Observations.get_product_list(sci_table)
Expand Down