Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages are often missing in AnalyticSpectra's sanity checks #1

Open
alexrudy opened this issue Sep 14, 2012 · 0 comments
Open
Assignees

Comments

@alexrudy
Copy link
Owner

Sanity checks in AnalyticSpectra.InteropolatedSpectrumBase raise error types that don't support messaging. Errors should probably be encased in a custom error type when raised from AnalyticSpectra. Most of these errors are incorrectly categorized in this mode.

Example Traceback:

Traceback (most recent call last):
  File "./Examples/spectra.py", line 38, in <module>
    OBJECT["Resampled"] = OBJECT.frame("Interpolated")(wavelengths=WAVELENGTHS_LOWR[1:],resolution=LOWR,method='resample')
  File "/Users/alexanderrudy/Dropbox/Library/Development/Astronomy/AstroObject/AstroObject/AnalyticSpectra.py", line 866, in __call__
    return InterpolatedSpectrumBase.__call__(self,method=method,**kwargs)
  File "/Users/alexanderrudy/Dropbox/Library/Development/Astronomy/AstroObject/AstroObject/AnalyticSpectra.py", line 290, in __call__
    return method(**kwargs)
  File "/Users/alexanderrudy/Dropbox/Library/Development/Astronomy/AstroObject/AstroObject/AnalyticSpectra.py", line 606, in resample
    self._presanity(self.wavelengths,self.flux,wavelengths,resolution,upsample=upsample)
  File "/Users/alexanderrudy/Dropbox/Library/Development/Astronomy/AstroObject/AstroObject/AnalyticSpectra.py", line 454, in _presanity
    raise e
ValueError

Error should have been raised with a message. Also, a value error is regardless not a good descriptor. This error is caused by an interpolation error.

@ghost ghost assigned alexrudy Sep 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant