PyHelios 0.1.11
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(ULeafOpticscreateLeafOptics (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.
 
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 = 9
 
int LEAF_OPTICS_SPECTRAL_POINTS = 2101
 
 argtypes
 
 restype
 
 errcheck
 
bool _LEAFOPTICS_FUNCTIONS_AVAILABLE
 
 createLeafOptics = mock_create
 
 leafOpticsRun = mock_method
 
 leafOpticsRunNoUUIDs = mock_method
 
 leafOpticsGetLeafSpectra = mock_method
 
 leafOpticsSetProperties = mock_method
 
 leafOpticsGetPropertiesFromSpectrum = mock_method
 
 leafOpticsGetPropertiesFromSpectrumSingle = mock_method
 
 leafOpticsGetPropertiesFromLibrary = 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 32 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 151 of file ULeafOpticsWrapper.py.

◆ destroyLeafOptics()

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

Destroy LeafOptics instance.

Definition at line 166 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 418 of file ULeafOpticsWrapper.py.

◆ leafOpticsDisableMessages()

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

Disable command-line output messages from LeafOptics.

Definition at line 373 of file ULeafOpticsWrapper.py.

◆ leafOpticsEnableMessages()

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

Enable command-line output messages from LeafOptics.

Definition at line 383 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 241 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 355 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 304 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 327 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 405 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 180 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 210 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 277 of file ULeafOpticsWrapper.py.

◆ mock_create()

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

Definition at line 424 of file ULeafOpticsWrapper.py.

◆ mock_method()

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

Definition at line 430 of file ULeafOpticsWrapper.py.

Variable Documentation

◆ _LEAFOPTICS_FUNCTIONS_AVAILABLE

bool pyhelios.wrappers.ULeafOpticsWrapper._LEAFOPTICS_FUNCTIONS_AVAILABLE
protected

Definition at line 128 of file ULeafOpticsWrapper.py.

◆ argtypes

pyhelios.wrappers.ULeafOpticsWrapper.argtypes

Definition at line 39 of file ULeafOpticsWrapper.py.

◆ createLeafOptics

pyhelios.wrappers.ULeafOpticsWrapper.createLeafOptics = mock_create

Definition at line 437 of file ULeafOpticsWrapper.py.

◆ errcheck

pyhelios.wrappers.ULeafOpticsWrapper.errcheck

Definition at line 41 of file ULeafOpticsWrapper.py.

◆ LEAF_OPTICS_PROPERTIES_COUNT

int pyhelios.wrappers.ULeafOpticsWrapper.LEAF_OPTICS_PROPERTIES_COUNT = 9

Definition at line 23 of file ULeafOpticsWrapper.py.

◆ LEAF_OPTICS_SPECTRAL_POINTS

int pyhelios.wrappers.ULeafOpticsWrapper.LEAF_OPTICS_SPECTRAL_POINTS = 2101

Definition at line 26 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetLeafSpectra

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetLeafSpectra = mock_method

Definition at line 440 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetPropertiesFromLibrary

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetPropertiesFromLibrary = mock_method

Definition at line 444 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetPropertiesFromSpectrum

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetPropertiesFromSpectrum = mock_method

Definition at line 442 of file ULeafOpticsWrapper.py.

◆ leafOpticsGetPropertiesFromSpectrumSingle

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsGetPropertiesFromSpectrumSingle = mock_method

Definition at line 443 of file ULeafOpticsWrapper.py.

◆ leafOpticsRun

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsRun = mock_method

Definition at line 438 of file ULeafOpticsWrapper.py.

◆ leafOpticsRunNoUUIDs

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsRunNoUUIDs = mock_method

Definition at line 439 of file ULeafOpticsWrapper.py.

◆ leafOpticsSetProperties

pyhelios.wrappers.ULeafOpticsWrapper.leafOpticsSetProperties = mock_method

Definition at line 441 of file ULeafOpticsWrapper.py.

◆ restype

pyhelios.wrappers.ULeafOpticsWrapper.restype

Definition at line 40 of file ULeafOpticsWrapper.py.