0.1.39
Loading...
Searching...
No Matches
pyhelios.wrappers.ULeafOpticsWrapper Namespace Reference

Classes

class  ULeafOptics
 Opaque structure for LeafOptics C++ class. More...
 

Functions

 _check_error (result, func, args)
 Automatic error checking for all leaf optics functions.
 
ctypes.POINTER(ULeafOptics) createLeafOptics (ctypes.POINTER(UContext) context)
 Create LeafOptics instance.
 
None destroyLeafOptics (ctypes.POINTER(ULeafOptics) leafoptics)
 Destroy LeafOptics instance.
 
None leafOpticsRun (ctypes.POINTER(ULeafOptics) leafoptics, List[int] uuids, List[float] properties, str label)
 Run LeafOptics model and assign spectra to primitives.
 
None leafOpticsRunNoUUIDs (ctypes.POINTER(ULeafOptics) leafoptics, List[float] properties, str label)
 Run LeafOptics model without assigning to primitives.
 
Tuple[List[float], List[float], List[float]] leafOpticsGetLeafSpectra (ctypes.POINTER(ULeafOptics) leafoptics, List[float] properties)
 Get leaf reflectance and transmittance spectra.
 
None leafOpticsSetProperties (ctypes.POINTER(ULeafOptics) leafoptics, List[int] uuids, List[float] properties)
 Set leaf optical properties for primitives.
 
None leafOpticsGetPropertiesFromSpectrum (ctypes.POINTER(ULeafOptics) leafoptics, List[int] uuids)
 Get PROSPECT parameters from reflectivity spectrum for primitives.
 
None leafOpticsGetPropertiesFromSpectrumSingle (ctypes.POINTER(ULeafOptics) leafoptics, int uuid)
 Get PROSPECT parameters from reflectivity spectrum for a single primitive.
 
List[float] leafOpticsGetPropertiesFromLibrary (ctypes.POINTER(ULeafOptics) leafoptics, str species)
 Get leaf optical properties from the built-in species library.
 
None leafOpticsDisableMessages (ctypes.POINTER(ULeafOptics) leafoptics)
 Disable command-line output messages from LeafOptics.
 
None leafOpticsEnableMessages (ctypes.POINTER(ULeafOptics) leafoptics)
 Enable command-line output messages from LeafOptics.
 
None leafOpticsOptionalOutputPrimitiveData (ctypes.POINTER(ULeafOptics) leafoptics, str label)
 Selectively output primitive data for specific biochemical properties.
 
None leafOpticsRunNitrogen (ctypes.POINTER(ULeafOptics) leafoptics, List[int] uuids, List[float] params, int num_bins)
 Run nitrogen-based automatic leaf optics for leaf primitives.
 
None leafOpticsUpdateNitrogenBasedSpectra (ctypes.POINTER(ULeafOptics) leafoptics)
 Re-read leaf nitrogen for tracked primitives and reassign spectra where it changed.
 
bool is_leafoptics_nitrogen_available ()
 Check if the LeafOptics nitrogen-mode functions are available in the current library.
 
bool is_leafoptics_available ()
 Check if LeafOptics functions are available in the current library.
 
 mock_create (*args, **kwargs)
 
 mock_method (*args, **kwargs)
 

Variables

int LEAF_OPTICS_PROPERTIES_COUNT = 11
 
int LEAF_OPTICS_SPECTRAL_POINTS = 2101
 
int LEAF_OPTICS_NAUTO_FLOAT_COUNT = 14
 
 argtypes
 
 restype
 
 errcheck
 
bool _LEAFOPTICS_FUNCTIONS_AVAILABLE
 
bool _LEAFOPTICS_NITROGEN_FUNCTIONS_AVAILABLE
 
tuple _NITROGEN_NOT_AVAILABLE_MSG
 
 createLeafOptics = mock_create
 
 leafOpticsRun = mock_method
 
 leafOpticsRunNoUUIDs = mock_method
 
 leafOpticsGetLeafSpectra = mock_method
 
 leafOpticsSetProperties = mock_method
 
 leafOpticsGetPropertiesFromSpectrum = mock_method
 
 leafOpticsGetPropertiesFromSpectrumSingle = mock_method
 
 leafOpticsGetPropertiesFromLibrary = mock_method
 
 leafOpticsRunNitrogen = mock_method
 
 leafOpticsUpdateNitrogenBasedSpectra = mock_method
 

