Skip to main content

Examples

Two scripts. Both run against the installed package and need nothing beyond NumPy.

python examples/sources_disagree.py
python examples/synthetic_underwater_images.py

They are run by CI on every push, so an example that has stopped working is a failed build rather than something a reader discovers.

Each prints the version and path it loaded first. python examples/foo.py puts examples/ on sys.path, not the current directory, so an installed copy of the package silently wins over the working tree. In a clone, run pip install -e . first.

sources_disagree.py

Why jerlov.water() makes you name a source.

The same Jerlov water type has different coefficients in different papers. At 510 nm the scattering coefficient of Jerlov III differs by a factor of 3.8 between the two published sets. A visibility estimate, a synthetic image, or a fitted attenuation coefficient built on one is not comparable with one built on the other.

The script also shows what each source says is doubtful about itself, what happens at the cells a published table got wrong, and the three things the package refuses to guess.

synthetic_underwater_images.py

Turning an above-water spectrum into what it would look like at depth: the thing papers on underwater vision need for training data, and the thing that usually gets done with hard-coded coefficients.

Prints, as terminal colour blocks, how five reflectance patches appear at ranges from 0 to 16 m in Jerlov III water at 15 m depth, white-balanced two ways — to daylight, which keeps the water's cast, and to the downwelling irradiance at depth, which removes it. Then the veiling fraction, the contrast, and coefficients in the Akkaynak-Treibitz form.

It ends with the limits, and they are not small. The backscatter ratio was stated rather than derived; the veiling radiance came from an estimate whose geometry is an approximation; the path is horizontal and the target Lambertian; the surface spectrum is CIE D65 rather than a measurement; the reflectance spectra are smooth inventions. Every one of those is a choice a caller can replace with a measurement.

None of it has been compared against photographs, because the measurements needed to do that do not appear to exist. The output is what the published coefficients imply, not a prediction.

Metadata

Release files for jerlov 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jerlov 0.1.4
File Size Uploaded
jerlov-0.1.4.tar.gz 101.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jerlov 0.1.4
File Interpreter ABI Platform
jerlov-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 193.7 kB

Release files / jerlov-0.1.4.tar.gz

Download URL jerlov-0.1.4.tar.gz
Size 101.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d81dc3782496a9e4d3ffd2c991fdd1515644dc760d8e63084f99720ba5c7c21a
BLAKE2b-256 checksum
How to use checksums
17f30a3d92f9688b583b180ef85e51663fc8413b27c7804e201c1b5e1ab9be41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / jerlov-0.1.4-py3-none-any.whl

Download URL jerlov-0.1.4-py3-none-any.whl
Size 92.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
039ae1e29451e62ec241b9cbee8e6bfab68a664265362cf8944cab9215771ad5
BLAKE2b-256 checksum
How to use checksums
ae2dd77266079a3692f03e7a2b35d6362137171aad18015a378c778e32668b2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.16.0

2 release files

0.15.2

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.4

2 release files

0.14.3

2 release files

0.14.2

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page