phetsims / blackbody-spectrum

"Blackbody Spectrum" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 3 forks source link

User question about the method to produce the star's color in the sim #121

Closed DianaTavares closed 3 years ago

DianaTavares commented 3 years ago

This is an email sent by a user to PhEThelp: __ email

Hello,

I am an astrophysics PhD graduate student at the University of North Carolina. I was looking at the Blackbody Spectrum Phet simulation (https://phet.colorado.edu/en/simulation/blackbody-spectrum), and noticed that in the panel, there is a star symbol that is used to represent the true color of the star that would have that blackbody profile. It appears that the developers put in a decent amount of effort producing that as it seems to be an integration of the colors present in the blackbody spectrum.

Do you know what method they used to produce that net color (or whom I should contact to find out)? I am sure it is in the source code on github, but I'm not a big HTML5 person, so tracking down the actual method in there is a daunting task.

Do you know if they have any plans for that tool for producing the net color of a spectrum to allow an input spectrum other than blackbody? I ask because as noted in the phet simulation, there are obviously various absorption effects on a given star's spectrum. Some stars have quite sizable absorption features that can affect their astronomical colors from filters, and I have a star or two of my own that I think would have rather interesting colors as a result of broad absorption features, and I am seeking a way to represent that.

Thanks,

_End of the email____

ariel-phet commented 3 years ago

@DianaTavares the model for the stars color can be found in this file: https://github.com/phetsims/blackbody-spectrum/blob/4d8b70c78ee85210d7b79661c65c5ba8732c8273/js/blackbody-spectrum/model/BlackbodyBodyModel.js

It is pretty well documented. Basically the power spectral density for 3 wavelengths are calculated (Red, Green, and Blue) and there is some renormalization done. Those calculations are used to set an integer between 0-255 for the R, G, B colors.

We do not currently have any plans for a tool to represent the net color spectrum other than that of a blackbody. Hopefully one day we will make a spectroscopy simulation but that is not on the radar.

DianaTavares commented 3 years ago

Thanks! I just send the email to the user with this information.