Skip to main content

Two-stream shortwave radiative transfer model for sea ice containing oil droplets.

Project description

oilrad

Oilrad is a python package for solving a two-stream shortwave radiation transfer model in a vertical domain containing sea ice and ocean water. It solves the spectral two-stream equations for ice and seawater polluted with a mass concentration of oil droplets, where oil absorption is calculated from [1]. Below is an example of spectral albedo computed for a range of oil mass ratios in a layer of sea ice.

Sea ice spectral albedo for ice containing droplets of Romashkino oil

Installation

Oilrad is available on PyPI and can be installed with pip via

pip install oilrad

Usage

The following python code illustrates how to set up and solve a simulation.

import numpy as np
import oilrad as oi

# set up model parameters
ICE_DEPTH = 0.8
depth = np.linspace(-1.5, 0, 1000)
model = oi.CtsWavelengthModel(
    z=depth,
    wavelengths=np.geomspace(350, 3000, 100),
    oil_mass_ratio=np.full_like(depth, 1000),
    ice_scattering_coefficient=1.5,
    median_droplet_radius_in_microns=0.5,
    liquid_fraction=np.where(depth > -ICE_DEPTH, 0, 1),
)

# solve the model
spectral_solution = oi.solve_two_stream_model(model)

# plot the spectral albedo
import matplotlib.pyplot as plt

plt.figure()
plt.plot(spectral_solution.wavelengths, spectral_solution.albedo)
plt.xlabel("wavelength (nm)")
plt.ylabel("albedo")
plt.show()

# integrate the solution over the black body spectrum to find total albedo
integrated_solution = oi.integrate_over_SW(
    spectral_solution, oi.BlackBodySpectrum(350, 3000)
)
print(f"total albedo={integrated_solution.albedo}")

Tests

The tests directory contains tests of simulations for a variety of input parameters. Run the tests using pytest from the root directory of the repository.

Docs

API reference documentation built using mkdocs gh-deploy is available at documentation.

License

MIT

References

[1] B. H. Redmond Roche and M. D. King, ‘Quantifying the effects of background concentrations of crude oil pollution on sea ice albedo’, The Cryosphere, vol. 16, no. 10, pp. 3949–3970, Oct. 2022, doi: 10.5194/tc-16-3949-2022.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oilrad-2.0.2.tar.gz (55.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oilrad-2.0.2-py3-none-any.whl (61.2 kB view details)

Uploaded Python 3

File details

Details for the file oilrad-2.0.2.tar.gz.

File metadata

  • Download URL: oilrad-2.0.2.tar.gz
  • Upload date:
  • Size: 55.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.13 Darwin/24.2.0

File hashes

Hashes for oilrad-2.0.2.tar.gz
Algorithm Hash digest
SHA256 bf4029ff4e4e2264a44668fa0ed21b864993a82775245bd0d2657ce9ad7eee6d
MD5 22ab009caf1659e506e5e7146d95be39
BLAKE2b-256 fe3aa26f2baf5fa1ed143b2fc00b23b0ea5fce134628ca54e99d58afedd566a3

See more details on using hashes here.

File details

Details for the file oilrad-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: oilrad-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 61.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.13 Darwin/24.2.0

File hashes

Hashes for oilrad-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7336daf0dc16c52b1fa1e5d5ce24c8ac4e8343ec98b9a9548a0725dad8536d2f
MD5 10b9abd7874d9f6d25fef492e26a36ef
BLAKE2b-256 44ccad36f5c8ab4f3d8f97826cfa3229c7adbcfd4f52e00cf18bf3e1700451a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page