nzhagen / jcamp

A set of Python utilities for reading JCAMP-DX files.
MIT License
54 stars 31 forks source link

Corrected conversion from transmittance to absorbance #1

Closed kyleniemeyer closed 10 years ago

kyleniemeyer commented 10 years ago

I corrected the conversion from transmittance to absorbance from:

A = 1 - T

that was being used to:

A = -log10(T) = log10(1 / T)

based on these references: http://en.wikipedia.org/wiki/Absorbance, or http://books.google.com/books?id=BNqp0RO7DXcC&lpg=PP1&pg=PA27#v=onepage&q&f=false

nzhagen commented 10 years ago

Thanks for the corrections! The choice of A = 1 - T was actually intentional, but is less appropriate for public code, so your change is the right way to go. I'm merging it in now.

kyleniemeyer commented 10 years ago

No problem! I was looking for a package that did exactly what yours does, so glad to help.

The only possible issue left related to this, I think, would be whether base-10 log or natural log should be used... it seems it can be either depending on the field (and gas vs. liquid).