diff --git a/docs/development/Sofia - Fixed Tilt Ground Resolution Test.html b/docs/development/Sofia - Fixed Tilt Ground Resolution Test.html new file mode 100644 index 00000000..43303b5a --- /dev/null +++ b/docs/development/Sofia - Fixed Tilt Ground Resolution Test.html @@ -0,0 +1,15115 @@ + + + + + +Sofia - Fixed Tilt Ground Resolution Test + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+
+ + +
+
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+ + + + + + + + + diff --git a/docs/development/Sofia - Fixed Tilt Ground Resolution Test.ipynb b/docs/development/Sofia - Fixed Tilt Ground Resolution Test.ipynb new file mode 100644 index 00000000..bbee122e --- /dev/null +++ b/docs/development/Sofia - Fixed Tilt Ground Resolution Test.ipynb @@ -0,0 +1,317 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Your simulation will be stored in C:\\Users\\sayala\\Documents\\GitHub\\bifacial_radiance\\docs\\TEMP\\sofia\n" + ] + } + ], + "source": [ + "import os\n", + "from pathlib import Path\n", + "\n", + "testfolder = str(Path().resolve().parent / 'TEMP' / 'sofia')\n", + "\n", + "if not os.path.exists(testfolder):\n", + " os.makedirs(testfolder)\n", + " \n", + "print (\"Your simulation will be stored in %s\" % testfolder)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "import bifacial_radiance as br\n", + "import numpy as np\n", + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Working on a Windows 10\n", + "Python version 3.11.4 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 13:38:37) [MSC v.1916 64 bit (AMD64)]\n", + "Pandas version 2.1.0\n", + "bifacial_radiance version 0.4.2+161.g1692460.dirty\n" + ] + } + ], + "source": [ + "# This information helps with debugging and getting support :)\n", + "import sys, platform\n", + "print(\"Working on a \", platform.system(), platform.release())\n", + "print(\"Python version \", sys.version)\n", + "print(\"Pandas version \", pd.__version__)\n", + "print(\"bifacial_radiance version \", br.__version__)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "simulationname = 'tutorial_1'\n", + "\n", + "# Location:\n", + "lat = 39.7407 # ° N, \n", + "lon = -105.1686 # ° W\n", + "\n", + "\n", + "# Scene Parameters:\n", + "azimuth_ang=90 # Facing south\n", + "tilt = 30 # tilt.\n", + "\n", + "# MakeModule Parameters\n", + "moduletype='test-module'\n", + "numpanels = 1 # AgriPV site has 3 modules along the y direction\n", + "module_x = 2 # m\n", + "module_y = 1 # m. slope we will measure\n", + "sensorsy=2\n", + "sensorsground=5\n", + "\n", + "# SceneDict Parameters\n", + "pitch = 6 # m\n", + "albedo = 0.2 #'grass' # ground albedo\n", + "clearance_height = 0.5 # m \n", + "nMods = 4 # six modules per row.\n", + "nRows = 3 # 3 row\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "path = C:\\Users\\sayala\\Documents\\GitHub\\bifacial_radiance\\docs\\TEMP\\sofia\n", + "Loading albedo, 1 value(s), 0.200 avg\n", + "1 nonzero albedo values.\n", + "Getting weather file: USA_CO_Golden-NREL.724666_TMY3.epw\n", + " ... OK!\n" + ] + } + ], + "source": [ + "demo = br.RadianceObj(simulationname,path = testfolder) \n", + "demo.setGround(albedo) \n", + "epwfile = demo.getEPW(lat, lon) # NJ lat/lon 40.0583° N, 74.4057\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Module Name: test-module\n", + "Module test-module updated in module.json\n", + "Pre-existing .rad file objects\\test-module.rad will be overwritten\n", + "\n" + ] + } + ], + "source": [ + "module=demo.makeModule(name=moduletype,x=module_x,y=module_y)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "8760 line in WeatherFile. Assuming this is a standard hourly WeatherFile for the year for purposes of saving Gencumulativesky temporary weather files in EPW folder.\n", + "Coercing year to 2021\n", + "Filtering dates\n", + "Saving file EPWs\\metdata_temp.csv, # points: 8760\n", + "Calculating Sun position for Metdata that is right-labeled with a delta of -30 mins. i.e. 12 is 11:30 sunpos\n" + ] + } + ], + "source": [ + "#Valid options: mm_dd, mm_dd_HH, mm_dd_HHMM, YYYY-mm-dd_HHMM\n", + "metdata = demo.readWeatherFile(epwfile, coerce_year=2021, starttime='2021-06-01', endtime='2021-06-30')" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Loaded EPWs\\metdata_temp.csv\n", + "message: There were 463 sun up hours in this climate file\n", + "Total Ibh/Lbh: 0.000000\n" + ] + }, + { + "data": { + "text/plain": [ + "'skies\\\\cumulative.rad'" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "demo.genCumSky() \n", + "#demo.gendaylit(timeindex=0) " + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "sceneDict = {'tilt':tilt,'pitch': pitch,'clearance_height':clearance_height,'azimuth':azimuth_ang, \n", + " 'nMods': nMods, 'nRows': nRows} \n", + "scene = demo.makeScene(module=moduletype, sceneDict=sceneDict) \n" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Created tutorial_1.oct\n" + ] + } + ], + "source": [ + "octfile = demo.makeOct()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If desired, you can view the Oct file at this point:\n", + "\n", + "***rvu -vf views\\front.vp -e .01 tutorial_1.oct***" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "y1 ! 0.0 0.0\n" + ] + } + ], + "source": [ + "analysis = br.AnalysisObj(octfile, demo.name) \n", + "frontscan, backscan, groundscan = analysis.moduleAnalysis(scene, sensorsy=sensorsy, sensorsground=sensorsground)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Linescan in process: tutorial_1_groundscan_East_Row2_Module2_Front\n", + "Linescan in process: tutorial_1_groundscan_East_Row2_Module2_Back\n", + "FrontDict is: None\n" + ] + }, + { + "data": { + "text/plain": [ + "(None,\n", + " {'Wm2': [28642.95, 29353.5],\n", + " 'x': [0.1438376, -0.1448376],\n", + " 'y': [8.807511e-18, -8.868743e-18],\n", + " 'z': [0.6658006, 0.8324673],\n", + " 'r': [28642.95, 29353.5],\n", + " 'g': [28642.95, 29353.5],\n", + " 'b': [28642.95, 29353.5],\n", + " 'mattype': ['a1.1.a0.test-module.2310', 'a1.1.a0.test-module.2310'],\n", + " 'title': 'tutorial_1_groundscan_East_Row2_Module2_Back'})" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "analysis.analysis(octfile, simulationname+\"_groundscan_East\", groundscan, backscan) # compare the back vs front irradiance " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Loop for sensorsground and see resolution effect " + ] + } + ], + "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.4" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/development/Sofia - Fixed Tilt Ground Resolution Test.py b/docs/development/Sofia - Fixed Tilt Ground Resolution Test.py new file mode 100644 index 00000000..17e588e5 --- /dev/null +++ b/docs/development/Sofia - Fixed Tilt Ground Resolution Test.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[1]: + + +import os +from pathlib import Path + +testfolder = str(Path().resolve().parent / 'TEMP' / 'sofia') + +if not os.path.exists(testfolder): + os.makedirs(testfolder) + +print ("Your simulation will be stored in %s" % testfolder) + + +# In[2]: + + +import bifacial_radiance as br +import numpy as np +import pandas as pd + + +# In[3]: + + +# This information helps with debugging and getting support :) +import sys, platform +print("Working on a ", platform.system(), platform.release()) +print("Python version ", sys.version) +print("Pandas version ", pd.__version__) +print("bifacial_radiance version ", br.__version__) + + +# In[4]: + + +simulationname = 'tutorial_1' + +# Location: +lat = 39.7407 # ° N, +lon = -105.1686 # ° W + + +# Scene Parameters: +azimuth_ang=90 # Facing south +tilt = 30 # tilt. + +# MakeModule Parameters +moduletype='test-module' +numpanels = 1 # AgriPV site has 3 modules along the y direction +module_x = 2 # m +module_y = 1 # m. slope we will measure +sensorsy=2 +sensorsground=5 + +# SceneDict Parameters +pitch = 6 # m +albedo = 0.2 #'grass' # ground albedo +clearance_height = 0.5 # m +nMods = 4 # six modules per row. +nRows = 3 # 3 row + + +# In[5]: + + +demo = br.RadianceObj(simulationname,path = testfolder) +demo.setGround(albedo) +epwfile = demo.getEPW(lat, lon) # NJ lat/lon 40.0583° N, 74.4057 + + +# In[6]: + + +module=demo.makeModule(name=moduletype,x=module_x,y=module_y) + + +# In[7]: + + +#Valid options: mm_dd, mm_dd_HH, mm_dd_HHMM, YYYY-mm-dd_HHMM +metdata = demo.readWeatherFile(epwfile, coerce_year=2021, starttime='2021-06-01', endtime='2021-06-30') + + +# In[12]: + + +demo.genCumSky() +#demo.gendaylit(timeindex=0) + + +# In[13]: + + +sceneDict = {'tilt':tilt,'pitch': pitch,'clearance_height':clearance_height,'azimuth':azimuth_ang, + 'nMods': nMods, 'nRows': nRows} +scene = demo.makeScene(module=moduletype, sceneDict=sceneDict) + + +# In[14]: + + +octfile = demo.makeOct() + + +# If desired, you can view the Oct file at this point: +# +# ***rvu -vf views\front.vp -e .01 tutorial_1.oct*** + +# In[15]: + + +analysis = br.AnalysisObj(octfile, demo.name) +frontscan, backscan, groundscan = analysis.moduleAnalysis(scene, sensorsy=sensorsy, sensorsground=sensorsground) + + +# In[16]: + + +analysis.analysis(octfile, simulationname+"_groundscan_East", groundscan, backscan) # compare the back vs front irradiance + + +# In[ ]: + + +# Loop for sensorsground and see resolution effect + diff --git a/docs/development/Sofia - Trackerdict 1axis routine.html b/docs/development/Sofia - Trackerdict 1axis routine.html new file mode 100644 index 00000000..c3c7c7f9 --- /dev/null +++ b/docs/development/Sofia - Trackerdict 1axis routine.html @@ -0,0 +1,15181 @@ + + + + + +Sofia - Trackerdict 1axis routine + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+
+ + +
+
+
+ + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+ + + + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+ + + + + + + + + diff --git a/docs/development/Sofia - Trackerdict 1axis routine.ipynb b/docs/development/Sofia - Trackerdict 1axis routine.ipynb new file mode 100644 index 00000000..5475c900 --- /dev/null +++ b/docs/development/Sofia - Trackerdict 1axis routine.ipynb @@ -0,0 +1,370 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Your simulation will be stored in C:\\Users\\sayala\\Documents\\GitHub\\bifacial_radiance\\docs\\TEMP\\sofia\n" + ] + } + ], + "source": [ + "import os\n", + "from pathlib import Path\n", + "\n", + "testfolder = str(Path().resolve().parent / 'TEMP' / 'sofia')\n", + "\n", + "if not os.path.exists(testfolder):\n", + " os.makedirs(testfolder)\n", + " \n", + "print (\"Your simulation will be stored in %s\" % testfolder)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "import bifacial_radiance as br\n", + "import numpy as np\n", + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Working on a Windows 10\n", + "Python version 3.11.4 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 13:38:37) [MSC v.1916 64 bit (AMD64)]\n", + "Pandas version 2.1.0\n", + "bifacial_radiance version 0.4.2+161.g1692460.dirty\n" + ] + } + ], + "source": [ + "# This information helps with debugging and getting support :)\n", + "import sys, platform\n", + "print(\"Working on a \", platform.system(), platform.release())\n", + "print(\"Python version \", sys.version)\n", + "print(\"Pandas version \", pd.__version__)\n", + "print(\"bifacial_radiance version \", br.__version__)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "simulationname = 'tutorial_1'\n", + "\n", + "# Location:\n", + "lat = 40.0583 # NJ\n", + "lon = -74.4057 # NJ\n", + "\n", + "# Scene Parameters:\n", + "azimuth_ang=90 # Facing south\n", + "tilt = 30 # tilt.\n", + "\n", + "# MakeModule Parameters\n", + "moduletype='test-module'\n", + "numpanels = 1 # AgriPV site has 3 modules along the y direction\n", + "module_x = 2 # m\n", + "module_y = 1 # m. slope we will measure\n", + "sensorsy=2\n", + "sensorsground=5\n", + "\n", + "# SceneDict Parameters\n", + "pitch = 6 # m\n", + "albedo = 0.2 #'grass' # ground albedo\n", + "clearance_height = 0.5 # m \n", + "nMods = 4 # six modules per row.\n", + "nRows = 3 # 3 row\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "path = C:\\Users\\sayala\\Documents\\GitHub\\bifacial_radiance\\docs\\TEMP\\sofia\n", + "Loading albedo, 1 value(s), 0.200 avg\n", + "1 nonzero albedo values.\n", + "Getting weather file: USA_NJ_McGuire.AFB.724096_TMY3.epw\n", + " ... OK!\n" + ] + } + ], + "source": [ + "demo = br.RadianceObj(simulationname,path = testfolder) \n", + "demo.setGround(albedo) \n", + "epwfile = demo.getEPW(lat, lon) # NJ lat/lon 40.0583° N, 74.4057\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "8760 line in WeatherFile. Assuming this is a standard hourly WeatherFile for the year for purposes of saving Gencumulativesky temporary weather files in EPW folder.\n", + "Coercing year to 2021\n", + "Filtering dates\n", + "Saving file EPWs\\metdata_temp.csv, # points: 8760\n", + "Calculating Sun position for Metdata that is right-labeled with a delta of -30 mins. i.e. 12 is 11:30 sunpos\n" + ] + } + ], + "source": [ + "#Valid options: mm_dd, mm_dd_HH, mm_dd_HHMM, YYYY-mm-dd_HHMM\n", + "metdata = demo.readWeatherFile(epwfile, coerce_year=2021, starttime='2021-06-01', endtime='2021-06-30_23')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Couple measurements:\n", + "* hub_height = 1.5 m\n", + "* pitch = 5.7 m\n", + "* modules are in 1-up portrait\n", + "* Field size is 10 rows x 20 modules\n", + "* Module are 2x1 m\n", + "* Pyranometers start 16in off east-way from the center of row 7, module 14\n", + " \n", + "Suggestions:\n", + "* Do an hourly simulation. To calculate the tracker angle, look at the function and documentation of [`getSingleTimestampTrackerAngle`](https://bifacial-radiance.readthedocs.io/en/latest/generated/bifacial_radiance.RadianceObj.getSingleTimestampTrackerAngle.html#bifacial_radiance.RadianceObj.getSingleTimestampTrackerAngle)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "# -- establish tracking angles\n", + "hub_height = 1.5 # m\n", + "pitch = 5.7 # m\n", + "sazm = 180 # Tracker axis azimuth\n", + "fixed_tilt_angle = None\n", + "gcr = 2 / pitch\n", + "cumulativesky = True\n", + "\n", + "trackerParams = {'limit_angle':50,\n", + " 'angledelta':30, # \n", + " 'backtrack':True,\n", + " 'gcr':gcr,\n", + " 'cumulativesky':cumulativesky,\n", + " 'azimuth': sazm,\n", + " 'fixed_tilt_angle': fixed_tilt_angle\n", + " }" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Saving file EPWs\\1axis_-60.0.csv, # points: 90\n", + "Saving file EPWs\\1axis_-30.0.csv, # points: 90\n", + "Saving file EPWs\\1axis_-0.0.csv, # points: 90\n", + "Saving file EPWs\\1axis_30.0.csv, # points: 90\n", + "Saving file EPWs\\1axis_60.0.csv, # points: 90\n" + ] + } + ], + "source": [ + "trackerdict = demo.set1axis(**trackerParams)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "message: There were 86 sun up hours in this climate file\n", + "Total Ibh/Lbh: 0.000000\n", + "Created skyfile skies\\1axis_-60.0.rad\n", + "message: There were 90 sun up hours in this climate file\n", + "Total Ibh/Lbh: 0.000000\n", + "Created skyfile skies\\1axis_-30.0.rad\n", + "message: There were 82 sun up hours in this climate file\n", + "Total Ibh/Lbh: 0.000000\n", + "Created skyfile skies\\1axis_-0.0.rad\n", + "message: There were 89 sun up hours in this climate file\n", + "Total Ibh/Lbh: 0.000000\n", + "Created skyfile skies\\1axis_30.0.rad\n", + "message: There were 88 sun up hours in this climate file\n", + "Total Ibh/Lbh: 0.000000\n", + "Created skyfile skies\\1axis_60.0.rad\n" + ] + } + ], + "source": [ + "if cumulativesky:\n", + " demo.genCumSky1axis()\n", + "else:\n", + " demo.gendaylit1axis()" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "sceneDict = {'pitch':pitch, \n", + " 'hub_height': hub_height,\n", + " 'nMods': 5,\n", + " 'nRows': 2,\n", + " 'tilt': fixed_tilt_angle, \n", + " 'sazm': sazm\n", + " }" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Making .rad files for cumulativesky 1-axis workflow\n", + "5 Radfiles created in /objects/\n", + "\n", + "Making 5 octfiles in root directory.\n", + "Created 1axis_-60.0.oct\n", + "Created 1axis_-30.0.oct\n", + "Created 1axis_-0.0.oct\n", + "Created 1axis_30.0.oct\n", + "Created 1axis_60.0.oct\n" + ] + } + ], + "source": [ + "trackerdict = demo.makeScene1axis(module=moduletype,sceneDict=sceneDict)\n", + "trackerdict = demo.makeOct1axis()" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "dict_keys([-0.0, -30.0, -60.0, 30.0, 60.0])" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "demo.trackerdict.keys()" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Linescan in process: 1axis_-60.0Module_Row1_Module2_Front\n", + "Linescan in process: 1axis_-60.0Module_Row1_Module2_Back\n", + "Saved: results\\irr_1axis_-60.0Module_Row1_Module2.csv\n", + "FrontDict is: {'Wm2': [46639.30000000001, 46712.12], 'x': [0.1015199, -0.0651468], 'y': [-2.01, -2.01], 'z': [1.366162, 1.654838], 'r': [46639.3, 46712.12], 'g': [46639.3, 46712.12], 'b': [46639.3, 46712.12], 'mattype': ['a1.0.a0.test-module.6457', 'a1.0.a0.test-module.6457'], 'title': '1axis_-60.0Module_Row1_Module2_Front'}\n", + "{'octfile': '1axis_-60.0.oct', 'name': '1axis_-60.0Module', 'hpc': False, 'modWanted': 2, 'rowWanted': 1, 'x': [0.1015199, -0.0651468], 'y': [-2.01, -2.01], 'z': [1.366162, 1.654838], 'rearZ': [1.355162, 1.643838], 'mattype': ['a1.0.a0.test-module.6457', 'a1.0.a0.test-module.6457'], 'rearMat': ['a1.0.a0.test-module.2310', 'a1.0.a0.test-module.2310'], 'Wm2Front': [46639.30000000001, 46712.12], 'Wm2Back': [5443.616, 5423.33], 'Back/FrontRatio': [0.11671735817824541, 0.11610112929789679], 'backRatio': [0.11671735817824541, 0.11610112929789679], 'rearX': [0.08246731, -0.08419936], 'rearY': [-2.01, -2.01]}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "c:\\users\\sayala\\documents\\github\\bifacial_radiance\\bifacial_radiance\\main.py:2853: Warning: Index: -60.0. Problem with file. Error: 'AnalysisObj' object has no attribute 'keys'. Skipping\n", + " warnings.warn('Index: {}. Problem with file. Error: {}. Skipping'.format(index,e), Warning)\n" + ] + } + ], + "source": [ + "trackerdict = demo.analysis1axis(customname = 'Module',\n", + " sensorsy=2, modWanted=2,\n", + " rowWanted=1) #sensorsground=2)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "600" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "## Loop for sensrosground = 1, 2, 3, 5, 10, 20, 30,50,100,150,200,250,300, 400, 500\n", + "\n" + ] + } + ], + "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.4" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/development/Sofia - Trackerdict 1axis routine.py b/docs/development/Sofia - Trackerdict 1axis routine.py new file mode 100644 index 00000000..b15eb107 --- /dev/null +++ b/docs/development/Sofia - Trackerdict 1axis routine.py @@ -0,0 +1,173 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[1]: + + +import os +from pathlib import Path + +testfolder = str(Path().resolve().parent / 'TEMP' / 'sofia') + +if not os.path.exists(testfolder): + os.makedirs(testfolder) + +print ("Your simulation will be stored in %s" % testfolder) + + +# In[2]: + + +import bifacial_radiance as br +import numpy as np +import pandas as pd + + +# In[3]: + + +# This information helps with debugging and getting support :) +import sys, platform +print("Working on a ", platform.system(), platform.release()) +print("Python version ", sys.version) +print("Pandas version ", pd.__version__) +print("bifacial_radiance version ", br.__version__) + + +# In[4]: + + +simulationname = 'tutorial_1' + +# Location: +lat = 40.0583 # NJ +lon = -74.4057 # NJ + +# Scene Parameters: +azimuth_ang=90 # Facing south +tilt = 30 # tilt. + +# MakeModule Parameters +moduletype='test-module' +numpanels = 1 # AgriPV site has 3 modules along the y direction +module_x = 2 # m +module_y = 1 # m. slope we will measure +sensorsy=2 +sensorsground=5 + +# SceneDict Parameters +pitch = 6 # m +albedo = 0.2 #'grass' # ground albedo +clearance_height = 0.5 # m +nMods = 4 # six modules per row. +nRows = 3 # 3 row + + +# In[5]: + + +demo = br.RadianceObj(simulationname,path = testfolder) +demo.setGround(albedo) +epwfile = demo.getEPW(lat, lon) # NJ lat/lon 40.0583° N, 74.4057 + + +# In[6]: + + +#Valid options: mm_dd, mm_dd_HH, mm_dd_HHMM, YYYY-mm-dd_HHMM +metdata = demo.readWeatherFile(epwfile, coerce_year=2021, starttime='2021-06-01', endtime='2021-06-30_23') + + +# Couple measurements: +# * hub_height = 1.5 m +# * pitch = 5.7 m +# * modules are in 1-up portrait +# * Field size is 10 rows x 20 modules +# * Module are 2x1 m +# * Pyranometers start 16in off east-way from the center of row 7, module 14 +# +# Suggestions: +# * Do an hourly simulation. To calculate the tracker angle, look at the function and documentation of [`getSingleTimestampTrackerAngle`](https://bifacial-radiance.readthedocs.io/en/latest/generated/bifacial_radiance.RadianceObj.getSingleTimestampTrackerAngle.html#bifacial_radiance.RadianceObj.getSingleTimestampTrackerAngle) +# + +# In[7]: + + +# -- establish tracking angles +hub_height = 1.5 # m +pitch = 5.7 # m +sazm = 180 # Tracker axis azimuth +fixed_tilt_angle = None +gcr = 2 / pitch +cumulativesky = True + +trackerParams = {'limit_angle':50, + 'angledelta':30, # + 'backtrack':True, + 'gcr':gcr, + 'cumulativesky':cumulativesky, + 'azimuth': sazm, + 'fixed_tilt_angle': fixed_tilt_angle + } + + +# In[17]: + + +trackerdict = demo.set1axis(**trackerParams) + + +# In[18]: + + +if cumulativesky: + demo.genCumSky1axis() +else: + demo.gendaylit1axis() + + +# In[19]: + + +sceneDict = {'pitch':pitch, + 'hub_height': hub_height, + 'nMods': 5, + 'nRows': 2, + 'tilt': fixed_tilt_angle, + 'sazm': sazm + } + + +# In[20]: + + +trackerdict = demo.makeScene1axis(module=moduletype,sceneDict=sceneDict) +trackerdict = demo.makeOct1axis() + + +# In[21]: + + +demo.trackerdict.keys() + + +# In[23]: + + +trackerdict = demo.analysis1axis(customname = 'Module', + sensorsy=2, modWanted=2, + rowWanted=1) #sensorsground=2) + + +# In[ ]: + + +600 + + +# In[ ]: + + +## Loop for sensrosground = 1, 2, 3, 5, 10, 20, 30,50,100,150,200,250,300, 400, 500 + +