Skip to content

[3DATM 5/7] Support 3D parametrization of particle layers OT and extent. Rename to "layer" to "ensemble" - #588

Closed
wint3ria wants to merge 10 commits into
eradiate:nextfrom
wint3ria:partlay3d
Closed

wint3ria wants to merge 10 commits into
eradiate:nextfrom
wint3ria:partlay3d

Conversation

@wint3ria

@wint3ria wint3ria commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adapt the ParticleLayer class to 3D grids. The class is now named ParticleEnsemble, referring the the unique distribution of particles shape shape they represent. This class can now handles variability in its geometry and OT alongside the X and Y coordinates of the scene.

The vertical extent of the ParticleEnsemble can vary
image

Optical thickness can accept a 2D array of the shape of the grid's X and Y coordinates
image

ArrayDistribution class is also adapted to support X and Y dimensions
image

This class can be used for parametric configuration of 3D particles plumes geometry. Examples taken from eradiate/eradiate-tutorials#5

Checklist

  • The code follows the relevant coding guidelines
  • The code generates no new warnings
  • The code is appropriately documented
  • The code is tested to prove its function
  • The feature branch is rebased on the current state of the main branch
  • I updated the change log if relevant
  • I give permission that the Eradiate project may redistribute my contributions under the terms of its license

@wint3ria
wint3ria changed the base branch from main to next July 31, 2026 15:53
@wint3ria wint3ria changed the title [WIP] [5/7] Partlay3d [WIP] [3DATM 5/7] Support 3D spatially varying extent and optical thickness in homogeneous particle layers Jul 31, 2026
@wint3ria wint3ria changed the title [WIP] [3DATM 5/7] Support 3D spatially varying extent and optical thickness in homogeneous particle layers [WIP] [3DATM 5/7] Support 3D parametrization of geometry and OT of homogeneous particle layers Aug 11, 2026
@wint3ria
wint3ria force-pushed the partlay3d branch 3 times, most recently from a4bbd95 to 3c3340d Compare August 13, 2026 19:56
@wint3ria wint3ria changed the title [WIP] [3DATM 5/7] Support 3D parametrization of geometry and OT of homogeneous particle layers [3DATM 5/7] Support 3D parametrization of geometry and OT of homogeneous particle layers Aug 13, 2026
This support is enabled in the ParticleProperties class itself and its
conversion function. ParticleProperties can now encapsulate aer_v2 or
prt_v1 formatted dataset
netCDF4's C extension mutates an array's .shape attribute in place when
writing datasets, which NumPy 2.5 now deprecates. This turns into a hard
test failure since filterwarnings = ["error"]. Unrelated to any of our
changes; affects the whole regression suite.
Introduces two new modules that together replace the old ZGrid
altitude-only facility with a proper grid abstraction usable by both
plane-parallel and spherical-shell geometries:

 - eradiate.grid: GridCoords and its PlaneParallelGridCoords /
   SphericalShellGridCoords subclasses, describing an atmosphere's
   spatial extent and discretization in 3D. The coordinates are
   regular in all 3 dimensions.
 - eradiate.scenes._gridvolume: generate_gridvolume(), factorizing the
   Mitsuba gridvolume/sphericalcoordsvolume dictionary construction
   that used to be hand-rolled (and duplicated per geometry type) in
   AtmosphericMedium._template_medium/_params_medium.
…mosphere stack

Migrates every remaining ZGrid consumer onto the grid foundation and
gridvolume facility introduced in the previous commit:
AbstractHeterogeneousAtmosphere and its concrete subclasses
(HeterogeneousAtmosphere, MolecularAtmosphere, ParticleLayer) all
accept and forward a `grid` argument through their eval_albedo/
eval_sigma_t/eval_sigma_a/eval_sigma_s methods instead of `zgrid`, and
radprops mirrors the same signatures for RadProfile.

Adds test coverage for radprops._atmosphere's grid-shape validation and
level-to-layer averaging helpers (_validate_thermoprops_grid_shape,
_average_adjacent_levels, _layers_from_levels), generalized here to
x/y/z rather than z only.
…metries for notebook cells rendering

Provide a small module that render a schematic vizualisation of grids
and geometries for notebook representation. It only uses base libraries
and does not perform expensive matplotlib operation. Generating the SVG
is done using the xml module. The rendering is the cost of the xml
serialization and HTML render in the browser.
…volume facility

This introduces eradiate.scenes.phase._multi.MultiPhaseFunction, a
replacement for the deprecated BlendPhaseFunction, and removes _blend.py
entirely. The new implementation blends an arbitrary number of phase
function components using per-component weight grids instead of
hand-rolling DictParameter/mi.VolumeGrid construction per geometry
type.

RayleighPhaseFunction is updated : its depolarization-factor
volume construction now goes through generate_gridvolume() as
well.

HeterogeneousAtmosphere.phase is updated to build a MultiPhaseFunction
instead of a BlendPhaseFunction for its multi-component case.
Tests are updated for the new kernel
parameter naming scheme.
Rename the class ParticleLayer (1D concept) to ParticleEnsemble.
Ensemble refers to the common physical properties of the particles,
while their optical thickness and spatial extent may vary in 3D.
ParticleEnsemble.bottom .top and .tau_ref can now vary spatially across
a horizontal 2D plane.

 - eval_fractions computes, for each horizontal cell, an independent
1D vertical fraction profile using that cell's own bottom/top/tau_ref,
normalizing per-column rather than globally.
 - _eval_albedo_impl/_eval_sigma_t_impl/_eval_sigma_s_impl/
_eval_sigma_a_impl are rewritten around broadcasting instead of the
1D assumptions.
 - ArrayParticleDistribution now accepts 3D arrays (one distribution
per horizontal cell)
 - validators.is_positive now broadcasts over array-valued fields
instead of assuming a scalar.
@wint3ria wint3ria changed the title [3DATM 5/7] Support 3D parametrization of geometry and OT of homogeneous particle layers [3DATM 5/7] Support 3D parametrization of particle layers OT and extent. Rename to "layer" to "ensemble" Aug 24, 2026
@wint3ria wint3ria self-assigned this Aug 24, 2026
@wint3ria
wint3ria marked this pull request as ready for review August 24, 2026 16:48
@wint3ria

wint3ria commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Closed to prefer a stacked PR structure

@wint3ria wint3ria closed this Sep 4, 2026
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