News for hackers. Stuff that matters.
Re:The Colors of Chemistry by StefanKarpinski on Monday June 09, 2014 @05:24PM (#7870615)
Even if you don't follow the first half, it's worth skimming to get to the bottom where the computations predict the colors of chemical compounds with remarkable accuracy. The "Copper (II) aqua ion" one is the most impressive to me – the entire color spectrum is spot on.
Re:The Colors of Chemistry by gipp on Monday June 09, 2014 @09:21PM (#7871439)
It's not really "predicting" the colors, per se. The UV spectra being downloaded contain that information already. The code being demoed here is just a transformation of that data to "perceived" color. It's just a transformation between two equivalent representations, not "prediction" really.

Still, Julia is neat though.

Re:The Colors of Chemistry by acidflask on Monday June 09, 2014 @09:34PM (#7871475)
Agreed, not really a prediction, but rather a projection. Still, it surprises me that few people take the trouble to make the connection between the spectra and the perceived colors. Seems like photochemistry and colorimetry don't intersect as often as they ought to...
Re:The Colors of Chemistry by jwmerrill on Monday June 09, 2014 @06:44PM (#7870932)
What's going on with Rhodamine B? Its color doesn't change as a function of concentration? Why does its transmittance data seem to bounce back and forth between 0 and 1?
Re:The Colors of Chemistry by acidflask on Monday June 09, 2014 @07:35PM (#7871126)
There's something odd about how my normalization heuristic behaves with this particular spectrum. I haven't yet looked into it.
Re:The Colors of Chemistry by acidflask on Monday June 09, 2014 @09:31PM (#7871463)
Ah here we go. The spectrum for Rhodamine B is noisy and it's throwing the normalization heuristic off. I've added a moving average filter and zeroed out some small noise in the >600 nm range and the colors make more sense now.
Re:The Colors of Chemistry by gourneau on Monday June 09, 2014 @07:04PM (#7871006)
Dang, I want those interactive plots with IPython notebooks
Re:The Colors of Chemistry by heptal on Monday June 09, 2014 @07:21PM (#7871071)
Re:The Colors of Chemistry by anarchoni on Tuesday June 10, 2014 @10:13AM (#7872560)
C.R.E.A.M. - CIE Rules Everything Around Me

So many factors go into color matching and this is just the tip of the iceberg. Pigments vs dyes, solutions vs solid substrates, angles, light sources, observers...etc. Color is subjective, so creating an objective color-output that matches an average person's perceptual color vision is one hell of a fascinating, and expensive puzzle.

Re:The Colors of Chemistry by throwwit on Monday June 09, 2014 @08:22PM (#7871267)
Are Google analytics usually in Julia notebooks?
Re:The Colors of Chemistry by acidflask on Monday June 09, 2014 @09:33PM (#7871470)
No, I put that in the first cell. You can take it out of the notebook if you want.
Re:The Colors of Chemistry by cpa on Monday June 09, 2014 @09:01PM (#7871375)

    λ->planck(λ*nm,T=T)*m^3/Watt*cie_color_match(λ)
This syntax made me cringe hard. Kids these days…
Re:The Colors of Chemistry by acidflask on Monday June 09, 2014 @09:32PM (#7871466)
Is this so unreasonable? I needed to curry the function to sweep over the temperature T. And if you take out the units, it's simply pointwise multiplication of two functions.
Re:The Colors of Chemistry by cpa on Tuesday June 10, 2014 @04:07PM (#7874996)
Yes and no. The syntax x -> f(x) is borrowed from functional programming, which borrows it from λ-calculus. In λ-calculus, λx. f(x) is the function which maps x to f(x). So, λ -> f(λ) makes me cringe hard, because λ is a keyword! It's like trying to write in Python:

    def def(x):
        pass
Weird, uh?