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)
| File | Size | Uploaded | |
|---|---|---|---|
| jerlov-0.1.4.tar.gz | 101.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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