Alberta TIER Aggrgeate

This tutorial shows how to combine multiple monthly files from Petrinex into one file for aggregate TIER reporting.

Envirobyte

Envirobyte

February 1, 2024

The Alberta TIER (Technology Innovation and Emissions Reduction) regulation allows for the aggregation of multiple facilities to create a single reporting entity. The aggregate facility emissions are calculated based on Petrinex data, which provides monthly volumetric data for oil and gas operations in Alberta.

Petrinex is a data warehouse. It has monthly volumetric data from Oil and Gas operations in Alberta, such as production, fuel use, flare, vent data. The volumetric data can be [here]

(https://www.petrinex.ca/PD/Pages/APD.aspx).

Note: data for Saskatchewan and British Columbia are not publicly available.

Check all the monthly files

import pandas as pd
import numpy as np
import glob
files = glob.glob('*.csv')
files

Note:

  • macOS is sensitive to the letters *.csv or *.CSV.
  • Windows does not differentiate csv or CSV.

Combine all monthly files into one file

df_all = pd.concat([pd.read_csv(f,low_memory=False) for f in glob.glob('*.CSV')],
                    axis = 0,sort = True)
df_all.head()

remove unnecessary columns.

col_removal =
['ReportingFacilityProvinceState','ReportingFacilityLocation'
'FacilityLegalSubdivision','FacilitySection','FacilityTownship',
'FacilityRange','FacilityMeridian','SubmissionDate',
'CCICode','ProrationProduct','ProrationFactor',
'FromToIDProvinceState']
df =df_all.drop(columns= col_removal)
df.to_csv('Petrinex_2019.csv',index=False)

Select company you want to report

clientA=df[df['OperatorName'].str.contains('clientA')]
clientAFuelFlareVent = clientA[(clientA['ActivityID'] == 'FUEL') | (clientA['ActivityID'] == 'FLARE')| (clientA['ActivityID'] == 'VENT')]
clientAFuelFlareVent

Calculate total fuel, flare and vent

df. groupby(['OperatorName','ReportingFacilityID','FromToID','ActivityID','ProductionMonth'])['Volume'].sum()