GridData Module¶
Module containing PowerGAMA GridData class and sub-classes
Grid data and time-dependent profiles
-
class
powergama.GridData.
GridData
¶ Class for grid data storage and import
Methods
-
__init__
()¶ Create GridData object with data and methods for import and processing of PowerGAMA grid data
-
branchDistances
(R=6373.0)¶ computes branch distance from node coordinates, resuls in km
Uses haversine formula
Parameters: R : radius of the Earth
-
branchFromNodeIdx
()¶ get node indices for branch FROM node
-
branchToNodeIdx
()¶ get node indices for branch TO node
-
computePowerFlowMatrices
(baseZ)¶ Compute and return dc power flow matrices B’ and DA
Returns sparse matrices (csr - compressed sparse row matrix)
-
computePowerFlowMatricesOBSOLETE
(baseZ)¶ Compute and return dc power flow matrices B’ and DA
Returns sparse matrices (csr - compressed sparse row matrix)
-
dcBranchFromNodeIdx
()¶ get node indices for dc branch FROM node
-
dcBranchToNodeIdx
()¶ get node indices for dc branch TO node
-
getAllAreas
()¶ Return list of areas included in the grid model
-
getAllGeneratorTypes
(sort='fuelcost')¶ Return list of generator types included in the grid model
-
getConsumerAreas
()¶ List of areas for each consumer
-
getConsumersPerArea
()¶ Returns dictionary with indices of loads within each area
-
getDcBranches
()¶ Returns a list with DC branches in the format [index,from area,to area]
-
getDcBranchesAtNode
(nodeIdx, direction)¶ Indices of all DC branches attached to a particular node
-
getFlexibleLoadStorageCapacity
(consumer_indx)¶ flexible load storage capacity in MWh
-
getGeneratorAreas
()¶ List of areas for each generator
-
getGeneratorsAtNode
(nodeIdx)¶ Indices of all generators attached to a particular node
-
getGeneratorsPerAreaAndType
()¶ Returns dictionary with indices of generators within each area
-
getGeneratorsPerType
()¶ Returns dictionary with indices of generators per type
-
getGeneratorsWithPumpAtNode
(nodeIdx)¶ Indices of all pumps attached to a particular node
-
getGeneratorsWithPumpByArea
()¶ Returns dictionary with indices of generators with pumps within each area
-
getIdxBranchesWithFlowConstraints
()¶ Indices of branches with less than infinite branch capacity
-
getIdxConsumersWithFlexibleLoad
()¶ Indices of all consumers with flexible load
-
getIdxDcBranchesWithFlowConstraints
()¶ Indices of DC branches with less than infinite branch capacity
-
getIdxGeneratorsWithNonzeroInflow
()¶ Indices of all generators with nonzero inflow
-
getIdxGeneratorsWithPumping
()¶ Indices of all generators with pumping capacity
-
getIdxGeneratorsWithStorage
()¶ Indices of all generators with nonzero and non-infinite storage
-
getIdxNodesWithLoad
()¶ Indices of nodes that have load (consumer) attached to them
-
getInterAreaBranches
(area_from=None, area_to=None, acdc='ac')¶ Get indices of branches from and/or to specified area(s)
area_from = area from. Use None (default) to leave unspecifie area_to= area to. Use None (default) to leave unspecified acdc = ‘ac’ (default) for ac branches, ‘dc’ for dc branches
-
getLoadsAtNode
(nodeIdx)¶ Indices of all loads (consumers) attached to a particular node
-
getLoadsFlexibleAtNode
(nodeIdx)¶ Indices of all flexible nodes attached to a particular node
-
keys_powergama
= {'node': {'id': None, 'lon': None, 'lat': None, 'area': None}, 'branch': {'node_to': None, 'node_from': None, 'capacity': None, 'reactance': None}, 'generator': {'pmax': None, 'desc': '', 'inflow_ref': None, 'storval_time_ref': '', 'node': None, 'storage_cap': 0, 'storval_filling_ref': '', 'pump_efficiency': 0, 'storage_ini': 0, 'inflow_fac': None, 'pump_cap': 0, 'pmin': None, 'pump_deadband': 0, 'fuelcost': None, 'type': None, 'storage_price': 0}, 'consumer': {'flex_fraction': 0, 'flex_basevalue': 0, 'flex_storval_filling': '', 'demand_avg': None, 'flex_storagelevel_init': 0.5, 'flex_on_off': 0, 'node': None, 'flex_storval_time': '', 'flex_storage': 0, 'demand_ref': None}, 'dcbranch': {'node_to': None, 'node_from': None, 'capacity': None}}¶
-
keys_sipdata
= {'node': {'cost_scaling': None, 'id': None, 'lon': None, 'offshore': None, 'area': None, 'type': None, 'lat': None, 'existing': None}, 'branch': {'cost_scaling': None, 'max_newCap': -1, 'node_from': None, 'distance': -1, 'capacity': None, 'node_to': None, 'expand': None, 'capacity2': 0, 'type': None}, 'generator': {'pmax': None, 'inflow_ref': None, 'pavg': 0, 'p_maxNew': -1, 'node': None, 'pmax2': 0, 'inflow_fac': None, 'cost_scaling': 1, 'pmin': None, 'fuelcost': None, 'fuelcost_ref': None, 'type': None, 'expand': None}, 'consumer': {'node': None, 'demand_avg': None, 'emission_cap': -1, 'demand_ref': None}, 'dcbranch': {}}¶
-
numBranches
()¶
-
numConsumers
()¶
-
numDcBranches
()¶
-
numGenerators
()¶
-
numNodes
()¶
-
readGridData
(nodes, ac_branches, dc_branches, generators, consumers)¶ Read grid data from files into data variables
-
readProfileData
(filename, timerange, storagevalue_filling=None, storagevalue_time=None, timedelta=1.0)¶ Read profile (timeseries) into numpy arrays
-
readSipData
(nodes, branches, generators, consumers)¶ Read grid data for investment analysis from files (PowerGIM)
This is used with the grid investment module (PowerGIM)
time-series data may be used for consumer demand generator inflow (e.g. solar and wind) generator fuelcost (e.g. one generator with fuelcost = power price)
-
writeGridDataToFiles
(prefix)¶ Save data to new input files
-