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

Suppress no defined binset messages #111

Open
astrophysaxist opened this issue Feb 13, 2019 · 3 comments
Open

Suppress no defined binset messages #111

astrophysaxist opened this issue Feb 13, 2019 · 3 comments

Comments

@astrophysaxist
Copy link

Hi,

I was wondering if there was a way to suppress the "does not have a defined binset..." message in calls to a pysynphot.observation with a custom filter bandpass.

Best,
Greg

@pllim
Copy link
Collaborator

pllim commented Feb 13, 2019

Unfortunately, it is currently emitted with a print function, so you cannot use logging to suppress it.

if binset is None:
msg="(%s) does not have a defined binset in the wavecat table. The waveset of the spectrum will be used instead."%str(self.bandpass)
try:
self.binwave = self.bandpass.binset
except (KeyError, AttributeError):
self.binwave = self.spectrum.wave
print(msg)
if self.binwave is None:
self.binwave = self.spectrum.wave
print(msg)

@astrophysaxist
Copy link
Author

Any easy on hand examples in the existing project using a log? I could use that as a guide and submit a pull request.

@pllim
Copy link
Collaborator

pllim commented Mar 22, 2019

This package is currently considered "legacy", i.e., I would only consider putting in critical bug fixes. If you really need logging, please consider https://github.com/spacetelescope/synphot_refactor .

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

2 participants