Function Documentation

◆ _check_error()

pyhelios.wrappers.ULeafOpticsWrapper._check_error ( result,
func,
args )
protected

Automatic error checking for all leaf optics functions.

Definition at line 40 of file ULeafOpticsWrapper.py.

◆ createLeafOptics()

ctypes.POINTER(ULeafOptics) pyhelios.wrappers.ULeafOpticsWrapper.createLeafOptics ( ctypes.POINTER(UContext) context)

Create LeafOptics instance.

Parameters
contextPointer to the Helios Context
Returns
Pointer to the created LeafOptics instance
Exceptions
NotImplementedErrorIf LeafOptics functions not available
ValueErrorIf context is None

Definition at line 196 of file ULeafOpticsWrapper.py.

◆ destroyLeafOptics()

None pyhelios.wrappers.ULeafOpticsWrapper.destroyLeafOptics ( ctypes.POINTER(ULeafOptics) leafoptics)

Destroy LeafOptics instance.

Definition at line 211 of file ULeafOpticsWrapper.py.

◆ is_leafoptics_available()

bool pyhelios.wrappers.ULeafOpticsWrapper.is_leafoptics_available ( )

Check if LeafOptics functions are available in the current library.

Definition at line 509 of file ULeafOpticsWrapper.py.

◆ is_leafoptics_nitrogen_available()

bool pyhelios.wrappers.ULeafOpticsWrapper.is_leafoptics_nitrogen_available ( )

Check if the LeafOptics nitrogen-mode functions are available in the current library.

Definition at line 504 of file ULeafOpticsWrapper.py.

◆ leafOpticsDisableMessages()

None pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsDisableMessages ( ctypes.POINTER(ULeafOptics) leafoptics)

Disable command-line output messages from LeafOptics.

Definition at line 418 of file ULeafOpticsWrapper.py.

◆ leafOpticsEnableMessages()

None pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsEnableMessages ( ctypes.POINTER(ULeafOptics) leafoptics)

Enable command-line output messages from LeafOptics.

Definition at line 428 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetLeafSpectra()

Tuple[List[float], List[float], List[float]] pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetLeafSpectra ( ctypes.POINTER(ULeafOptics) leafoptics,
List[float] properties )

Get leaf reflectance and transmittance spectra.

Parameters
leafopticsPointer to LeafOptics instance
propertiesList of 9 floats [numberlayers, brownpigments, chlorophyllcontent, carotenoidcontent, anthocyancontent, watermass, drymass, protein, carbonconstituents]
Returns
Tuple of (wavelengths, reflectivities, transmissivities) as lists of floats
  • wavelengths: 400-2500 nm at 1nm resolution (2101 points)
  • reflectivities: reflectance values at each wavelength
  • transmissivities: transmittance values at each wavelength

Definition at line 286 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetPropertiesFromLibrary()

List[float] pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetPropertiesFromLibrary ( ctypes.POINTER(ULeafOptics) leafoptics,
str species )

Get leaf optical properties from the built-in species library.

Parameters
leafopticsPointer to LeafOptics instance
speciesName of the species (case-insensitive). Available species: "default", "garden_lettuce", "alfalfa", "corn", "sunflower", "english_walnut", "rice", "soybean", "wine_grape", "tomato", "common_bean", "cowpea"
Returns
List of 9 floats [numberlayers, brownpigments, chlorophyllcontent, carotenoidcontent, anthocyancontent, watermass, drymass, protein, carbonconstituents]
Note
If species is not found, default properties are used and a warning is issued

Definition at line 400 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetPropertiesFromSpectrum()

None pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetPropertiesFromSpectrum ( ctypes.POINTER(ULeafOptics) leafoptics,
List[int] uuids )

Get PROSPECT parameters from reflectivity spectrum for primitives.

