Skip to content

1.39.0: monte_carlo_raman_light_field, Raman scattering in the package (DECISIONS section 156) - #137

Merged
tishibashi-cpu merged 3 commits into
mainfrom
dev
Dec 3, 2026
Merged

tishibashi-cpu merged 3 commits into
mainfrom
dev

Conversation

@tishibashi-cpu

Copy link
Copy Markdown
Owner

Author: T. Ishibashi takuya.ishibashi@kek.jp

Raman scattering in the package: monte_carlo_raman_light_field and MonteCarloRamanLightField (DECISIONS.md section 156; public names 154 to 156). No shipped value changed; monte_carlo_light_field returns exactly what it did.

Design (the user chose, from three, a function of its own)

  • The light at wavelength_nm from the sun's own light there and from Raman scattering of the light at a shorter excitation_nm, by the same Monte Carlo as monte_carlo_light_field.
  • Every choice is required, no defaults: the water at both wavelengths, excitation_ratio, raman_b (none shipped: 2.6e-4, 2.7e-4, 2.4e-4 per metre at 488 nm from Marshall & Smith 1990, Bartlett et al. 1998, Desiderio 2000), raman_depolarisation, raman_units ("energy" or "quanta", Desiderio's Eq. 3), raman_in_absorption (Desiderio's Eq. 4), and the surface, bottom, depths, photons, batches and seed. wind and surface_facets are required without a FutureWarning (a new function has no older calls).
  • One exciting wavelength into one band; scalar; said in left_out.

Engine

  • _simulate gains start (photons started in the water) and emit (a Raman photon recorded at each collision, its direction from a separate generator), and always returns the light at the surface from below and going down from it. With neither, it draws the same random numbers and returns the same results (checked before and after with flat, "one" and "all" surfaces).
  • monte_carlo_light_field's checks and the assembly of its result are moved to _checked and _assemble, shared with the new function.

Checks (set beforehand, section 156)

  1. The sun's light is bit for bit monte_carlo_light_field's (a test).
  2. Mobley et al.'s (1993) problem 7 through the same engine: all six entries of Table 6 agree (x over the four codes' mean 1.000 to 1.020).
  3. Open question 7's case through the public function: the reduction of Kd over 0-10 m agrees with 1.38.3's tool at 600, 675 and 700 nm within three combined standard errors.
  4. "quanta" is "energy" times wavelength_nm / excitation_nm to 1e-12. Adding the Raman loss to the exciting light's absorption lowers the Raman light; with b_r as measured the change (about 0.3 percent at 10 m) is inside test-sized noise, so the test uses b_r = 0.05 per metre (recorded in section 156).
  5. Every refusal, and the function in test_public_inputs.py's CALLS.

Found

Porto (1966), cited by Mobley et al. for the Raman phase function, gives its angular form but does not mention water; its 0.17 is a nitrobenzene line. Water's 0.17 is Marshall & Smith's, from their references (DATA.md section 56, a note; confirmed defects stay 15).

Documents

DATA.md section 56; API page; docs/choosing.rst; the depth-and-light topic page; README and .zenodo.json (56 entries; the Raman function); CHANGELOG; tools/raman_package_check.py and examples/data/raman_package/.

Tests

  • Full suite: 2215 passed and 1 failed (the count of public names in test_compatibility.py, 154 to 156), fixed in the last commit and that file rerun.
  • Outside the source tree (raman, monte_carlo, packaging, public_inputs, compatibility): 595 passed, 77 skipped.
  • ruff 0.15.20, mypy 1.20.2, sphinx -W clean.
  • Not run locally: the older NumPy and Python 3.13/3.14 jobs.

Generated by Claude Code

@tishibashi-cpu
tishibashi-cpu merged commit 8ea0f5b into main Dec 3, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant