Published May 29, 2026 | Version v1
Software documentation Open

Codes Used for analysis

Authors/Creators

Description

This contains all the code developed and used for the analysis in this thesis. This script uses absolute file paths specific to the author's machine. Before running, update all path variables in the configuration section to match your local directory structure. Input datasets (commodity prices, demand and supply elasticities, LUTO2 baseline layers, and scenario definitions) are referenced by location rather than embedded. When reusing this code on a different system or applying it to a new analysis, verify that every input path resolves correctly and that the input data are up to date, as the outputs depend on the versions supplied at run time.

Notes

For the Area Matrix code, this part has been added later:
records = []
for (ssp, diet, prod), mat in results.items():
    mat_np = mat.values.copy()
    np.fill_diagonal(mat_np, 0)
    total_change = np.abs(mat_np).sum() / 1e6      # convert to Mha
   
    records.append({
        'SSP': SSP_LABELS[ssp],
        'Diet': DIET_LABELS[diet],
        'Productivity': PROD_LABELS[prod],
        'Total Area Changed (Mha)': round(total_change, 3)
    })

df_table = (pd.DataFrame(records)
              .sort_values(['SSP', 'Diet', 'Productivity'])
              .reset_index(drop=True))

df_table.to_csv("land_use_change_2050_Mha.csv", index=False)
print(df_table.to_string(index=False))
save_path = "land_use_change_2050_Mha.csv"
print(f"Saved summary table to {save_path}")

Files

area matrix LUTO2.ipynb

Files (92.0 MB)

Name Size Download all
md5:f63b91f48a4f7c57e0b42523586c6420
31.7 MB Preview Download
md5:6e3b6e4c60ab33ed3be3de8fdd417009
2.7 MB Preview Download
md5:d553262b1c1383251c306c0e777fc413
49.4 kB Preview Download
md5:ea09ca7923e7fcc7043dd1a39f17af98
6.4 kB Download
md5:6e3b6e4c60ab33ed3be3de8fdd417009
2.7 MB Preview Download
md5:bd592087c660abece9e01eab7e3bd461
1.0 MB Preview Download
md5:89b53cd64e96c7efbeff8446bdcb9c4a
912.9 kB Preview Download
md5:81f2cb5c37ad0ee7e5ac0570712435f3
50.8 MB Preview Download
md5:a40b77d0415a9aca539c479e9c82f1bb
2.0 MB Preview Download