Parameters
leafopticsPointer to LeafOptics instance
uuidsList of primitive UUIDs to query
Note
Primitives without matching spectra are silently skipped

Definition at line 349 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetPropertiesFromSpectrumSingle()

None pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetPropertiesFromSpectrumSingle ( ctypes.POINTER(ULeafOptics) leafoptics,
int uuid )

Get PROSPECT parameters from reflectivity spectrum for a single primitive.

Parameters
leafopticsPointer to LeafOptics instance
uuidSingle primitive UUID to query
Note
If no matching spectrum is found, the primitive is silently skipped

Definition at line 372 of file ULeafOpticsWrapper.py.

◆ leafOpticsOptionalOutputPrimitiveData()

None pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsOptionalOutputPrimitiveData ( ctypes.POINTER(ULeafOptics) leafoptics,
str label )

Selectively output primitive data for specific biochemical properties.

By default, all biochemical properties are written as primitive data. Use this method to select only needed properties for better performance.

Parameters
leafopticsLeafOptics instance pointer
labelProperty label - one of: "chlorophyll", "carotenoid", "anthocyanin", "brown", "water", "drymass", "protein", "cellulose"
Note
Added in helios-core v1.3.59

Definition at line 450 of file ULeafOpticsWrapper.py.

◆ leafOpticsRun()

None pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsRun ( ctypes.POINTER(ULeafOptics) leafoptics,
List[int] uuids,
List[float] properties,
str label )

Run LeafOptics model and assign spectra to primitives.

Parameters
leafopticsPointer to LeafOptics instance
uuidsList of primitive UUIDs
propertiesList of 9 floats [numberlayers, brownpigments, chlorophyllcontent, carotenoidcontent, anthocyancontent, watermass, drymass, protein, carbonconstituents]
labelLabel for the spectra (appended to "leaf_reflectivity_" and "leaf_transmissivity_")

Definition at line 225 of file ULeafOpticsWrapper.py.

◆ leafOpticsRunNitrogen()

None pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsRunNitrogen ( ctypes.POINTER(ULeafOptics) leafoptics,
List[int] uuids,
List[float] params,
int num_bins )

Run nitrogen-based automatic leaf optics for leaf primitives.

Parameters
leafopticsPointer to LeafOptics instance
uuidsList of leaf primitive UUIDs (must belong to objects with "leaf_nitrogen_gN_m2" data)
paramsList of LEAF_OPTICS_NAUTO_FLOAT_COUNT floats [f_photosynthetic, N_to_Cab_coefficient, Car_to_Cab_ratio, numberlayers, anthocyancontent, brownpigments, watermass, drymass, protein, carbonconstituents, V2Z, fqe, reassignment_threshold, min_reassignment_change]
num_binsNumber of spectrum bins

Definition at line 472 of file ULeafOpticsWrapper.py.

◆ leafOpticsRunNoUUIDs()

None pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsRunNoUUIDs ( ctypes.POINTER(ULeafOptics) leafoptics,
List[float] properties,
str label )

Run LeafOptics model without assigning to primitives.

Parameters
leafopticsPointer to LeafOptics instance
propertiesList of 9 floats [numberlayers, brownpigments, chlorophyllcontent, carotenoidcontent, anthocyancontent, watermass, drymass, protein, carbonconstituents]
labelLabel for the spectra

Definition at line 255 of file ULeafOpticsWrapper.py.

◆ leafOpticsSetProperties()

None pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsSetProperties ( ctypes.POINTER(ULeafOptics) leafoptics,
List[int] uuids,
List[float] properties )

Set leaf optical properties for primitives.

Parameters
leafopticsPointer to LeafOptics instance
uuidsList of primitive UUIDs
propertiesList of 9 floats [numberlayers, brownpigments, chlorophyllcontent, carotenoidcontent, anthocyancontent, watermass, drymass, protein, carbonconstituents]

Definition at line 322 of file ULeafOpticsWrapper.py.

◆ leafOpticsUpdateNitrogenBasedSpectra()

None pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsUpdateNitrogenBasedSpectra ( ctypes.POINTER(ULeafOptics) leafoptics)

