pub struct Zone {
pub label: Option<String>,
pub zone_type: ZoneType,
pub scheme: Scheme,
pub bins: Vec<SolidAngleBin>,
pub field_2d: Vec<ScattResult2D>,
pub field_1d: Option<Vec<ScattResult1D>>,
pub params: Params,
}Expand description
A zone represents a region of the scattering sphere with its own binning, results, and computed parameters.
Fields§
§label: Option<String>Optional user-provided label.
zone_type: ZoneTypeThe type of zone (Full, Forward, Backward, Custom).
scheme: SchemeThe binning scheme for this zone.
bins: Vec<SolidAngleBin>Generated bins for this zone.
field_2d: Vec<ScattResult2D>2D scattering results (one per bin).
field_1d: Option<Vec<ScattResult1D>>1D scattering results (integrated over phi), if applicable.
params: ParamsZone-specific computed parameters.
Implementations§
Source§impl Zone
impl Zone
Sourcepub fn new(
zone_type: ZoneType,
bins: Vec<SolidAngleBin>,
field_2d: Vec<ScattResult2D>,
field_1d: Option<Vec<ScattResult1D>>,
) -> Self
pub fn new( zone_type: ZoneType, bins: Vec<SolidAngleBin>, field_2d: Vec<ScattResult2D>, field_1d: Option<Vec<ScattResult1D>>, ) -> Self
Create a new zone with explicit fields.
Sourcepub fn from_config(config: &ZoneConfig) -> Self
pub fn from_config(config: &ZoneConfig) -> Self
Create a new zone from a config, generating bins and initializing empty results.
Sourcepub fn forward() -> Self
pub fn forward() -> Self
Create a forward scattering zone (single bin at theta≈0). Uses theta=ZONE_THETA_OFFSET to avoid singularity at exact zero.
Sourcepub fn backward() -> Self
pub fn backward() -> Self
Create a backscatter zone (single bin at theta≈180). Uses theta=180-ZONE_THETA_OFFSET to avoid singularity at exact 180.
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Get a display name for this zone.
Sourcepub fn compute_params(
&mut self,
wavelength: f32,
absorbed: f32,
global_params: &Params,
)
pub fn compute_params( &mut self, wavelength: f32, absorbed: f32, global_params: &Params, )
Compute zone-specific parameters based on zone type.
- Full: scatt_cross, ext_cross, asymmetry, albedo
- Forward: ext_cross_optical_theorem
- Backward: backscatter_cross, depolarization_ratio, lidar_ratio
- Custom: nothing (for now)
Source§impl Zone
impl Zone
Sourcepub fn get_zone_type(&self) -> ZoneType
pub fn get_zone_type(&self) -> ZoneType
Get the zone type
Sourcepub fn get_num_bins(&self) -> usize
pub fn get_num_bins(&self) -> usize
Get the number of bins in this zone
Sourcepub fn get_bins<'py>(&self, py: Python<'py>) -> Bound<'py, PyArray2<f32>> ⓘ
pub fn get_bins<'py>(&self, py: Python<'py>) -> Bound<'py, PyArray2<f32>> ⓘ
Get the bins as a numpy array of shape (n_bins, 2) with columns [theta, phi]
Sourcepub fn get_mueller<'py>(&self, py: Python<'py>) -> Bound<'py, PyArray2<f32>> ⓘ
pub fn get_mueller<'py>(&self, py: Python<'py>) -> Bound<'py, PyArray2<f32>> ⓘ
Get the Mueller matrix as a numpy array of shape (n_bins, 16)
Sourcepub fn get_mueller_1d<'py>(
&self,
py: Python<'py>,
) -> Option<Bound<'py, PyArray2<f32>>>
pub fn get_mueller_1d<'py>( &self, py: Python<'py>, ) -> Option<Bound<'py, PyArray2<f32>>>
Get the 1D Mueller matrix as a numpy array (if available)
Sourcepub fn get_bins_1d<'py>(
&self,
py: Python<'py>,
) -> Option<Bound<'py, PyArray1<f32>>>
pub fn get_bins_1d<'py>( &self, py: Python<'py>, ) -> Option<Bound<'py, PyArray1<f32>>>
Get the 1D theta bins as a numpy array (if available)
Sourcepub fn get_params(&self) -> PyResult<Py<PyAny>>
pub fn get_params(&self) -> PyResult<Py<PyAny>>
Get zone-specific parameters as a dict
Trait Implementations§
Source§impl Convergeable for Zone
impl Convergeable for Zone
Source§fn weighted_add(&self, other: &Self, w1: f32, w2: f32) -> Self
fn weighted_add(&self, other: &Self, w1: f32, w2: f32) -> Self
Source§fn to_weighted(&self) -> Self
fn to_weighted(&self) -> Self
impl DerefToPyAny for Zone
impl ExtractPyClassWithClone for Zone
Source§impl<'py> IntoPyObject<'py> for Zone
impl<'py> IntoPyObject<'py> for Zone
Source§type Output = Bound<'py, <Zone as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <Zone as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClassImpl for Zone
impl PyClassImpl for Zone
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// A zone represents a region of the scattering sphere with its own binning,
/// results, and computed parameters.
const RAW_DOC: &'static CStr = /// A zone represents a region of the scattering sphere with its own binning, /// results, and computed parameters.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<Zone>
type ThreadChecker = SendablePyClass<Zone>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyMethods<Zone> for PyClassImplCollector<Zone>
impl PyMethods<Zone> for PyClassImplCollector<Zone>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for Zone
impl PyTypeInfo for Zone
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Auto Trait Implementations§
impl Freeze for Zone
impl RefUnwindSafe for Zone
impl Send for Zone
impl Sync for Zone
impl Unpin for Zone
impl UnsafeUnpin for Zone
impl UnwindSafe for Zone
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, 'py, T> FromPyObject<'a, 'py> for T
impl<'a, 'py, T> FromPyObject<'a, 'py> for T
impl<'py, T> FromPyObjectOwned<'py> for Twhere
T: for<'a> FromPyObject<'a, 'py>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.