Skip to content

Commit

Permalink
Merge pull request #715 from kevin218/kbs
Browse files Browse the repository at this point in the history
Update download script
  • Loading branch information
kevin218 authored Nov 6, 2024
2 parents 9de59a3 + 64a056d commit fde2b69
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
12 changes: 1 addition & 11 deletions src/eureka/S3_data_reduction/nirspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def read(filename, data, meta, log):
'''Reads single FITS file from JWST's NIRCam instrument.
'''Reads single FITS file from JWST's NIRSpec instrument.
Parameters
----------
Expand All @@ -29,16 +29,6 @@ def read(filename, data, meta, log):
log : logedit.Logedit
The current log.
Notes
-----
History:
- November 2012 Kevin Stevenson
Initial version
- June 2021 Aarynn Carter/Eva-Maria Ahrer
Updated for NIRSpec
- Apr 22, 2022 Kevin Stevenson
Convert to using Xarray Dataset
'''
hdulist = fits.open(filename)

Expand Down
7 changes: 4 additions & 3 deletions src/eureka/S3_data_reduction/optspex.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,10 @@ def clean_median_flux(data, meta, log, m):
~np.ma.getmaskarray(medflux[j])]
goodrow = medflux[j][~np.ma.getmaskarray(outliers[j]) *
~np.ma.getmaskarray(medflux[j])]
f = spi.interp1d(x1, goodrow, 'linear', fill_value='extrapolate')
# f = spi.UnivariateSpline(x1, goodmed, k=1, s=None)
clean_med[j] = f(xx)
if len(goodrow) > 0:
f = spi.interp1d(x1, goodrow, 'linear',
fill_value='extrapolate')
clean_med[j] = f(xx)

# Assign cleaned median frame to data object
data['medflux'] = (['y', 'x'], clean_med)
Expand Down
2 changes: 1 addition & 1 deletion src/eureka/S6_planet_spectra/s6_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def plot_spectra(eventlabel, ecf_path=None, s5_meta=None, input_meta=None):
# Copy existing S5 log file and resume log
meta.s6_logname = meta.outputdir+'S6_'+meta.eventlabel+'.log'
log = logedit.Logedit(meta.s6_logname, read=meta.s5_logname)
log.writelog("\nStarting Stage 6: Light Curve Fitting\n")
log.writelog("\nStarting Stage 6: Plot Spectra\n")
log.writelog(f"Eureka! Version: {meta.version}", mute=True)
log.writelog(f"Input directory: {meta.inputdir}")
log.writelog(f"Output directory: {meta.outputdir}")
Expand Down
2 changes: 1 addition & 1 deletion src/eureka/lib/mastDownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def filterJWST(proposal_id, observation, visit, calib_level, subgroup):
calib_level = [calib_level]
# Specify obsid using wildcards, obs_id can come in two flavours
obsid = f'jw{proposal_id}{observation}{visit}_04*'
obsid2 = f'jw{proposal_id}-o{observation}_t{visit}*'
obsid2 = f'jw{proposal_id}-o{observation}_t*'

# Query MAST for requested visit
sci_table = Observations.query_criteria(proposal_id=proposal_id,
Expand Down

0 comments on commit fde2b69

Please sign in to comment.