Re-read leaf nitrogen for tracked primitives and reassign spectra where it changed.

Definition at line 494 of file ULeafOpticsWrapper.py.

◆ mock_create()

pyhelios.wrappers.ULeafOpticsWrapper.mock_create ( * args,
** kwargs )

Definition at line 515 of file ULeafOpticsWrapper.py.

◆ mock_method()

pyhelios.wrappers.ULeafOpticsWrapper.mock_method ( * args,
** kwargs )

Definition at line 521 of file ULeafOpticsWrapper.py.

Variable Documentation

◆ _LEAFOPTICS_FUNCTIONS_AVAILABLE

bool pyhelios.wrappers.ULeafOpticsWrapper._LEAFOPTICS_FUNCTIONS_AVAILABLE
protected

Definition at line 136 of file ULeafOpticsWrapper.py.

◆ _LEAFOPTICS_NITROGEN_FUNCTIONS_AVAILABLE

bool pyhelios.wrappers.ULeafOpticsWrapper._LEAFOPTICS_NITROGEN_FUNCTIONS_AVAILABLE
protected

Definition at line 164 of file ULeafOpticsWrapper.py.

◆ _NITROGEN_NOT_AVAILABLE_MSG

tuple pyhelios.wrappers.ULeafOpticsWrapper._NITROGEN_NOT_AVAILABLE_MSG
protected

Definition at line 175 of file ULeafOpticsWrapper.py.

◆ argtypes

pyhelios.wrappers.ULeafOpticsWrapper.argtypes

Definition at line 47 of file ULeafOpticsWrapper.py.

◆ createLeafOptics

pyhelios.wrappers.ULeafOpticsWrapper.createLeafOptics = mock_create

Definition at line 528 of file ULeafOpticsWrapper.py.

◆ errcheck

pyhelios.wrappers.ULeafOpticsWrapper.errcheck

Definition at line 49 of file ULeafOpticsWrapper.py.

◆ LEAF_OPTICS_NAUTO_FLOAT_COUNT

int pyhelios.wrappers.ULeafOpticsWrapper.LEAF_OPTICS_NAUTO_FLOAT_COUNT = 14

Definition at line 34 of file ULeafOpticsWrapper.py.

◆ LEAF_OPTICS_PROPERTIES_COUNT

int pyhelios.wrappers.ULeafOpticsWrapper.LEAF_OPTICS_PROPERTIES_COUNT = 11

Definition at line 25 of file ULeafOpticsWrapper.py.

◆ LEAF_OPTICS_SPECTRAL_POINTS

int pyhelios.wrappers.ULeafOpticsWrapper.LEAF_OPTICS_SPECTRAL_POINTS = 2101

Definition at line 28 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetLeafSpectra

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetLeafSpectra = mock_method

Definition at line 531 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetPropertiesFromLibrary

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetPropertiesFromLibrary = mock_method

Definition at line 535 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetPropertiesFromSpectrum

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetPropertiesFromSpectrum = mock_method

Definition at line 533 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetPropertiesFromSpectrumSingle

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetPropertiesFromSpectrumSingle = mock_method

Definition at line 534 of file ULeafOpticsWrapper.py.

◆ leafOpticsRun

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsRun = mock_method

Definition at line 529 of file ULeafOpticsWrapper.py.

◆ leafOpticsRunNitrogen

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsRunNitrogen = mock_method

Definition at line 536 of file ULeafOpticsWrapper.py.

◆ leafOpticsRunNoUUIDs

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsRunNoUUIDs = mock_method

Definition at line 530 of file ULeafOpticsWrapper.py.

◆ leafOpticsSetProperties

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsSetProperties = mock_method

Definition at line 532 of file ULeafOpticsWrapper.py.

◆ leafOpticsUpdateNitrogenBasedSpectra

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsUpdateNitrogenBasedSpectra = mock_method

Definition at line 537 of file ULeafOpticsWrapper.py.

◆ restype

pyhelios.wrappers.ULeafOpticsWrapper.restype

Definition at line 48 of file ULeafOpticsWrapper.py.