I get the below error message when trying out the example code. I'm working on a fix and will submit a pull request if I find one.
In [18]: sptype = 'B3V'
...: wavelength = 3990 * u.Angstrom
...: signal_to_noise = 100
...: V = 5
...:
...: fig, ax, exp_time = plot_order_sn(sptype, wavelength, V, signal_to_noise=signal_to_noise)
---------------------------------------------------------------------------
UnitConversionError Traceback (most recent call last)
<ipython-input-18-6ef2779d36e5> in <module>
4 V = 5
5
----> 6 fig, ax, exp_time = plot_order_sn(sptype, wavelength, V, signal_to_noise=signal_to_noise)
~/anaconda3/lib/python3.7/site-packages/astropy/units/decorators.py in wrapper(*func_args, **func_kwargs)
232 # Call the original function with any equivalencies in force.
233 with add_enabled_equivalencies(self.equivalencies):
--> 234 return_ = wrapped_function(*func_args, **func_kwargs)
235 if wrapped_signature.return_annotation not in (inspect.Signature.empty, None):
236 return return_.to(wrapped_signature.return_annotation)
~/anaconda3/lib/python3.7/site-packages/arcesetc/plots.py in plot_order_sn(sptype, wavelength, V, exp_time, signal_to_noise, **kwargs)
175 V,
176 exp_time=exp_time,
--> 177 signal_to_noise=signal_to_noise)
178 sn = flux / np.sqrt(flux)
179 ax.set_title('Sp. Type: {0}, Exposure time: {1:.1f}'
~/anaconda3/lib/python3.7/site-packages/astropy/units/decorators.py in wrapper(*func_args, **func_kwargs)
232 # Call the original function with any equivalencies in force.
233 with add_enabled_equivalencies(self.equivalencies):
--> 234 return_ = wrapped_function(*func_args, **func_kwargs)
235 if wrapped_signature.return_annotation not in (inspect.Signature.empty, None):
236 return return_.to(wrapped_signature.return_annotation)
~/anaconda3/lib/python3.7/site-packages/arcesetc/util.py in reconstruct_order(sptype, wavelength, V, exp_time, signal_to_noise)
213
214 closest_order = get_closest_order(matrix, wavelength)
--> 215 wave, flux = matrix_row_to_spectrum(matrix, closest_order)
216 flux *= scale_flux(archive[target], V)
217
~/anaconda3/lib/python3.7/site-packages/arcesetc/util.py in matrix_row_to_spectrum(matrix, closest_order)
119 wave = np.arange(lam_0 - n_lam*delta_lam/2, lam_0 + n_lam*delta_lam/2,
120 delta_lam) * u.Angstrom
--> 121 flux = np.polyval(polynomial_coeffs, wave-lam_0 * u.Angstrom)
122 return wave, flux
123
<__array_function__ internals> in polyval(*args, **kwargs)
~/anaconda3/lib/python3.7/site-packages/numpy/lib/polynomial.py in polyval(p, x)
734 y = NX.zeros_like(x)
735 for i in range(len(p)):
--> 736 y = y * x + p[i]
737 return y
738
~/anaconda3/lib/python3.7/site-packages/astropy/units/quantity.py in __array_ufunc__(self, function, method, *inputs, **kwargs)
455 # consistent units between two inputs (e.g., in np.add) --
456 # and the unit of the result (or tuple of units for nout > 1).
--> 457 converters, unit = converters_and_unit(function, method, *inputs)
458
459 out = kwargs.get('out', None)
~/anaconda3/lib/python3.7/site-packages/astropy/units/quantity_helper/converters.py in converters_and_unit(function, method, *args)
187 "argument is not a quantity (unless the "
188 "latter is all zero/infinity/nan)"
--> 189 .format(function.__name__))
190 except TypeError:
191 # _can_have_arbitrary_unit failed: arg could not be compared
UnitConversionError: Can only apply 'add' function to dimensionless quantities when other argument is not a quantity (unless the latter is all zero/infinity/nan)