https://gitlab.com/migvasc/lowcarboncloud/
Revision 44d2de89057ff6df4657769e0b14ac2bade57830 authored by migvasc on 10 March 2023, 13:36:34 UTC, committed by migvasc on 10 March 2023, 13:36:34 UTC
Updating figures numbers and adding codemeta.json

See merge request migvasc/lowcarboncloud!14
2 parent s a824c41 + df37370
Raw File
Tip revision: 44d2de89057ff6df4657769e0b14ac2bade57830 authored by migvasc on 10 March 2023, 13:36:34 UTC
Merge branch 'master' into 'main'
Tip revision: 44d2de8
extract_table_v_data.py
def extract_emissions(path):
    """ Export the total emissions values for the scenarios: 
    - only using the grid
    - only using power from PVs and batteries
    - using power from the grid, pv and batteries
    Parameters
    ----------
    path : str
        The path of the input file
    """


    emissions = ''
    with open(path, encoding="UTF-8") as summary_file:    
        cursor = 0
        for line_number, line in enumerate(summary_file):
            if (line_number == 1):
                columns = line.split(';')
                emissions = columns[1]

    return emissions


result_file = open('results/table_v_data.csv', 'w')    
result_file.write('scenario;emissions\n')

result_file.write(f'grid_only;{extract_emissions("results/only_grid/summary_results.csv")}\n')
result_file.write(f'pv_bat_only;{extract_emissions("results/only_pv_bat/summary_results.csv")}\n')
result_file.write(f'pv_bat_grid;{extract_emissions("results/2021/summary_results.csv")}\n')

result_file.close()
back to top