Methods - Internal
Index
EnergyModelsLanguageInterfaces.bio_typeEnergyModelsLanguageInterfaces.cleanup_librariesEnergyModelsLanguageInterfaces.electricity_resourceEnergyModelsLanguageInterfaces.get_pvgis_dataEnergyModelsLanguageInterfaces.get_python_functionEnergyModelsLanguageInterfaces.getfirstEnergyModelsLanguageInterfaces.moistureEnergyModelsLanguageInterfaces.pvgis_profileEnergyModelsLanguageInterfaces.@dlsym
Utility methods
EnergyModelsLanguageInterfaces.cleanup_libraries — Function
cleanup_libraries()Close all the C module libraries that have been loaded by EnergyModelsLanguageInterfaces.
EnergyModelsLanguageInterfaces.getfirst — Function
getfirst(f::Function, a::Vector)Return the first element of Vector a satisfying the requirement of Function f.
EnergyModelsLanguageInterfaces.get_python_function — Function
get_python_function(module_name::String, function_name::String)Import the requested function function_name from the python module module_name.
EnergyModelsLanguageInterfaces.moisture — Function
bio_type(p::ResourceBio)Returns the moisture content of a ResourceBio p.
EnergyModelsLanguageInterfaces.bio_type — Function
bio_type(p::ResourceBio)Returns the biomass type of a ResourceBio p.
EnergyModelsLanguageInterfaces.electricity_resource — Function
electricity_resource(n::BioCHP)Returns the electricity resource of BioCHP node n.
EnergyModelsLanguageInterfaces.pvgis_profile — Function
pvgis_profile(time_start::DateTime, params::PVParameters;
peakpower::Real=1.0,
data_path::String = "pvgis_cache",
filename_hint::String = "",
normalize::Bool = true,
no_weather_years::Int = 1,
remove_leap_day::Bool = true,
)Fetches hourly photovoltaic (PV) power output data for a specified start time (time_start), PV system parameters (params), and additional options, using the PVGIS seriescalc API. The function caches the results locally in a CSV file to optimize subsequent calls.
The actual call to the PVGIS API is handled by the helper function get_pvgis_data see get_pvgis_data for details.
Arguments
time_start::DateTime: The start of the time range for which the PV output data is requested.params::PVParameters: Struct containing PV system and location parameters (e.g., latitude, longitude, peak power, technology, etc.).peakpower::Real=1.0: Nominal peak power of the PV system in kilowatts (kW).data_path::String="pvgis_cache": Directory where the cached CSV file will be stored.filename_hint::String="": Optional string to include in the cache file name for identification.normalize::Bool=true: Whether to normalize the power output by the peak power (i.e., return values between 0 and 1).no_weather_years::Int=1: Number of years of weather data to fetch.remove_leap_day::Bool=true: Whether to remove February 29th from the results.
Returns
A DataFrame containing the following columns:
:time_utc: Timestamps in UTC, rounded to the nearest hour.:pv: PV power output in kilowatts (kW), normalized if requested.
EnergyModelsLanguageInterfaces.get_pvgis_data — Function
get_pvgis_data(start_year::Int64, end_year::Int64, params::PVParameters, peakpower::Real, normalize::Bool)Arguments
start_year::Int64: The starting year for the PVGIS data request.end_year::Int64: The ending year for the PVGIS data request.params::PVParameters: Struct containing PV system and location parameters (e.g., latitude, longitude, technology, etc.).peakpower::Real = 1.0: Nominal peak power of the PV system in kilowatts (kW).normalize::Bool = true: Whether to normalize the power output by the peak power.
Fetches hourly photovoltaic (PV) power output data for the specified years and PV system parameters using the PVGIS seriescalc API.
Details
The function queries the PVGIS seriescalc API, which provides hourly PV power output data based on the specified location, system parameters, and meteorological data. The API calculates the power output using the following inputs:
- Solar radiation data.
- PV system parameters (e.g., peak power, technology, mounting type).
- Meteorological data (e.g., air temperature, wind speed).
The response includes hourly data for the specified years, which is parsed and processed into a DataFrame. The power output is converted from watts (W) to kilowatts (kW) for better readability.
Caching
The results are cached locally in a CSV file to avoid redundant API calls. The cache file is stored in the specified data_path directory, and its name includes the date, number of years, and an optional filename_hint.
Macros
EnergyModelsLanguageInterfaces.@dlsym — Macro
@dlsym(lib, func)This macro uses dlsym to load a function from a shared library specified by lib and func. It caches the result in a Ref to avoid repeated lookups. If the symbol is already loaded, it returns the cached pointer. Otherwise, it loads the symbol, caches it, and then returns the pointer.