Skip to content

Commit 8e6ad1b

Browse files
committed
Return histogram error plotting logic to pre-unit fix
1 parent 1f7df2c commit 8e6ad1b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/make_spectra.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,14 @@ def make_specfull(source, src_basename, cube_params, original, spec_line=None, s
182182
ax2_spec = fig2.add_subplot(111)
183183
ax2_spec.plot([np.min(optical_velocity) - 10, np.max(optical_velocity) + 10], [0, 0], '--', color='gray')
184184
# If there are lots of channels, don't plot errors (too crowded and can tell from noise.) Cut off currently arbitrary.
185-
if len(spec) <= 200:
186-
opt_vel, f_sum, y_err = make_hist_arr(xx=optical_velocity, yy=flux_dens, yy_err=y_error)
187-
if len(spec) <= 100:
188-
ax2_spec.errorbar(opt_vel, f_sum, elinewidth=0.75, yerr=y_err, capsize=1)
189-
else:
190-
ax2_spec.errorbar(opt_vel, f_sum, elinewidth=0.75, yerr=y_err * 0, capsize=0)
185+
if len(spec) <= 100:
186+
opt_vel, f_sum, y_err = make_hist_arr(xx=optical_velocity, yy=spec['f_sum'] / cube_params['pix_per_beam'],
187+
yy_err=y_error)
188+
ax2_spec.errorbar(opt_vel, f_sum, elinewidth=0.75, yerr=y_err, capsize=1)
189+
elif len(spec) <= 200:
190+
opt_vel, f_sum, y_err = make_hist_arr(xx=optical_velocity, yy=spec['f_sum'] / cube_params['pix_per_beam'],
191+
yy_err=y_error * 0)
192+
ax2_spec.errorbar(opt_vel, f_sum, elinewidth=0.75, yerr=y_err, capsize=0)
191193
else:
192194
print("\tInput *_specfull.txt is >=200 channels; expanding figure, not including error bars (noise should be indicative).")
193195
ax2_spec.plot(optical_velocity, spec['f_sum'] / cube_params['pix_per_beam'])

0 commit comments

Comments
 (0)