Welcome to TSOC Data Analysis’s documentation!

License Python Documentation GitHub Repository

Author: Sustainable Power Systems Lab (SPSL), https://sps-lab.org, contact: info@sps-lab.org

A Python tool for analyzing the TSOC power system operational data from Excel files. The tool provides a modular Python API for load analysis, generator categorization, wind power analysis, reactive power calculations, and representative operating point extraction.

Features

  • Month-based data filtering for efficient processing of large datasets

  • Load calculations (Total Load, Net Load) with comprehensive statistics

  • Wind power analysis with generation statistics and profiles

  • Generator categorization (Voltage Control vs PQ Control)

  • Reactive power analysis with comprehensive calculations

  • Data validation with type checking, limit validation, and gap filling

  • Representative operating points extraction using K-means clustering with performance optimizations

  • Comprehensive logging and error handling

Quick Start

from tsoc_data_analysis import execute, extract_representative_ops, extract_representative_ops_enhanced

# Load and analyze data
success, df = execute(month='2024-01', data_dir='raw_data', output_dir='results')
if success:
    # Extract representative points (standard method)
    rep_df, diagnostics = extract_representative_ops(
        df, max_power=450, MAPGL=200, output_dir='results'
    )

    # Or use enhanced clustering for better quality
    enh_rep_df, enh_diagnostics = extract_representative_ops_enhanced(
        df, max_power=450, MAPGL=200, output_dir='results_enhanced',
        use_enhanced_preprocessing=True, try_alternative_algorithms=True
    )

Indices and tables