Skip to content

Commit

Permalink
added int2od function to nirs.py
Browse files Browse the repository at this point in the history
  • Loading branch information
avolu committed Feb 16, 2024
1 parent 09fc1ee commit 51c9344
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cedalion/nirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ def channel_distances(amplitudes: xr.DataArray, geo3d: xr.DataArray):
return dists


def int2od(amplitudes: xr.DataArray):
"""Calculate optical density from intensity data."""
od = - np.log( amplitudes / amplitudes.mean("time") )
return od


def beer_lambert(
amplitudes: xr.DataArray,
geo3d: xr.DataArray,
Expand Down

0 comments on commit 51c9344

Please sign in to comment.