Environment class

Environment class

Environment configuration for BELLHOP.

This module provides dataclass-based environment configuration with automatic validation, replacing manual option checking with field validators.

class bellhop.environment.Environment(name: str = 'bellhop/python default', type: str = '2D', frequency: float = 25000.0, _num_media: int = 1, soundspeed: float | Any = 1500.0, soundspeed_interp: str = _Strings.linear, depth: float | Any = 25.0, depth_interp: str = _Strings.linear, _mesh_npts: int = 0, _depth_sigma: float = 0.0, depth_max: float | None = None, _bathymetry: str = _Strings.flat, _altimetry: str = _Strings.flat, _sbp_file: str = _Strings.default, bottom_interp: str | None = None, bottom_soundspeed: float = 1600.0, _bottom_soundspeed_shear: float = 0.0, bottom_density: float = 1600, bottom_attenuation: float | None = None, _bottom_attenuation_shear: float | None = None, bottom_roughness: float = 0.0, bottom_beta: float | None = None, bottom_transition_freq: float | None = None, bottom_boundary_condition: str = _Strings.acousto_elastic, bottom_reflection_coefficient: Any | None = None, surface: Any | None = None, surface_interp: str = _Strings.linear, surface_boundary_condition: str = _Strings.vacuum, surface_reflection_coefficient: Any | None = None, surface_depth: float = 0.0, surface_soundspeed: float = 1600.0, _surface_soundspeed_shear: float = 0.0, surface_density: float = 1000.0, surface_attenuation: float | None = None, _surface_attenuation_shear: float | None = None, source_type: str = 'default', source_depth: float | Any = 5.0, source_ndepth: int | None = None, source_directionality: Any | None = None, receiver_depth: float | Any = 10.0, receiver_range: float | Any = 1000.0, receiver_ndepth: int | None = None, receiver_nrange: int | None = None, beam_type: str = _Strings.default, beam_angle_min: float | None = None, beam_angle_max: float | None = None, beam_num: int = 0, single_beam_index: int | None = None, _single_beam: str = _Strings.default, step_size: float | None = 0.0, box_depth: float | None = None, box_range: float | None = None, grid_type: str = 'default', task: str | None = None, interference_mode: str | None = None, volume_attenuation: str = 'none', attenuation_units: str = 'frequency dependent', fg_salinity: float | None = None, fg_temperature: float | None = None, fg_pH: float | None = None, fg_depth: float | None = None)[source]

Dataclass for underwater acoustic environment configuration.

This class provides automatic validation of environment parameters, eliminating the need for manual checking of option validity.

These entries are either intended to be set or edited by the user, or with _ prefix are internal state read from a .env file or inferred by other data. Some others are ignored.

name: str = 'bellhop/python default'
type: str = '2D'
frequency: float = 25000.0
soundspeed: float | Any = 1500.0
soundspeed_interp: str = 'linear'
depth: float | Any = 25.0
depth_interp: str = 'linear'
depth_max: float | None = None
bottom_interp: str | None = None
bottom_soundspeed: float = 1600.0
bottom_density: float = 1600
bottom_attenuation: float | None = None
bottom_roughness: float = 0.0
bottom_beta: float | None = None
bottom_transition_freq: float | None = None
bottom_boundary_condition: str = 'acousto-elastic'
bottom_reflection_coefficient: Any | None = None
surface: Any | None = None
surface_interp: str = 'linear'
surface_boundary_condition: str = 'vacuum'
surface_reflection_coefficient: Any | None = None
surface_depth: float = 0.0
surface_soundspeed: float = 1600.0
surface_density: float = 1000.0
surface_attenuation: float | None = None
source_type: str = 'default'
source_depth: float | Any = 5.0
source_ndepth: int | None = None
source_directionality: Any | None = None
receiver_depth: float | Any = 10.0
receiver_range: float | Any = 1000.0
receiver_ndepth: int | None = None
receiver_nrange: int | None = None
beam_type: str = 'default'
beam_angle_min: float | None = None
beam_angle_max: float | None = None
beam_num: int = 0
single_beam_index: int | None = None
step_size: float | None = 0.0
box_depth: float | None = None
box_range: float | None = None
grid_type: str = 'default'
task: str | None = None
interference_mode: str | None = None
volume_attenuation: str = 'none'
attenuation_units: str = 'frequency dependent'
fg_salinity: float | None = None
fg_temperature: float | None = None
fg_pH: float | None = None
fg_depth: float | None = None
check() Environment[source]
to_dict() Dict[str, Any][source]

Return a dictionary representation of the environment.

copy() Environment[source]

Return a shallow copy of the environment.