Skip to content

Commit

Permalink
image corrections and some advanced journals paths
Browse files Browse the repository at this point in the history
two of the journals had not a multiple OS friendly path so updated #217

Fixed images.
  • Loading branch information
shirubana committed May 21, 2020
1 parent 9705acd commit ed1950e
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 548 deletions.
Expand Up @@ -116,7 +116,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -129,7 +129,7 @@
],
"source": [
"# Create a RadianceObj 'object' named bifacial_example. no whitespace allowed\n",
"demo = RadianceObj('bifacial_tracking_example', path = testfolder) "
"demo = RadianceObj('bifacial_tracking_example', path = str(testfolder)) "
]
},
{
Expand Down
Expand Up @@ -72,11 +72,11 @@

# ## 2. Create a Radiance Object

# In[3]:
# In[4]:


# Create a RadianceObj 'object' named bifacial_example. no whitespace allowed
demo = RadianceObj('bifacial_tracking_example', path = testfolder)
demo = RadianceObj('bifacial_tracking_example', path = str(testfolder))


# This will create all the folder structure of the bifacial_radiance Scene in the designated testfolder in your computer, and it should look like this:
Expand Down
Expand Up @@ -59,14 +59,15 @@
},
{
"cell_type": "code",
"execution_count": 2,
"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."
"import pprint # We will be pretty-printing the trackerdictionary throughout to show its structure.\n",
"from pathlib import Path"
]
},
{
Expand All @@ -91,9 +92,10 @@
"metadata": {},
"outputs": [],
"source": [
"testfolder = Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP'\n",
"\n",
"simulationName = 'Tutorial 3' # For adding a simulation name when defning RadianceObj. This is optional.\n",
"moduletype = 'Custom Cell-Level Module' # We will define the parameters for this below in Step 4.\n",
"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",
Expand Down Expand Up @@ -153,14 +155,17 @@
"name": "stdout",
"output_type": "stream",
"text": [
"path = C:\\Users\\sayala\\Documents\\RadianceScenes\\Tutorials\\Journal2\n",
"path = C:\\Users\\sayala\\Documents\\GitHub\\bifacial_radiance\\bifacial_radiance\\TEMP\n",
"Loading albedo, 1 value(s), 0.213 avg\n",
"1 nonzero albedo values.\n",
"Getting weather file: USA_VA_Richmond.Intl.AP.724010_TMY.epw\n",
" ... OK!\n"
" ... OK!\n",
"Saving file EPWs\\epw_temp.csv, # points: 8760\n"
]
}
],
"source": [
"demo = bifacial_radiance.RadianceObj(simulationName, path = testfolder) # Adding a simulation name. This is optional.\n",
"demo = bifacial_radiance.RadianceObj(simulationName, path = str(testfolder)) # Adding a simulation name. This is optional.\n",
"demo.setGround(albedo) \n",
"epwfile = demo.getEPW(lat = lat, lon = lon) \n",
"metdata = demo.readWeatherFile(weatherFile = epwfile) \n"
Expand Down
Expand Up @@ -43,13 +43,14 @@
#
# So far we've used "from bifacial_radiance import *" to import all the bifacial_radiance files into our working space in jupyter. For this journal we will do a "import bifacial_radiance" . This method of importing requires a different call for some functions as you'll see below. For example, instead of calling demo = RadianceObj(path = testfolder) as on Tutorial 2, in this case we will neeed to do demo = bifacial_radiance.RadianceObj(path = testfolder).

# In[2]:
# In[1]:


import bifacial_radiance
import numpy as np
import os # this operative system to do teh relative-path testfolder for this example.
import pprint # We will be pretty-printing the trackerdictionary throughout to show its structure.
from pathlib import Path


# <a id='step2'></a>
Expand All @@ -61,9 +62,10 @@
# In[3]:


testfolder = Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP'

simulationName = 'Tutorial 3' # For adding a simulation name when defning RadianceObj. This is optional.
moduletype = 'Custom Cell-Level Module' # We will define the parameters for this below in Step 4.
testfolder = os.path.abspath(r'..\..\bifacial_radiance\TEMP')
albedo = "litesoil" # this is one of the options on ground.rad
lat = 37.5
lon = -77.6
Expand Down Expand Up @@ -107,7 +109,7 @@
# In[4]:


demo = bifacial_radiance.RadianceObj(simulationName, path = testfolder) # Adding a simulation name. This is optional.
demo = bifacial_radiance.RadianceObj(simulationName, path = str(testfolder)) # Adding a simulation name. This is optional.
demo.setGround(albedo)
epwfile = demo.getEPW(lat = lat, lon = lon)
metdata = demo.readWeatherFile(weatherFile = epwfile)
Expand Down
Expand Up @@ -50,7 +50,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand All @@ -63,7 +63,9 @@
],
"source": [
"import os\n",
"testfolder = os.path.abspath(r'..\\..\\bifacial_radiance\\TEMP') \n",
"from pathlib import Path\n",
"\n",
"testfolder = Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP'\n",
"\n",
"print (\"Your simulation will be stored in %s\" % testfolder)\n",
"\n",
Expand Down Expand Up @@ -157,16 +159,11 @@
"output_type": "stream",
"text": [
"path = C:\\Users\\sayala\\Documents\\GitHub\\bifacial_radiance\\bifacial_radiance\\TEMP\n",
"Loading albedo, 1 value(s), 0.280 avg\n",
"1 nonzero albedo values.\n",
"Getting weather file: USA_VA_Richmond.Intl.AP.724010_TMY.epw\n",
" ... OK!\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\users\\sayala\\documents\\github\\bifacial_radiance\\bifacial_radiance\\main.py:2447: pvlibDeprecationWarning: The get_sun_rise_set_transit function was deprecated in pvlib 0.6.1 and will be removed in 0.7. Use sun_rise_set_transit_spa instead.\n",
" sunup= pvlib.irradiance.solarposition.get_sun_rise_set_transit(datetimetz, lat, lon) #only for pvlib <0.6.1\n"
" ... OK!\n",
"Saving file EPWs\\epw_temp.csv, # points: 8760\n"
]
},
{
Expand All @@ -181,7 +178,7 @@
}
],
"source": [
"demo = bifacial_radiance.RadianceObj(simulationname,path = testfolder) # Create a RadianceObj 'object'\n",
"demo = bifacial_radiance.RadianceObj(simulationname,path = str(testfolder)) # Create a RadianceObj 'object'\n",
"demo.setGround(albedo) # input albedo number or material name like 'concrete'. To see options, run this without any input.\n",
"epwfile = demo.getEPW(lat,lon) # pull TMY data for any global lat/lon\n",
"metdata = demo.readEPW(epwfile) # read in the EPW weather data from above\n",
Expand Down Expand Up @@ -219,10 +216,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"getSingleTimestampTrackerAngle Warning: \n",
" This function does not correct for the weather file half hour displacement nor for sunrise/sunset sun position at the moment. IT just calculates the Tracker position at the specific timestamp passed.\n",
"\n",
" NEW Calculated Tilt: -11.77 \n"
" NEW Calculated Tilt: -4.67 \n"
]
}
],
Expand Down Expand Up @@ -1509,7 +1504,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
Expand Up @@ -35,11 +35,13 @@
# ### 1. Specify Working Folder and Import Program
#

