desihub / tutorials

DESI tutorials
BSD 3-Clause "New" or "Revised" License
43 stars 16 forks source link

Bug with plotspec function in simulating-desi-spectra #49

Closed noahfranz13 closed 4 years ago

noahfranz13 commented 4 years ago

In the simulating-desi-spectra tutorial when the plotspec function is defined a loop is used to iterate over ['b', 'r', 'z'] using the variable x however within the loop x is never used, instead, only 'r' is used in its place. See below:

for x in ['b', 'r', 'z']: tmpmin, tmpmax = np.percentile(spectra.flux['r'][i], [1, 99]) ymin = min(tmpmin, ymin) ymax = max(tmpmax, ymax)

Instead this worked better for me:

for x in ['b', 'r', 'z']: tmpmin, tmpmax = np.percentile(spectra.flux[x][i], [1, 99]) ymin = min(tmpmin, ymin) ymax = max(tmpmax, ymax)

sbailey commented 4 years ago

Good catch. Could you please open a pull request with that fix? ping me and @moustakas if there are any procedural hiccups with write permission, how to open a PR, etc. Thanks.

sbailey commented 4 years ago

Fixed in PR #50. Thanks.