Reference¶
Amun Session¶
-
class
APISession
(base_url=None, token=None)¶ Internal class to hold base methods for interacting with the Aurora HTTP API
-
class
AmunSession
(base_url=None, token=None)¶ Manage access to the Amun API.
By default the session will connect to the production Amun API endpoint. This can be overridden by passing the base_url into the constructor or by setting the environment variable AURORA_API_BASE_URL. This is for internal use only.
The authentication token is read from the users home directory $home/.aurora-api-key e.g. C:/Users/Joe Bloggs/.aurora-api-key. This can be overridden by passing the token into the constructor or by setting the environment variable AURORA_API_KEY.
- Parameters
base_url (string, optional) – Override the base url used to contact the Amun API. Defaults to None.
token (string, optional) – Overide the api authentication token used for API access. Defaults to None.
-
get_region_details
(latitude: float, longitude: float) → List[aurora.amun.client.responses.RegionDetail]¶ Get a list of supported regions for a given point.
- Parameters
latitude (float) – latitude of the point to lookup.
longitude (float) – longitude
- Returns
A list of all the supported regions for the point.
- Return type
List[RegionDetail]
-
get_scenarios
(region)¶ - Get the scenarios that are available for the specified region. The regions for a given location
to use can be found be using
AmunSession.get_region_details()
- Parameters
region (str) – The code for the region to lookup scenarios for.
- Returns
List of Scenario details.
Response:
[{ 'id': 3, 'name': '2019 Smart Power Scenario', 'description': 'To examine the impact of a smarter power system with more flexible capacity and demand', 'region': 'gbr', 'S3uri': None, 'currency': 'GBP', 'currencyYear': 2018, 'hasFile': False },.....
-
get_turbines
()¶ Get the turbines available to the user.
Response:
[{ 'id': 29, 'manufacturer': 'EWT Directwind', 'name': 'EWT Directwind 2000/96', 'ratedCapacity': 2, 'rotorDiameter': 96, 'minHubHeight': None, 'maxHubHeight': None, 'cutInSpeed': 3.5, 'cutOutSpeed': 25, 'specSource': 'https://www.thewindpower.net/turbine_en_879_ewt_directwind-2000-96.php', 'type': 'public', },........
-
get_wind
(lat, lon, year, dataset)¶ The parameters used for built in wind calculations (era5,*merra2*,*newa*).
Note
Not all locations support all wind types and not all locations support Regional Reanalysis Correction.
- Parameters
latitude (float) – The latitude of the point (-90 to 90).
longitude (float) – The latitude of the point (-180 to 180).
dataset (str) – one of (“Era5”,”Merra2”,”NEWA”)
year (number) – The year to fetch wind data for.
-
get_wind_atlas
(lat, lon, radius, numberOfTurbines, rotorDiameterInMeters, regionCode)¶ The parameters used for built in wind calculations (era5,*merra2*,*newa*).
Note
Not all locations are supported.
- Parameters
latitude (float) – The latitude of the point (-90 to 90).
longitude (float) – The latitude of the point (-180 to 180).
radius (int) – The radius of the area to average wind speed over 0 to 1000.
numberOfTurbines (int) – If no radius specified this is required to allow the size of the windfarm to be estimated.
rotorDiameterInMeters (int) – The rotor diameter of the turbines used to calculate size of the windfarm from the number of turbines if None a default value is used.
-
get_windfarm
(uuid)¶ Get windfarm by uuid Note:
- Parameters
search (uuid) – uuid of windfarm to get.
-
get_windfarms
(search)¶ Search for windfarms Note:
- Parameters
search (string) – Search term to filter by.
-
run_load_factor_calculation
(load_factor_configuration: Dict)¶ Calculate the load factor and wind speeds for a year given a start time and a location.
See also
AmunSession.get_region_details()
to get region codes and available datasets for a point- Parameters
load_factor_configuration (Dict) – A dictionary of load factor parameters.
- Returns
A Dictionary with the keys
parameters
appliedParams
typicalHourly
weatherYearHourly
- Return type
Dictionary
-
run_load_factor_for_parameters
(flow_parameters: aurora.amun.client.parameters.FlowParameters, base_parameters: aurora.amun.client.parameters.LoadFactorBaseParameters)¶ Calculate the load factor and wind speeds for a year given a start time and a location.
See also
AmunSession.get_region_details()
to get region codes and available datasets for a point- Parameters
flow_parameters (FlowParameters) –
The parameters specific to the calculation type
base_parameters (LoadFactorBaseParameters) – The parameters required for all flows to the calculation type.
- Returns
A Dictionary with the keys
parameters
appliedParams
typicalHourly
weatherYearHourly
- Return type
Dictionary
Parameters used in requests¶
-
class
AverageWindSpeedParameters
(averageWindSpeed: float, measurementHeight: float)¶ The parameters required for a AverageWindSpeed calculation.
- Parameters
averageWindSpeed (float) – The average wind speed of your site to use as calibration (m/s)
measurementHeight (float) – The height at which the measurements were taken (m)
-
class
BuiltInWindParameters
(windType: aurora.amun.client.parameters.WindType, useReanalysisCorrection: bool = None, reanalysisScaleCorrectionDelta: float = None)¶ The parameters used for built in wind calculations.
Note
Not all locations support all wind types and not all locations support Regional Reanalysis Correction.
- Parameters
windType (WindType) – one of (WindType.Era5,WindType.Merra2,WindType.NEWA)
useReanalysisCorrection (bool, optional) – Should Regional Reanalysis Correction be enabled. If true then a location
reanalysisScaleCorrectionDelta is used. Defaults to None. (specific) –
reanalysisScaleCorrectionDelta (float, optional) – Override the location specific reanalysisScaleCorrectionDelta.
has no effect if reanalysisScaleCorrectionDelta is false. Defaults to None. (This) –
-
class
FlowParameters
(windType: aurora.amun.client.parameters.WindType)¶ Base class for a flow. Internal Use only.
- Parameters
windType (WindType) – All flows must define a unique windtype as defined by the Amun http API.
-
class
LoadFactorBaseParameters
(turbineModelId: int, latitude: float, longitude: float, startTimeUTC: str, regionCode: str, hubHeight: float, obstacleHeight: float, numberOfTurbines: int, roughnessLength: float = None, usePowerCurveSmoothing: bool = None, smoothingCoefficient: float = None, lossesWake: float = 0.0, lossesAvailability: float = 0.0, lossesElectrical: float = 0.0, lossesTurbinePerformance: float = 0.0, lossesEnvironmental: float = 0.0, lossesOtherCurtailment: float = 0.0)¶ Parameters for all wind types.
Note
Not all regions/locations support Multi-Turbine Power Curve Smoothing.
- Parameters
turbineModelId (int) – The Id of the Turbine to use in the calculation as returned from
AmunSession.get_turbines()
.latitude (float) – The latitude of the point (-90 to 90).
longitude (float) – The latitude of the point (-180 to 180).
startTimeUTC (str) – The time in UTC that the calcution should start from. This must be in the form ‘2016-07-28T00:00:00.000Z’ .
regionCode (str) – The code for the region used to set region specific parameters.
hubHeight (float) – Given in meters (m).
obstacleHeight (float) – Given in meters (m).
numberOfTurbines (int) – The number of turbines in the site.
roughnessLength (float, optional) – Static roughness. If not given, will be derived from reanalysis data. Defaults to None.
usePowerCurveSmoothing (bool, optional) – Should Default Multi-Turbine Power Curve Smoothing be used in the calculation if true then a region specific scale factor is used. If None then no smoothing is applied Defaults to None.
smoothingCoefficient (float) – The value to use for smoothing. This will override any region specific values. This has no effect unless usePowerCurveSmoothing is true.
lossesWake (float) – The percentage to apply for wake loss. (0 <= lossesWake < 1)
lossesAvailability (float) – Percentage for external losses. (0 <= lossesAvailability < 1)
lossesElectrical (float) – Percentage for external losses. (0 <= lossesElectrical < 1)
lossesTurbinePerformance (float) – Percentage for external losses. (0 <= lossesTurbinePerformance < 1)
lossesEnvironmental (float) – Percentage for external losses. (0 <= lossesEnvironmental < 1)
lossesOtherCurtailment (float) – Percentage for external losses. (0 <= lossesOtherCurtailment < 1)
-
class
P50ScalingParameters
(p50GrossProduction: float)¶ The parameters required for a P50Scaling calculation.
- Parameters
p50GrossProduction (float, 0 < p50GrossProduction < 1) – the P50 load factor which represents the long-term production potential of this site, typically from an energy assessment report, will be used to calibrate the underlying reanalysis wind speed, such that the long-term production potential used in Amun-based valuations are the same.
-
class
P50YieldScalingParameters
(annualProductionInGWHours: float)¶ The parameters required for a P50YieldScaling calculation.
- Parameters
annualProductionInGWHours (float, 0 < annualProductionInGWHours < 1000000) – the production expected by the site in a year in Gigawatt Hours.
-
class
PowerDensityParameters
(averagePowerDensity: float, measurementHeight: float)¶ The parameters required for a PowerDensity calculation.
- Parameters
averagePowerDensity (float) – The average power density of your site to use as calibration (W/m2)
measurementHeight (float) – The height at which the measurements were taken (m)
-
class
SpeedAtHeight
(height: float, speeds: List[float])¶ The wind speeds at a given height,
- Parameters
height (float) – The measurement height (m) of the wind speeds.
speeds (List[float]) – A list of wind speeds in m/s.
-
class
UploadedWindParameters
(uploadedWindStartTime: str, lowHeight: aurora.amun.client.parameters.SpeedAtHeight, highHeight: aurora.amun.client.parameters.SpeedAtHeight = None, granularityInMins: int = 60)¶ The parameters required to run a custom (uploaded) load factor calculation. If highHeight is specified it must be the same length as the lowHeight and be measured at a greater height. The speeds upload should be hourly measurements starting at uploadedWindStartTime and span at least 1 year.
- Parameters
uploadedWindStartTime (str) – The time in UTC that the wind speeds upload start from. This must be in the form ‘2016-07-28T00:00:00.000Z’ .
lowHeight (SpeedAtHeight) – The height and speed for the low height wind speed to upload.
highHeight (SpeedAtHeight, optional) – The height and speed for the high height wind speed to upload. Defaults to None.
-
class
WeibullParameters
(weibullShape: float, weibullScale: float, measurementHeight: float)¶ The parameters required for a Weibull calculation.
- Parameters
weibullShape (float) – The long term shape parameter from your wind report
weibullScale (float) – The long term scale parameter from your wind report
measurementHeight (float) – The height at which the measurements were taken (m)
-
class
WindType
(value)¶ The types of wind to use in calculations
-
AuroraWindAtlas
= 'AuroraWindAtlas'¶ Uses the reanalysis dataset calibrated using the AmunWindAtlas. Check the region details endpoint for dataset availability.
-
AverageWindSpeed
= 'AverageWindSpeed'¶
-
CalibratedGeneration
= 'CalibratedGeneration'¶
-
Era5
= 'Era5'¶ Uses the raw reanalysis dataset Era5. Check the region details endpoint for dataset availability.
-
Generation
= 'Generation'¶
-
Merra2
= 'Merra2'¶ Uses the raw reanalysis dataset Merra2. Check the region details endpoint for dataset availability.
-
NEWA
= 'NEWA'¶ Uses the raw reanalysis dataset NEWA. Check the region details endpoint for dataset availability.
-
P50Scaling
= 'P50Scaling'¶
-
P50YieldScaling
= 'P50YieldScaling'¶
-
PowerDensity
= 'PowerDensity'¶
-
UploadedWind
= 'UploadedWind'¶
-
Weibull
= 'Weibull'¶
-
Response types¶
-
class
RegionDetail
(pmfCode: str, defaultWind: str, availableDatasets: List[str], era5CorrectionEnabled: bool, powerCurveSmoothingEnabled: bool)¶ The details about a region required to construct valid valuation and load factor requests.
- Parameters
pmfCode (str) – The regionCode to use when required to look up more details e.g. which scenarios are available.
AmunSession.get_scenarios()
defaultWind (str) – The dataset used by default in calculations
availableDatasets (List[str]) – A list of datasets that are available for the region.
era5CorrectionEnabled (bool) – Is era5 correction available for the region.
powerCurveSmoothingEnabled (bool) – Is power curve smoothing available for the region.