Closed zkbt closed 2 years ago
(Let's focus on one wavelength at a time, but eventually this could get looped into a thing that would plot all the wavelengths together somehow!)
@mone0982 , I think step (1) above is very closely related to code you already have, so whenever you get a chance to work on this, I'd start there first! The other bits get kind of more complicated in various different ways, which we can talk about when we get there.
Hi @zkbt, I just pushed what I have so far for the plot_histogram function to add_histogram_plots...it's working with what I have, but I have a couple questions:
What do you mean by 'bin location'? I haven't been able to find documentation about bin location with respect to plot.hist.
I am having trouble using the rainbow.get_wavelength_color() thing you suggested to make the histogram's color correspond to the wavelength of what is being plotted. I have tried "rainbow.get_wavelength_color(i)" with 'i' being the row/wavelength I am plotting but am getting an error with that. It's likely that I just don't really understand how the get_wavelength_color thing works.
Let me know your thoughts/suggestions, or we can just talk about this when we meet next! Thanks!
We should add a visualization function that plots a histogram of flux values for one wavelength row of a
Rainbow
dataset. It should produce a plot with the following features:s = SimulatedRainbow(); s.plot_histogram(i)
wherei
refers to which wavelength row we want to plot. It should have flux bin values on the x-axis and the number of occurrences (= histogram) of flux values within a particular bin on the y-axis. We should useplt.hist
withdensity=True
, so that the distributions are normalized to integrate to one.plt.hist
to choose its own bin settings (number of bins, locations of bins, width of bins), but it should also be possible to provide keyword arguments specifying each of these explicitly.rainbow.get_wavelength_color()
so that it would automatically match the other colors where each wavelength appears (for example, in.plot
).expected=True
that would allow the user to specify whether or not to overplot the theoretical normal distribution provided by theuncertainty
(= $\sigma$) flux-like array (and maybe themodel
one if provided)?