beast
beast copied to clipboard
F170W and F255W not plotting correctly in plot_filters
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
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')
Thanks for opening this issue. Will look at this in the new year.
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.