Examples

Thirty scripts, each for one kind of reader. Each runs against the installed package, needs nothing beyond NumPy, and prints what it computes; closure_with_jerlov_kd.py and shallow_water_closure.py also read results kept beside them, and so does part 3 of phase_function_choice.py. CI runs every one of them, so an example that has stopped working is a failed build rather than something a reader discovers. They are in the repository, not in the installed package; from a clone:

python examples/sources_disagree.py

examples/README.md says what each shows in more detail.

If you

Start with

wonder why water() asks for a source

sources_disagree.py

have measurements from an instrument, including a backscattering sensor

from_one_measurement.py

need synthetic underwater imagery

synthetic_underwater_images.py

write an ocean circulation model

solar_heating.py

study vision, or design a sensor

what_an_eye_sees.py

need the light at depth, below the top 10 m

light_at_depth.py

need a backscatter ratio and have no instrument

measured_scattering.py

work with absorption, or with phytoplankton and CDOM

what_is_in_the_water.py

need the depth of the euphotic zone, or the light phytoplankton get

euphotic_zone.py

design an underwater optical link or a lidar

optical_link.py

work on seagrass, or on restoring a meadow

seagrass_depth_limit.py

study vertical migration, or where animals sit in the light

isolumes.py

design or test painted fishing lures or other gear

lure_colours.py

study ultraviolet exposure under water, of reefs, plankton or chemistry

ultraviolet.py

need the radiance distribution, the mean cosine or scalar irradiance

radiance_distribution.py

render or photograph objects under water, from any direction

painted_sphere.py

work with the flicker of light under waves, near the surface

wave_focusing.py

study fish vision, or how water changes colour differences for an animal

fish_colour_differences.py

have a chlorophyll concentration, or a and bb, rather than a water type; or want a Secchi depth

ocean_colour_and_secchi.py

have used D65 as the light above the sea, or need the sun’s spectrum at the surface

sunlight_and_d65.py

see under water along a slanted line, looking up or down

looking_up_and_down.py

render water, in film, games or simulation

rendering_export.py

make images of water in RGB, and wonder what it costs the colours

rgb_versus_spectral.py

draw water every frame from a precomputed table, in a game or simulator

water_lookup_tables.py

choose a phase function for light in water

phase_function_choice.py

need reference colours to check a rendering or photograph against

reference_images.py

run OSOAA or HydroLight with a Jerlov type as the water

radiative_transfer_inputs.py

see whether one source of a Jerlov type confirms another

closure_with_jerlov_kd.py

see why a shallow-water reflectance model misses where it does

shallow_water_closure.py

see where Morel et al.’s f/Q archive dips at a 45-degree sun (needs your copy)

fq_at_45_degrees.py