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.
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.InfiniteLayerModel(
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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oilrad-1.0.0.tar.gz.
File metadata
- Download URL: oilrad-1.0.0.tar.gz
- Upload date:
- Size: 35.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.9.13 Darwin/21.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61fcfeb7047a8eb41f3df4dd3f80dbfda657f99e78dbb784fee3bd5e530764ee
|
|
| MD5 |
549f2ce904ae10bce65c61841490ad2a
|
|
| BLAKE2b-256 |
2a9c1da08499c6a7c7816a12a7fe0397dc3409119dad76569e1760e87ae8883a
|
File details
Details for the file oilrad-1.0.0-py3-none-any.whl.
File metadata
- Download URL: oilrad-1.0.0-py3-none-any.whl
- Upload date:
- Size: 37.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.9.13 Darwin/21.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af4c60e456287fc7bb670c21f7e231c098154fedb128c0c123c762f2549a5d0b
|
|
| MD5 |
f5df2234a9e57c9f147662629e6987fc
|
|
| BLAKE2b-256 |
0b27969b8f61ea4aff1d81bbd959f0a6006e3fa9ac8ec70ab1853ef043401b41
|