@@ -113,13 +113,13 @@ Open the large FITS file without loading it entirely into memory, pulling out ju
113113
114114``` {code-cell} ipython3
115115with fits.open(file_uri) as hdul:
116- spectra = QTable.read(hdul[result['hdu'][0]], format='fits')
116+ spectrum = QTable.read(hdul[result['hdu'][0]], format='fits')
117117
118118 spec_header = hdul[result['hdu'][0]].header
119119```
120120
121121``` {code-cell} ipython3
122- spectra
122+ spectrum
123123```
124124
125125``` {code-cell} ipython3
@@ -145,25 +145,25 @@ The 1D combined spectra table contains 6 columns, below are a few highlights:
145145```
146146
147147``` {code-cell} ipython3
148- signal_scaled = spectra ['SIGNAL'] * spec_header['FSCALE']
148+ signal_scaled = spectrum ['SIGNAL'] * spec_header['FSCALE']
149149```
150150
151151We investigate the MASK column to see which flux bins are recommended to keep vs "Do Not Use"
152152
153153``` {code-cell} ipython3
154- plt.plot(spectra ['WAVELENGTH'].to(u.micron), spectra ['MASK'])
154+ plt.plot(spectrum ['WAVELENGTH'].to(u.micron), spectrum ['MASK'])
155155plt.ylabel('Mask value')
156156plt.title('Values of MASK by flux bin')
157157```
158158
159159We use the MASK column to create a boolean mask for values to ignore. We use the inverse of this mask to mark the flux bins to use.
160160
161161``` {code-cell} ipython3
162- bad_mask = (spectra ['MASK'].value % 2 == 1) | (spectra ['MASK'].value >= 64)
162+ bad_mask = (spectrum ['MASK'].value % 2 == 1) | (spectrum ['MASK'].value >= 64)
163163
164- plt.plot(spectra ['WAVELENGTH'].to(u.micron), np.ma.masked_where(bad_mask, signal_scaled), color='black', label='Spectrum')
165- plt.plot(spectra ['WAVELENGTH'], np.ma.masked_where(~bad_mask, signal_scaled), color='red', label='Do not use')
166- plt.plot(spectra ['WAVELENGTH'], np.sqrt(spectra ['VAR']) * spec_header['FSCALE'], color='grey', label='Error')
164+ plt.plot(spectrum ['WAVELENGTH'].to(u.micron), np.ma.masked_where(bad_mask, signal_scaled), color='black', label='Spectrum')
165+ plt.plot(spectrum ['WAVELENGTH'], np.ma.masked_where(~bad_mask, signal_scaled), color='red', label='Do not use')
166+ plt.plot(spectrum ['WAVELENGTH'], np.sqrt(spectrum ['VAR']) * spec_header['FSCALE'], color='grey', label='Error')
167167
168168plt.legend(loc='upper right')
169169plt.ylim(-0.15E-16, 0.25E-16)
0 commit comments