Skip to content

Commit

Permalink
sanity-check Journals
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayala committed Jan 7, 2020
1 parent d455d8a commit 7b5b8b0
Show file tree
Hide file tree
Showing 8 changed files with 7,684 additions and 0 deletions.
2,248 changes: 2,248 additions & 0 deletions docs/tutorials/10 - Running a Comparison with PVSyst.ipynb

Large diffs are not rendered by default.

1,338 changes: 1,338 additions & 0 deletions docs/tutorials/10 - Running a Comparison with PVSyst.py

Large diffs are not rendered by default.

376 changes: 376 additions & 0 deletions docs/tutorials/ALDERMAN - Sensor Position Sanity Check.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,376 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Sensor Position Sanity Check\n",
"\n",
"Extreme case test: 90 degree."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<a id='step1'></a>"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import bifacial_radiance\n",
"import numpy as np\n",
"import os # this operative system to do teh relative-path testfolder for this example.\n",
"import pprint # We will be pretty-printing the trackerdictionary throughout to show its structure."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"testfolder = os.path.abspath(r'..\\..\\bifacial_radiance\\TEMP')\n",
"albedo = \"litesoil\" # this is one of the options on ground.rad\n",
"lat = 37.5 \n",
"lon = -77.6\n",
"\n",
"# Scene variables\n",
"nMods = 1\n",
"nRows = 1\n",
"hub_height = 2.3 # meters\n",
"gcr = 0.35\n",
"\n",
"moduletype = 'SimpleModule'\n",
"x=1\n",
"y=2\n",
"sensorsy = 4 # to make it fast\n",
"\n",
"timeindex = 4020"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"path = C:\\Users\\sayala\\Documents\\GitHub\\bifacial_radiance\\bifacial_radiance\\TEMP\n",
"Getting weather file: USA_VA_Richmond.Intl.AP.724010_TMY.epw\n",
" ... OK!\n",
"Saving file EPWs\\epw_temp.csv, # points: 8760\n",
"\n",
"Module Name: SimpleModule\n",
"REWRITING pre-existing module file. \n",
"Module SimpleModule successfully created\n",
"Created Flat-135.oct\n",
"modulez in sceneDict, value 0.05\n",
"Linescan in process: Flat-135_Front\n",
"Linescan in process: Flat-135_Back\n",
"Saved: results\\irr_Flat-135.csv\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>x</th>\n",
" <th>y</th>\n",
" <th>z</th>\n",
" <th>rearZ</th>\n",
" <th>mattype</th>\n",
" <th>rearMat</th>\n",
" <th>Wm2Front</th>\n",
" <th>Wm2Back</th>\n",
" <th>Back/FrontRatio</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>9.507104e-17</td>\n",
" <td>-0.776314</td>\n",
" <td>2.055385</td>\n",
" <td>1.779885</td>\n",
" <td>a0.0.a0.SimpleModule.6457</td>\n",
" <td>a0.0.a0.SimpleModule.2310</td>\n",
" <td>483.624533</td>\n",
" <td>138.739467</td>\n",
" <td>0.286874</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>7.057811e-17</td>\n",
" <td>-0.576314</td>\n",
" <td>2.401795</td>\n",
" <td>2.126295</td>\n",
" <td>a0.0.a0.SimpleModule.6457</td>\n",
" <td>a0.0.a0.SimpleModule.2310</td>\n",
" <td>484.231467</td>\n",
" <td>138.848300</td>\n",
" <td>0.286739</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>4.608517e-17</td>\n",
" <td>-0.376314</td>\n",
" <td>2.748205</td>\n",
" <td>2.472705</td>\n",
" <td>a0.0.a0.SimpleModule.6457</td>\n",
" <td>a0.0.a0.SimpleModule.2310</td>\n",
" <td>483.595133</td>\n",
" <td>139.370067</td>\n",
" <td>0.288195</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2.159223e-17</td>\n",
" <td>-0.176314</td>\n",
" <td>3.094615</td>\n",
" <td>2.819115</td>\n",
" <td>a0.0.a0.SimpleModule.6457</td>\n",
" <td>a0.0.a0.SimpleModule.2310</td>\n",
" <td>484.037867</td>\n",
" <td>138.900467</td>\n",
" <td>0.286961</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" x y z rearZ mattype \\\n",
"0 9.507104e-17 -0.776314 2.055385 1.779885 a0.0.a0.SimpleModule.6457 \n",
"1 7.057811e-17 -0.576314 2.401795 2.126295 a0.0.a0.SimpleModule.6457 \n",
"2 4.608517e-17 -0.376314 2.748205 2.472705 a0.0.a0.SimpleModule.6457 \n",
"3 2.159223e-17 -0.176314 3.094615 2.819115 a0.0.a0.SimpleModule.6457 \n",
"\n",
" rearMat Wm2Front Wm2Back Back/FrontRatio \n",
"0 a0.0.a0.SimpleModule.2310 483.624533 138.739467 0.286874 \n",
"1 a0.0.a0.SimpleModule.2310 484.231467 138.848300 0.286739 \n",
"2 a0.0.a0.SimpleModule.2310 483.595133 139.370067 0.288195 \n",
"3 a0.0.a0.SimpleModule.2310 484.037867 138.900467 0.286961 "
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"simulationName = 'Flat-135' \n",
"demo = bifacial_radiance.RadianceObj(simulationName, path = testfolder)\n",
"demo.setGround(albedo) \n",
"epwfile = demo.getEPW(lat = lat, lon = lon) \n",
"metdata = demo.readWeatherFile(weatherFile = epwfile)\n",
"demo.gendaylit(metdata,timeindex) \n",
"mymodule = demo.makeModule(name=moduletype, x=0.001, y=y, z = 0.05)\n",
"sceneDict = {'gcr': gcr,'hub_height':hub_height, 'tilt': 60, 'azimuth': 180, 'nMods':nMods, 'nRows': nRows} \n",
"scene = demo.makeScene(moduletype,sceneDict) \n",
"octfile = demo.makeOct(demo.getfilelist()) \n",
"analysis = bifacial_radiance.AnalysisObj(octfile, demo.basename)\n",
"frontscan, backscan = analysis.moduleAnalysis(scene, sensorsy = sensorsy, frontsurfaceoffset=0.5)\n",
"results = analysis.analysis(octfile, demo.basename, frontscan, backscan) \n",
"bifacial_radiance.load.read1Result('results\\irr_Flat-135.csv')"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"path = C:\\Users\\sayala\\Documents\\GitHub\\bifacial_radiance\\bifacial_radiance\\TEMP\n",
"Getting weather file: USA_VA_Richmond.Intl.AP.724010_TMY.epw\n",
" ... OK!\n",
"Saving file EPWs\\epw_temp.csv, # points: 8760\n",
"\n",
"Module Name: SimpleModule\n",
"REWRITING pre-existing module file. \n",
"Module SimpleModule successfully created\n",
"Created Flat-135.oct\n",
"modulez in sceneDict, value 0.05\n",
"Linescan in process: Flat-135_Front\n",
"Linescan in process: Flat-135_Back\n",
"Saved: results\\irr_Flat-135.csv\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>x</th>\n",
" <th>y</th>\n",
" <th>z</th>\n",
" <th>rearZ</th>\n",
" <th>mattype</th>\n",
" <th>rearMat</th>\n",
" <th>Wm2Front</th>\n",
" <th>Wm2Back</th>\n",
" <th>Back/FrontRatio</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>4.214834e-17</td>\n",
" <td>-0.344167</td>\n",
" <td>1.805885</td>\n",
" <td>1.779885</td>\n",
" <td>a0.0.a0.SimpleModule.6457</td>\n",
" <td>a0.0.a0.SimpleModule.2310</td>\n",
" <td>482.927400</td>\n",
" <td>138.745433</td>\n",
" <td>0.287300</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1.765540e-17</td>\n",
" <td>-0.144167</td>\n",
" <td>2.152295</td>\n",
" <td>2.126295</td>\n",
" <td>a0.0.a0.SimpleModule.6457</td>\n",
" <td>a0.0.a0.SimpleModule.2310</td>\n",
" <td>483.586833</td>\n",
" <td>138.892167</td>\n",
" <td>0.287212</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>-6.837534e-18</td>\n",
" <td>0.055833</td>\n",
" <td>2.498705</td>\n",
" <td>2.472705</td>\n",
" <td>a0.0.a0.SimpleModule.6457</td>\n",
" <td>a0.0.a0.SimpleModule.2310</td>\n",
" <td>483.522933</td>\n",
" <td>139.490933</td>\n",
" <td>0.288488</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>-3.133047e-17</td>\n",
" <td>0.255833</td>\n",
" <td>2.845115</td>\n",
" <td>2.819115</td>\n",
" <td>a0.0.a0.SimpleModule.6457</td>\n",
" <td>a0.0.a0.SimpleModule.2310</td>\n",
" <td>483.940667</td>\n",
" <td>138.893767</td>\n",
" <td>0.287005</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" x y z rearZ mattype \\\n",
"0 4.214834e-17 -0.344167 1.805885 1.779885 a0.0.a0.SimpleModule.6457 \n",
"1 1.765540e-17 -0.144167 2.152295 2.126295 a0.0.a0.SimpleModule.6457 \n",
"2 -6.837534e-18 0.055833 2.498705 2.472705 a0.0.a0.SimpleModule.6457 \n",
"3 -3.133047e-17 0.255833 2.845115 2.819115 a0.0.a0.SimpleModule.6457 \n",
"\n",
" rearMat Wm2Front Wm2Back Back/FrontRatio \n",
"0 a0.0.a0.SimpleModule.2310 482.927400 138.745433 0.287300 \n",
"1 a0.0.a0.SimpleModule.2310 483.586833 138.892167 0.287212 \n",
"2 a0.0.a0.SimpleModule.2310 483.522933 139.490933 0.288488 \n",
"3 a0.0.a0.SimpleModule.2310 483.940667 138.893767 0.287005 "
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"simulationName = 'Flat-135' \n",
"demo = bifacial_radiance.RadianceObj(simulationName, path = testfolder)\n",
"demo.setGround(albedo) \n",
"epwfile = demo.getEPW(lat = lat, lon = lon) \n",
"metdata = demo.readWeatherFile(weatherFile = epwfile)\n",
"demo.gendaylit(metdata,timeindex) \n",
"mymodule = demo.makeModule(name=moduletype, x=0.001, y=y, z = 0.05)\n",
"sceneDict = {'gcr': gcr,'hub_height':hub_height, 'tilt': 60, 'azimuth': 180, 'nMods':nMods, 'nRows': nRows} \n",
"scene = demo.makeScene(moduletype,sceneDict) \n",
"octfile = demo.makeOct(demo.getfilelist()) \n",
"analysis = bifacial_radiance.AnalysisObj(octfile, demo.basename)\n",
"frontscan, backscan = analysis.moduleAnalysis(scene, sensorsy = sensorsy)\n",
"results = analysis.analysis(octfile, demo.basename, frontscan, backscan) \n",
"bifacial_radiance.load.read1Result('results\\irr_Flat-135.csv')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"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.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 1
}

0 comments on commit 7b5b8b0

Please sign in to comment.