0.1.33
Loading...
Searching...
No Matches
pyhelios.SolarPosition Namespace Reference

Classes

class  SolarPosition
 High-level interface for solar position calculations and radiation modeling. More...
 
class  SolarPositionError
 Exception raised for SolarPosition-specific errors. More...
 

Functions

 _solarposition_working_directory ()
 Context manager that temporarily changes working directory to where SolarPosition assets are located.
 
SolarPosition create_solar_position (Context context, Optional[float] utc_offset=None, Optional[float] latitude=None, Optional[float] longitude=None)
 Create SolarPosition instance with context and optional coordinates.
 

Variables

 logger = logging.getLogger(__name__)
 

Function Documentation

◆ _solarposition_working_directory()

pyhelios.SolarPosition._solarposition_working_directory ( )
protected

Context manager that temporarily changes working directory to where SolarPosition assets are located.

SolarPosition C++ code opens the Prague sky model dataset through the hardcoded relative path "plugins/solarposition/lib/prague_sky_model/PragueSkyModelReduced.dat", so it is only resolvable when the process is running from the build directory. This manager temporarily changes to the build directory where the dataset actually lives.

Exceptions
RuntimeErrorIf the build directory or the Prague dataset are not found, indicating a build system error.

Definition at line 39 of file SolarPosition.py.

◆ create_solar_position()

SolarPosition pyhelios.SolarPosition.create_solar_position ( Context context,
Optional[float] utc_offset = None,
Optional[float] latitude = None,
Optional[float] longitude = None )

Create SolarPosition instance with context and optional coordinates.

Parameters
contextHelios Context
utc_offsetUTC time offset in hours (optional)
latitudeLatitude in degrees (optional)
longitudeLongitude in degrees (optional)
Returns
SolarPosition instance
Example
>>> solar = create_solar_position(context, utc_offset=-8, latitude=38.5, longitude=-121.7)

Definition at line 1129 of file SolarPosition.py.

Variable Documentation

◆ logger

pyhelios.SolarPosition.logger = logging.getLogger(__name__)

Definition at line 21 of file SolarPosition.py.