Skip to content

Commit 1613744

Browse files
committed
Fixing more variable namings
1 parent 636859c commit 1613744

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tutorials/euclid_access/3_Euclid_intro_1D_spectra.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ Open the large FITS file without loading it entirely into memory, pulling out ju
113113

114114
```{code-cell} ipython3
115115
with 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

151151
We 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'])
155155
plt.ylabel('Mask value')
156156
plt.title('Values of MASK by flux bin')
157157
```
158158

159159
We 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
168168
plt.legend(loc='upper right')
169169
plt.ylim(-0.15E-16, 0.25E-16)

0 commit comments

Comments
 (0)