diff --git a/src/eureka/S3_data_reduction/nirspec.py b/src/eureka/S3_data_reduction/nirspec.py index 1b59b5ec..3d0b0550 100644 --- a/src/eureka/S3_data_reduction/nirspec.py +++ b/src/eureka/S3_data_reduction/nirspec.py @@ -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 ---------- @@ -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) diff --git a/src/eureka/S3_data_reduction/optspex.py b/src/eureka/S3_data_reduction/optspex.py index cd2e4e0e..a8bbf082 100755 --- a/src/eureka/S3_data_reduction/optspex.py +++ b/src/eureka/S3_data_reduction/optspex.py @@ -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) diff --git a/src/eureka/S6_planet_spectra/s6_spectra.py b/src/eureka/S6_planet_spectra/s6_spectra.py index aee1424e..f3933aa7 100644 --- a/src/eureka/S6_planet_spectra/s6_spectra.py +++ b/src/eureka/S6_planet_spectra/s6_spectra.py @@ -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}") diff --git a/src/eureka/lib/mastDownload.py b/src/eureka/lib/mastDownload.py index 7208d7fe..6c8fdebc 100644 --- a/src/eureka/lib/mastDownload.py +++ b/src/eureka/lib/mastDownload.py @@ -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,