From dede719f56916b5f808ff267e1fb9ee047a7e1e5 Mon Sep 17 00:00:00 2001 From: Mirletz Date: Wed, 2 Oct 2024 16:50:31 -0600 Subject: [PATCH] working on CdTe material composition graph baselines read in, need to divide and graph. --- ...seline dev) CdTe Material Composition.html | 15735 ++++++++++++++++ ...eline dev) CdTe Material Composition.ipynb | 1133 ++ ...baseline dev) CdTe Material Composition.py | 88 + 3 files changed, 16956 insertions(+) create mode 100644 docs/baseline development documentation/(baseline dev) CdTe Material Composition.html create mode 100644 docs/baseline development documentation/(baseline dev) CdTe Material Composition.ipynb create mode 100644 docs/baseline development documentation/(baseline dev) CdTe Material Composition.py diff --git a/docs/baseline development documentation/(baseline dev) CdTe Material Composition.html b/docs/baseline development documentation/(baseline dev) CdTe Material Composition.html new file mode 100644 index 0000000..f768d12 --- /dev/null +++ b/docs/baseline development documentation/(baseline dev) CdTe Material Composition.html @@ -0,0 +1,15735 @@ + + + + + +(baseline dev) CdTe Material Composition + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + + +
+ + + + +
+ + +
+ + + + +
+ + +
+ + + + +
+ + +
+ + + + +
+ + +
+ + + + + + + + + diff --git a/docs/baseline development documentation/(baseline dev) CdTe Material Composition.ipynb b/docs/baseline development documentation/(baseline dev) CdTe Material Composition.ipynb new file mode 100644 index 0000000..d5b15e7 --- /dev/null +++ b/docs/baseline development documentation/(baseline dev) CdTe Material Composition.ipynb @@ -0,0 +1,1133 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "21abf574-2e53-4380-ae88-dec4804393dd", + "metadata": {}, + "source": [ + "# CdTe Annual % Material Composition\n", + "This journal graphs the average composition of a CdTe module over time." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "e6a2b071-fa0f-4a8f-9388-db8c19f08d88", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "import os,sys\n", + "from pathlib import Path\n", + "import matplotlib.pyplot as plt\n", + "from urllib.request import urlretrieve\n", + "import glob\n", + "#import PV_ICE\n", + "cwd = os.getcwd() #grabs current working directory" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "0f7d1639-7780-4add-90d8-11e89f71d771", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'C:\\\\Users\\\\hmirletz\\\\Documents\\\\GitHub\\\\PV_ICE\\\\docs\\\\baseline development documentation'" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "supportMatfolder = str(Path().resolve().parent.parent / 'PV_ICE' / 'baselines' / 'SupportingMaterial')\n", + "baselinesFolder = str(Path().resolve().parent.parent / 'PV_ICE' / 'baselines')\n", + "cwd" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "16c5c67d-715c-4b0d-ad29-36d37d9905d6", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Python version 3.11.5 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:26:23) [MSC v.1916 64 bit (AMD64)]\n", + "Pandas version 2.0.3\n", + "pyplot 3.7.2\n" + ] + } + ], + "source": [ + "#print(\"Working on a \", platform.system(), platform.release())\n", + "print(\"Python version \", sys.version)\n", + "print(\"Pandas version \", pd.__version__)\n", + "print(\"pyplot \", plt.matplotlib.__version__)\n", + "#print(\"PV_ICE version \", PV_ICE.__version__)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "2da66855-84d0-4233-b3a6-e55e103831db", + "metadata": {}, + "outputs": [], + "source": [ + "#materials in CdTe\n", + "MATERIALS_CdTe = ['aluminium_frames_cdte','encapsulant_cdte','glass_cdte','copper_cdte','cadmium','tellurium']\n", + "tidynameMats_CdTe = ['aluminium_frames','encapsulant','glass','copper','cadmium','tellurium']\n" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "e8ff3f77-b409-4942-98ed-ec9350b52311", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
mat_massperm2
year
19958.219678
19968.219678
19978.219678
19988.219678
19998.219678
20008.219678
20018.219678
20028.219678
20038.219678
20048.219678
20058.219678
20068.219678
20078.219678
20088.219678
20098.219678
20108.219678
20116.027764
20126.027764
20136.027764
20146.027764
20156.027764
20166.027764
20176.027764
20186.027764
20196.027764
20206.027764
20216.027764
20226.027764
20236.027764
20246.027764
20255.479785
20265.479785
20275.479785
20285.479785
20295.479785
20305.479785
20315.479785
20325.479785
20335.479785
20345.479785
20355.479785
20365.479785
20375.479785
20385.479785
20395.479785
20405.479785
20415.479785
20425.479785
20435.479785
20445.479785
20455.479785
20465.479785
20475.479785
20485.479785
20495.479785
20505.479785
\n", + "
" + ], + "text/plain": [ + " mat_massperm2\n", + "year \n", + "1995 8.219678\n", + "1996 8.219678\n", + "1997 8.219678\n", + "1998 8.219678\n", + "1999 8.219678\n", + "2000 8.219678\n", + "2001 8.219678\n", + "2002 8.219678\n", + "2003 8.219678\n", + "2004 8.219678\n", + "2005 8.219678\n", + "2006 8.219678\n", + "2007 8.219678\n", + "2008 8.219678\n", + "2009 8.219678\n", + "2010 8.219678\n", + "2011 6.027764\n", + "2012 6.027764\n", + "2013 6.027764\n", + "2014 6.027764\n", + "2015 6.027764\n", + "2016 6.027764\n", + "2017 6.027764\n", + "2018 6.027764\n", + "2019 6.027764\n", + "2020 6.027764\n", + "2021 6.027764\n", + "2022 6.027764\n", + "2023 6.027764\n", + "2024 6.027764\n", + "2025 5.479785\n", + "2026 5.479785\n", + "2027 5.479785\n", + "2028 5.479785\n", + "2029 5.479785\n", + "2030 5.479785\n", + "2031 5.479785\n", + "2032 5.479785\n", + "2033 5.479785\n", + "2034 5.479785\n", + "2035 5.479785\n", + "2036 5.479785\n", + "2037 5.479785\n", + "2038 5.479785\n", + "2039 5.479785\n", + "2040 5.479785\n", + "2041 5.479785\n", + "2042 5.479785\n", + "2043 5.479785\n", + "2044 5.479785\n", + "2045 5.479785\n", + "2046 5.479785\n", + "2047 5.479785\n", + "2048 5.479785\n", + "2049 5.479785\n", + "2050 5.479785" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pd.read_csv(os.path.join(baselinesFolder, 'baseline_material_mass_cadmium.csv'), \n", + " index_col = 0, usecols=['year','mat_massperm2'], skiprows=[1])" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "0d8686c4-5be4-4c33-b601-82c4dc5ae2a9", + "metadata": {}, + "outputs": [], + "source": [ + "df_component_mats = pd.DataFrame()\n", + "for mat in MATERIALS_CdTe:\n", + " filename = os.path.join(baselinesFolder, 'baseline_material_mass_'+str(mat)+'.csv')\n", + " tempdf = pd.read_csv(filename, index_col = 0, usecols=['year','mat_massperm2'], skiprows=[1])\n", + " df_component_mats = pd.concat([df_component_mats,tempdf], axis=1)\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "id": "32155f07-a34f-49ba-92dc-c490f358a58e", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
aluminium_framesencapsulantglasscoppercadmiumtellurium
year
19950.000000388.116000.0000056.558.2196789.330322
19960.000000388.116000.0000056.558.2196789.330322
19970.000000388.116000.0000056.558.2196789.330322
19980.000000388.116000.0000056.558.2196789.330322
19990.000000388.116000.0000056.558.2196789.330322
20000.000000388.116000.0000056.558.2196789.330322
20010.000000388.116000.0000056.558.2196789.330322
20020.000000388.116000.0000056.558.2196789.330322
20030.000000388.116000.0000056.558.2196789.330322
20040.000000388.116000.0000056.558.2196789.330322
20050.000000388.116000.0000056.558.2196789.330322
20060.000000388.116000.0000056.558.2196789.330322
20070.000000388.116000.0000056.558.2196789.330322
20080.000000388.116000.0000056.558.2196789.330322
20090.000000388.116000.0000056.558.2196789.330322
20100.000000388.116000.0000056.558.2196789.330322
20110.000000388.116000.0000056.556.0277646.842236
20120.000000388.116000.0000056.556.0277646.842236
20130.000000388.116000.0000056.556.0277646.842236
20140.000000388.115947.5000056.556.0277646.842236
20150.000000388.115895.0000056.556.0277646.842236
20160.000000388.115842.5000056.556.0277646.842236
20170.000000388.115790.0000056.556.0277646.842236
2018117.532683388.115755.0000056.556.0277646.842236
2019202.080283388.115650.0000056.556.0277646.842236
2020405.753968388.115475.0000056.556.0277646.842236
2021811.507937388.114915.0000056.556.0277646.842236
2022811.507937388.114810.0000056.556.0277646.842236
2023811.507937388.114635.0000056.556.0277646.842236
20241217.261905388.114460.0000056.556.0277646.842236
20251623.015873388.114302.5000056.555.4797856.842236
20261623.015873388.114145.0000056.555.4797856.220215
20271217.261905388.114063.3333356.555.4797856.220215
2028811.507937388.113981.6666756.555.4797856.220215
2029811.507937388.113900.0000056.555.4797856.220215
2030811.507937388.113806.6666756.555.4797856.220215
2031405.753968388.113713.3333356.555.4797856.220215
2032202.080283388.113620.0000056.555.4797856.220215
2033117.532683388.113620.0000056.555.4797856.220215
203481.150794388.113620.0000056.555.4797856.220215
203581.150794388.113620.0000056.555.4797856.220215
203681.150794388.113620.0000056.555.4797856.220215
203781.150794388.113620.0000056.555.4797856.220215
203881.150794388.113620.0000056.555.4797856.220215
20390.000000388.113620.0000056.555.4797856.220215
20400.000000388.113620.0000056.555.4797856.220215
20410.000000388.113620.0000056.555.4797856.220215
20420.000000388.113620.0000056.555.4797856.220215
20430.000000388.113620.0000056.555.4797856.220215
20440.000000388.113620.0000056.555.4797856.220215
20450.000000388.113620.0000056.555.4797856.220215
20460.000000388.113620.0000056.555.4797856.220215
20470.000000388.113620.0000056.555.4797856.220215
20480.000000388.113620.0000056.555.4797856.220215
20490.000000388.113620.0000056.555.4797856.220215
20500.000000388.113620.0000056.555.4797856.220215
\n", + "
" + ], + "text/plain": [ + " aluminium_frames encapsulant glass copper cadmium tellurium\n", + "year \n", + "1995 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "1996 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "1997 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "1998 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "1999 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2000 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2001 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2002 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2003 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2004 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2005 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2006 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2007 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2008 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2009 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2010 0.000000 388.1 16000.00000 56.55 8.219678 9.330322\n", + "2011 0.000000 388.1 16000.00000 56.55 6.027764 6.842236\n", + "2012 0.000000 388.1 16000.00000 56.55 6.027764 6.842236\n", + "2013 0.000000 388.1 16000.00000 56.55 6.027764 6.842236\n", + "2014 0.000000 388.1 15947.50000 56.55 6.027764 6.842236\n", + "2015 0.000000 388.1 15895.00000 56.55 6.027764 6.842236\n", + "2016 0.000000 388.1 15842.50000 56.55 6.027764 6.842236\n", + "2017 0.000000 388.1 15790.00000 56.55 6.027764 6.842236\n", + "2018 117.532683 388.1 15755.00000 56.55 6.027764 6.842236\n", + "2019 202.080283 388.1 15650.00000 56.55 6.027764 6.842236\n", + "2020 405.753968 388.1 15475.00000 56.55 6.027764 6.842236\n", + "2021 811.507937 388.1 14915.00000 56.55 6.027764 6.842236\n", + "2022 811.507937 388.1 14810.00000 56.55 6.027764 6.842236\n", + "2023 811.507937 388.1 14635.00000 56.55 6.027764 6.842236\n", + "2024 1217.261905 388.1 14460.00000 56.55 6.027764 6.842236\n", + "2025 1623.015873 388.1 14302.50000 56.55 5.479785 6.842236\n", + "2026 1623.015873 388.1 14145.00000 56.55 5.479785 6.220215\n", + "2027 1217.261905 388.1 14063.33333 56.55 5.479785 6.220215\n", + "2028 811.507937 388.1 13981.66667 56.55 5.479785 6.220215\n", + "2029 811.507937 388.1 13900.00000 56.55 5.479785 6.220215\n", + "2030 811.507937 388.1 13806.66667 56.55 5.479785 6.220215\n", + "2031 405.753968 388.1 13713.33333 56.55 5.479785 6.220215\n", + "2032 202.080283 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2033 117.532683 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2034 81.150794 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2035 81.150794 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2036 81.150794 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2037 81.150794 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2038 81.150794 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2039 0.000000 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2040 0.000000 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2041 0.000000 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2042 0.000000 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2043 0.000000 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2044 0.000000 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2045 0.000000 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2046 0.000000 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2047 0.000000 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2048 0.000000 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2049 0.000000 388.1 13620.00000 56.55 5.479785 6.220215\n", + "2050 0.000000 388.1 13620.00000 56.55 5.479785 6.220215" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df_component_mats.columns = tidynameMats_CdTe\n", + "df_component_mats" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "id": "55d10940-4540-4fc9-88cb-127e7505200a", + "metadata": {}, + "outputs": [], + "source": [ + "df_component_mats['module_mass_gpm2'] = df_component_mats.sum(axis=1) #run only once" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "id": "df79dd65-b5b3-4371-b025-cba53971b4e2", + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "Unable to coerce to Series, length must be 7: given 56", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[1;32mIn[38], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m df_component_mats\u001b[38;5;241m/\u001b[39mdf_component_mats[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mmodule_mass_gpm2\u001b[39m\u001b[38;5;124m'\u001b[39m]\u001b[38;5;241m.\u001b[39mvalues\n", + "File \u001b[1;32mC:\\ProgramData\\anaconda3\\Lib\\site-packages\\pandas\\core\\ops\\common.py:81\u001b[0m, in \u001b[0;36m_unpack_zerodim_and_defer..new_method\u001b[1;34m(self, other)\u001b[0m\n\u001b[0;32m 77\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mNotImplemented\u001b[39m\n\u001b[0;32m 79\u001b[0m other \u001b[38;5;241m=\u001b[39m item_from_zerodim(other)\n\u001b[1;32m---> 81\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m method(\u001b[38;5;28mself\u001b[39m, other)\n", + "File \u001b[1;32mC:\\ProgramData\\anaconda3\\Lib\\site-packages\\pandas\\core\\arraylike.py:210\u001b[0m, in \u001b[0;36mOpsMixin.__truediv__\u001b[1;34m(self, other)\u001b[0m\n\u001b[0;32m 208\u001b[0m \u001b[38;5;129m@unpack_zerodim_and_defer\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m__truediv__\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 209\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__truediv__\u001b[39m(\u001b[38;5;28mself\u001b[39m, other):\n\u001b[1;32m--> 210\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_arith_method(other, operator\u001b[38;5;241m.\u001b[39mtruediv)\n", + "File \u001b[1;32mC:\\ProgramData\\anaconda3\\Lib\\site-packages\\pandas\\core\\frame.py:7455\u001b[0m, in \u001b[0;36mDataFrame._arith_method\u001b[1;34m(self, other, op)\u001b[0m\n\u001b[0;32m 7452\u001b[0m axis: Literal[\u001b[38;5;241m1\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1\u001b[39m \u001b[38;5;66;03m# only relevant for Series other case\u001b[39;00m\n\u001b[0;32m 7453\u001b[0m other \u001b[38;5;241m=\u001b[39m ops\u001b[38;5;241m.\u001b[39mmaybe_prepare_scalar_for_op(other, (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mshape[axis],))\n\u001b[1;32m-> 7455\u001b[0m \u001b[38;5;28mself\u001b[39m, other \u001b[38;5;241m=\u001b[39m ops\u001b[38;5;241m.\u001b[39malign_method_FRAME(\u001b[38;5;28mself\u001b[39m, other, axis, flex\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m, level\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[0;32m 7457\u001b[0m new_data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_dispatch_frame_op(other, op, axis\u001b[38;5;241m=\u001b[39maxis)\n\u001b[0;32m 7458\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_construct_result(new_data)\n", + "File \u001b[1;32mC:\\ProgramData\\anaconda3\\Lib\\site-packages\\pandas\\core\\ops\\__init__.py:260\u001b[0m, in \u001b[0;36malign_method_FRAME\u001b[1;34m(left, right, axis, flex, level)\u001b[0m\n\u001b[0;32m 258\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(right, np\u001b[38;5;241m.\u001b[39mndarray):\n\u001b[0;32m 259\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m right\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[1;32m--> 260\u001b[0m right \u001b[38;5;241m=\u001b[39m to_series(right)\n\u001b[0;32m 262\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m right\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m2\u001b[39m:\n\u001b[0;32m 263\u001b[0m \u001b[38;5;66;03m# We need to pass dtype=right.dtype to retain object dtype\u001b[39;00m\n\u001b[0;32m 264\u001b[0m \u001b[38;5;66;03m# otherwise we lose consistency with Index and array ops\u001b[39;00m\n\u001b[0;32m 265\u001b[0m dtype \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n", + "File \u001b[1;32mC:\\ProgramData\\anaconda3\\Lib\\site-packages\\pandas\\core\\ops\\__init__.py:252\u001b[0m, in \u001b[0;36malign_method_FRAME..to_series\u001b[1;34m(right)\u001b[0m\n\u001b[0;32m 250\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 251\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(left\u001b[38;5;241m.\u001b[39mcolumns) \u001b[38;5;241m!=\u001b[39m \u001b[38;5;28mlen\u001b[39m(right):\n\u001b[1;32m--> 252\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[0;32m 253\u001b[0m msg\u001b[38;5;241m.\u001b[39mformat(req_len\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mlen\u001b[39m(left\u001b[38;5;241m.\u001b[39mcolumns), given_len\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mlen\u001b[39m(right))\n\u001b[0;32m 254\u001b[0m )\n\u001b[0;32m 255\u001b[0m right \u001b[38;5;241m=\u001b[39m left\u001b[38;5;241m.\u001b[39m_constructor_sliced(right, index\u001b[38;5;241m=\u001b[39mleft\u001b[38;5;241m.\u001b[39mcolumns, dtype\u001b[38;5;241m=\u001b[39mdtype)\n\u001b[0;32m 256\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m right\n", + "\u001b[1;31mValueError\u001b[0m: Unable to coerce to Series, length must be 7: given 56" + ] + } + ], + "source": [ + "df_component_mats/df_component_mats['module_mass_gpm2'].values" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a24cecbf-9fa4-430e-a87b-aebc629e5b04", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.5" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/baseline development documentation/(baseline dev) CdTe Material Composition.py b/docs/baseline development documentation/(baseline dev) CdTe Material Composition.py new file mode 100644 index 0000000..0424c1b --- /dev/null +++ b/docs/baseline development documentation/(baseline dev) CdTe Material Composition.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# coding: utf-8 + +# # CdTe Annual % Material Composition +# This journal graphs the average composition of a CdTe module over time. + +# In[1]: + + +import numpy as np +import pandas as pd +import os,sys +from pathlib import Path +import matplotlib.pyplot as plt +from urllib.request import urlretrieve +import glob +#import PV_ICE +cwd = os.getcwd() #grabs current working directory + + +# In[2]: + + +supportMatfolder = str(Path().resolve().parent.parent / 'PV_ICE' / 'baselines' / 'SupportingMaterial') +baselinesFolder = str(Path().resolve().parent.parent / 'PV_ICE' / 'baselines') +cwd + + +# In[3]: + + +#print("Working on a ", platform.system(), platform.release()) +print("Python version ", sys.version) +print("Pandas version ", pd.__version__) +print("pyplot ", plt.matplotlib.__version__) +#print("PV_ICE version ", PV_ICE.__version__) + + +# In[31]: + + +#materials in CdTe +MATERIALS_CdTe = ['aluminium_frames_cdte','encapsulant_cdte','glass_cdte','copper_cdte','cadmium','tellurium'] +tidynameMats_CdTe = ['aluminium_frames','encapsulant','glass','copper','cadmium','tellurium'] + + +# In[21]: + + +pd.read_csv(os.path.join(baselinesFolder, 'baseline_material_mass_cadmium.csv'), + index_col = 0, usecols=['year','mat_massperm2'], skiprows=[1]) + + +# In[28]: + + +df_component_mats = pd.DataFrame() +for mat in MATERIALS_CdTe: + filename = os.path.join(baselinesFolder, 'baseline_material_mass_'+str(mat)+'.csv') + tempdf = pd.read_csv(filename, index_col = 0, usecols=['year','mat_massperm2'], skiprows=[1]) + df_component_mats = pd.concat([df_component_mats,tempdf], axis=1) + + + +# In[32]: + + +df_component_mats.columns = tidynameMats_CdTe +df_component_mats + + +# In[33]: + + +df_component_mats['module_mass_gpm2'] = df_component_mats.sum(axis=1) #run only once + + +# In[38]: + + +df_component_mats/df_component_mats['module_mass_gpm2'].values + + +# In[ ]: + + + +