# `Nanodrop.Spectrum`

Absorbance spectrum data structure.

Contains wavelengths (nm) and corresponding absorbance values,
calculated from raw intensity data using Beer-Lambert law:

    A = -log10((sample - dark) / (blank - dark))

# `t`

```elixir
@type t() :: %Nanodrop.Spectrum{
  absorbance: [float()],
  timestamp: DateTime.t() | nil,
  wavelengths: [float()]
}
```

# `absorbance_at`

```elixir
@spec absorbance_at(t(), float()) :: float()
```

Returns the absorbance at a specific wavelength (nearest match).

# `filter_range`

```elixir
@spec filter_range(t(), float(), float()) :: t()
```

Filters the spectrum to a wavelength range.

# `new`

```elixir
@spec new([float()], [float()]) :: t()
```

Creates a spectrum from wavelength and absorbance lists.

# `peak_wavelength`

```elixir
@spec peak_wavelength(t()) :: float()
```

Finds the wavelength with maximum absorbance.

# `size`

```elixir
@spec size(t()) :: non_neg_integer()
```

Returns the number of data points.

# `subtract`

```elixir
@spec subtract(t(), t() | [float()]) :: t()
```

Subtracts baseline values from absorbance.

Accepts either another Spectrum or a list of values.

# `wavelength_range`

```elixir
@spec wavelength_range(t()) :: {float(), float()}
```

Returns the wavelength range as {min, max}.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
