Skip to content
New issue

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

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

Already on GitHub? # to your account

F170W and F255W not plotting correctly in plot_filters #796

Closed
crobinett1 opened this issue Dec 19, 2023 · 2 comments · Fixed by #799
Closed

F170W and F255W not plotting correctly in plot_filters #796

crobinett1 opened this issue Dec 19, 2023 · 2 comments · Fixed by #799

Comments

@crobinett1
Copy link

I am attempting to use the plot_filters module from beast.plotting in a Jupyter notebook to see the filter response curves for some HST WFPC2 filters. When I attempt to include either F170W or F255W, I get the following warning and plot.

/astro/users/corbinr1/miniconda3/envs/astroconda/lib/python3.7/site-packages/beast/plotting/plot_filters.py:65: RuntimeWarning: Mean of empty slice
  np.nanmean(f.wavelength[f.transmit > 100.0 * ylim[0]]),
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values

filter_test

This does not occur if I do not include either of the two problem filters which are unlabeled in the plot above. I have attempted to use plot_filters with filterLib set to None and set to the file found in beast/libs/filters.hd5, both produce the result above. The commands I used to generate the plot were

from matplotlib import pyplot as plt
from beast.plotting import plot_filters
plot_filters.plot_filters(filter_names=['HST_WFPC2_F170W','HST_WFPC2_F255W','HST_WFPC2_F336W','HST_WFPC2_F439W','HST_WFPC2_F555W','HST_WFPC2_F814W'], filterLib=None, xlim=[1000,20000])
plt.savefig('filter_test.png')
@karllark
Copy link
Member

Thanks for opening this issue. Will look at this in the new year.

@karllark
Copy link
Member

The lack of plotting of the filter names was due to a simple way of determining the x,y coordinates for the text. I've updated the code to be more adaptive in PR #799 and so now the filter names will be plotted.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
2 participants