Model Data

Output Data Load

Model outputs are stored in .arrow files. These files are non-human-readable, but are significantly faster to process compared to other formats like CSV or XLXS. To further process model results, they can be read-in by calling the DataFiles constructor

POMATWO.DataFilesType
DataFiles

A container for loading and storing output data related to a model run. Each field corresponds to a specific dataset represented as a DataFrame. The constructor can be called by providing the directory that contains the results. The path to the specific results of each model run consists of the 'resultdir' and the 'scenarioname' (see section ModelRun).

Fields

  • params::Parameters: Configuration and model parameters loaded from params.jld2.
  • CHARGE::DataFrame: Charging data for storage units.
  • EXCHANGE::DataFrame: Cross-border or inter-zonal energy exchange data.
  • FEEDIN::DataFrame: Feed-in data from renewable or other sources.
  • GEN::DataFrame: Power generation data.
  • REDISP::DataFrame: Redispatch actions and adjustments.
  • PRS::DataFrame: Price or reserve-related data.
  • LINEFLOW::DataFrame: AC line power flow data.
  • DCLINEFLOW::DataFrame: DC line power flow data.
  • NETINPUT::DataFrame: Net input to zones or nodes.
  • NTC::DataFrame: Net Transfer Capacities between zones.
  • STO_LVL::DataFrame: Storage level data.
  • STO_LVL_REDISP::DataFrame: Redispatch-related storage level changes.
  • ZonalMarketBalance::DataFrame: Market balance data aggregated per zone.
  • NodalMarketBalance::DataFrame: Market balance data at the nodal level.
  • NodalMarketRedispBalance::DataFrame: Redispatch-adjusted nodal market balance.

Constructor

DataFiles(dir::String)

Example


results_path = joinpath("results", scen_name)

### reading in the result files
results = DataFiles(results_path)
source

The following functions can be used to create some useful tables automatically.

POMATWO.transform_results_by_typeFunction
transform_results_by_type(results, kind, zone)

Aggregates generation results by plant type and time for a specified market kind and zone.

Arguments

  • results: DataFiles object containing generation data and parameters.
  • kind: Symbol or string specifying the market result to extract (:REDISP, :GEN, or :DA).
  • zone: The name or key of the market zone to filter on.

Returns

A DataFrame with time as rows and columns for each plant type, containing the sum of generation for each time step and plant type in the specified zone.

Notes

  • For kind = :REDISP, uses the GEN_REDISP field.
  • For kind = :GEN or :DA, uses the GEN field (:GEN and :DA are treated identically).
  • If an unsupported kind is given, a warning is issued and nothing is returned.

Example

julia> transform_results_by_type(results, :DA, "DE")
4×3 DataFrame
 Row │ Time   wind      coal     
     │ Int64  Float64?  Float64?
─────┼───────────────────────────
   1 │     1      60.0       0.0
   2 │     2     100.0       0.0
   3 │     3     120.0       0.0
   4 │     4     140.0      40.0
source
POMATWO.summarize_resultFunction
summarize_result(result_table)

Summarizes a generation results table by summing each column (plant type) over all time steps.

Arguments

  • result_table: DataFrame produced by transform_results_by_type.

Returns

A DataFrame with a single row, where each column contains the total sum of generation (over all time steps) for the corresponding plant type.

Example

julia> summarize_result(transform_results_by_type(results, :DA, "DE"))
1×2 DataFrame
 Row │ wind     coal    
     │ Float64  Float64
─────┼──────────────────
   1 │   420.0     40.0
source