Skip to content

Commit 0fd4317

Browse files
committed
Actually masking so no red line across the plot
1 parent ce1b817 commit 0fd4317

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tutorials/euclid_access/3_Euclid_intro_1D_spectra.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ We use the MASK column to create a boolean mask for values to ignore. We use the
161161
```{code-cell} ipython3
162162
bad_mask = (spectra['MASK'].value % 2 == 1) | (spectra['MASK'].value >= 64)
163163
164-
plt.plot(spectra['WAVELENGTH'][~bad_mask].to(u.micron), signal_scaled[~bad_mask], color='black', label='Spectrum')
165-
plt.plot(spectra['WAVELENGTH'][bad_mask], signal_scaled[bad_mask], color='red', label='Do not use')
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')
166166
plt.plot(spectra['WAVELENGTH'], np.sqrt(spectra['VAR']) * spec_header['FSCALE'], color='grey', label='Error')
167167
168168
plt.legend(loc='upper right')
@@ -177,7 +177,3 @@ plt.title(f'Object ID {obj_id}')
177177
**Updated**: 2025-03-31
178178

179179
**Contact:** [the IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html) with questions or reporting problems.
180-
181-
```{code-cell} ipython3
182-
183-
```

0 commit comments

Comments
 (0)