# In[1]:
# In[2]:


import os
testfolder = os.path.abspath(r'..\..\bifacial_radiance\TEMP')
from pathlib import Path

testfolder = Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP'

print ("Your simulation will be stored in %s" % testfolder)

Expand Down Expand Up @@ -103,7 +105,7 @@
# In[4]:


demo = bifacial_radiance.RadianceObj(simulationname,path = testfolder) # Create a RadianceObj 'object'
demo = bifacial_radiance.RadianceObj(simulationname,path = str(testfolder)) # Create a RadianceObj 'object'
demo.setGround(albedo) # input albedo number or material name like 'concrete'. To see options, run this without any input.
epwfile = demo.getEPW(lat,lon) # pull TMY data for any global lat/lon
metdata = demo.readEPW(epwfile) # read in the EPW weather data from above
Expand Down
Expand Up @@ -54,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -64,40 +64,29 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"path = C:\\Users\\sayala\\Documents\\RadianceScenes\\Demo3\n",
"path = C:\\Users\\sayala\\Documents\\GitHub\\bifacial_radiance\\bifacial_radiance\\TEMP\n",
"Loading albedo, 1 value(s), 0.280 avg\n",
"1 nonzero albedo values.\n",
"Getting weather file: USA_NJ_McGuire.AFB.724096_TMY3.epw\n",
" ... OK!\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\users\\sayala\\documents\\github\\bifacial_radiance\\bifacial_radiance\\main.py:2414: pvlibDeprecationWarning: The get_sun_rise_set_transit function was deprecated in pvlib 0.6.1 and will be removed in 0.7. Use sun_rise_set_transit_spa instead.\n",
" sunup= pvlib.irradiance.solarposition.get_sun_rise_set_transit(datetimetz, lat, lon) #only for pvlib <0.6.1\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" ... OK!\n",
"Saving file EPWs\\epw_temp.csv, # points: 8760\n",
"\n",
"Module Name: PrismSolar\n",
"REWRITING pre-existing module file. \n",
"Module PrismSolar successfully created\n",
"Module PrismSolar updated in module.json\n",
"Created HotelCarport.oct\n"
]
}
],
"source": [
"testfolder = r'C:\\Users\\sayala\\Documents\\RadianceScenes\\Demo3'\n",
"from pathlib import Path\n",
"testfolder = str(Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP')\n",
"\n",
"timestamp = 4020 # Noon, June 17th. \n",
"simulationname = 'HotelCarport'\n",
Expand Down Expand Up @@ -175,18 +164,23 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'x' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-2-da9d8986a367>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mxright\u001b[0m\u001b[1;33m=\u001b[0m \u001b[0mx\u001b[0m\u001b[1;33m*\u001b[0m\u001b[1;36m4\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0mxleft\u001b[0m\u001b[1;33m=\u001b[0m \u001b[1;33m-\u001b[0m\u001b[0mxright\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;31m#centerhubheight = (1.9*3+1.9/2)*np.sin(tilt*np.pi/180)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0my2nd\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m-\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mnumpanels\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcos\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtilt\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpi\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m180\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m+\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcos\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtilt\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpi\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m180\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mNameError\u001b[0m: name 'x' is not defined"
"name": "stdout",
"output_type": "stream",
"text": [
"! genbox black cuteBox 0.5 0.5 4.966939279485054 | xform -t -0.25 -0.25 0 -t -3.8 -1.8324006105325215 0\n",
"\n",
"Custom Object Name objects\\Post1.rad\n",
"\n",
"Custom Object Name objects\\Post2.rad\n",
"\n",
"Custom Object Name objects\\Post3.rad\n",
"\n",
"Custom Object Name objects\\Post4.rad\n",
"Created HotelCarport.oct\n"
]
}
],
Expand Down Expand Up @@ -292,7 +286,7 @@
"metadata": {},
"source": [
"This is the module analysis and an image of the results file\n",
"![This is the module analysed.](../images_wiki/Carport_analysis.png)\n",
"![This is the module analysed.](../images_wiki/Carport_analysis.PNG)\n",
"\n",
"You can repeat the analysis for any other module in the row:\n",
"\n",
Expand Down Expand Up @@ -442,8 +436,15 @@
"## rvu -vf views\\front.vp -e .01 -pe 0.019 -vp 1.5 -14 15 HotelCarport.oct\n",
"\n",
"\n",
"![Behold the Honda-fit sized cube](../images_wiki/Carport_with_car.png)"
"![Behold the Honda-fit sized cube](../images_wiki/Carport_with_car.PNG)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -462,7 +463,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
Expand Up @@ -39,17 +39,18 @@
#
# The magic is that, for doing the carport we see in the figure, we are going to do a 4-up configuration of modules (**numpanels**), and we are going to repeat that 4-UP 7 times (**nMods**)

# In[1]:
# In[2]:


from bifacial_radiance import *
import numpy as np


# In[2]:
# In[4]:


testfolder = r'C:\Users\sayala\Documents\RadianceScenes\Demo3'
from pathlib import Path
testfolder = str(Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP')

timestamp = 4020 # Noon, June 17th.
simulationname = 'HotelCarport'
Expand Down Expand Up @@ -110,7 +111,7 @@
#
# We are calculating the location with some math geometry

# In[2]:
# In[5]:


xright= x*4
Expand Down Expand Up @@ -181,7 +182,7 @@


# This is the module analysis and an image of the results file
# ![This is the module analysed.](../images_wiki/Carport_analysis.png)
# ![This is the module analysed.](../images_wiki/Carport_analysis.PNG)
#
# You can repeat the analysis for any other module in the row:
#
Expand Down Expand Up @@ -256,4 +257,10 @@
# ## rvu -vf views\front.vp -e .01 -pe 0.019 -vp 1.5 -14 15 HotelCarport.oct
#
#
# ![Behold the Honda-fit sized cube](../images_wiki/Carport_with_car.png)
# ![Behold the Honda-fit sized cube](../images_wiki/Carport_with_car.PNG)

# In[ ]:




0 comments on commit ed1950e

Please sign in to comment.