Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development merge for v0.3.3 #145

Merged
merged 200 commits into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
c90f6d2
Merge pull request #122 from NREL/Versioneer
cdeline Jul 30, 2019
802a883
critical update to Analysis Module
shirubana Aug 9, 2019
15303c3
simplifying analysis function, adding PVmismatch functions
shirubana Aug 9, 2019
107cde0
new analysis Routine! old one marked as _old
shirubana Aug 9, 2019
7b9cdaf
adding Bififactor to analysis
shirubana Aug 9, 2019
b5d8e37
small fix, POAT printing
shirubana Aug 12, 2019
4618a78
load analysis.py in bifacial_radiance when you load it.
cdeline Aug 13, 2019
e305c9a
72 cell Module update
shirubana Aug 14, 2019
6e9a32c
small fix - import of pvmismatch inside of function
shirubana Aug 16, 2019
9ce54bb
use OSError instead of platform specific WindowsError in RadianceObj …
mikofski Aug 19, 2019
d70b070
Add test for bad RadianceObj path
mikofski Aug 19, 2019
a59f7bd
add requests and future to reqs - closes #128 and closes #130
mikofski Aug 19, 2019
449d186
add tests for gh128 and gh130, import requests, tkinter using future
mikofski Aug 19, 2019
b4f2c24
new fixed tilt hourly mode when angledelta = 0
cdeline Aug 20, 2019
91e75ff
avoid divide-by-zero errors in gendaylit
cdeline Aug 20, 2019
5019311
modelchain makes use of new trackerdict workflow by setting angledelt…
cdeline Aug 20, 2019
94653a6
GUI updated to make fixed-tilt hourly by time range, not timestamp va…
cdeline Aug 20, 2019
0b75f2a
Trying (and failing) to fix the load function, and keep pytests working
cdeline Aug 21, 2019
7205ee2
Include timestamp fixed tilt workflow in modelchain.py
cdeline Aug 21, 2019
ce2130c
Fixed daydate fixed tilt routine - add pytest
cdeline Aug 21, 2019
e2e5fc8
Minor fix for full annual hourly fixed simulations
cdeline Aug 21, 2019
7761b7a
Bug fix in day-date workflow
cdeline Aug 21, 2019
cd3fa8b
Add filenotfound error checking for loading .ini file
cdeline Aug 21, 2019
b75b635
fixed tracking daydate hourly. fixes #125
cdeline Aug 21, 2019
89e2bfe
Hourly for a day GUI updates - it's working now!
cdeline Aug 21, 2019
0f24502
Daydate functionality - starthour = endhour gives that hour of analysis.
cdeline Aug 21, 2019
d503f05
merge fixed tilt daydate and fixed tilt full year simulation
cdeline Aug 22, 2019
9bb88a3
add fixed_tilt_angle input value to set1axis instead of using anglede…
cdeline Aug 22, 2019
bb9e043
update modelchain to use fixed_tilt_angle inputs instead of angledelta
cdeline Aug 22, 2019
0f1a0ab
For tracking, if simulationParamsDict[dayDateSimulation] is not true,
cdeline Aug 22, 2019
c1b6eb5
makeOct1axis now uses a sorted list instead of randomly creating octf…
cdeline Aug 22, 2019
64ed234
Fix cumulative tracking with daydate simulation
cdeline Aug 22, 2019
3649aa7
Merge branch 'master' into development
cdeline Aug 22, 2019
38abe27
Merge pull request #135 from mikofski/gh128_update_reqs
cdeline Aug 22, 2019
a30176c
Merge branch 'development' into gh126_oserror
cdeline Aug 22, 2019
56abd09
Merge branch 'gh127_radianceobj_path_abs' of https://github.com/mikof…
cdeline Aug 22, 2019
1c28951
Merge branch 'mikofski-gh127_radianceobj_path_abs' into development
cdeline Aug 22, 2019
4e39ccd
Merge branch 'development' of https://github.com/NREL/bifacial_radian…
cdeline Aug 22, 2019
4a469bc
Merge branch 'development' into gh126_oserror
cdeline Aug 22, 2019
d85d719
analysis by method cleanup
Aug 22, 2019
a020606
Merge pull request #133 from mikofski/gh126_oserror
cdeline Aug 22, 2019
ccc07ae
small fix analysis
Aug 22, 2019
6962bda
update to legacy names function
Aug 22, 2019
c59f560
small modelchain.py update
shirubana Aug 26, 2019
d067262
gettrackerangles for fixed tilt hack update
shirubana Aug 30, 2019
890cb66
Merge remote-tracking branch 'remotes/NREL/development' into Hourly_f…
cdeline Aug 30, 2019
712ae28
delete last non-working plot.
cdeline Aug 30, 2019
c9974e8
Merge remote-tracking branch 'remotes/NREL/master_EUPVSEC' into Hourl…
cdeline Aug 30, 2019
324cd05
update path to TESTDIR rather than os.cwd
cdeline Aug 30, 2019
5b2349a
rename test .ini files to avoid name confusion with test.py files
cdeline Aug 30, 2019
23835ca
Merge pull request #137 from NREL/Hourly_fixed_workflow
cdeline Aug 30, 2019
7ef8990
small fix on analysis function whe nsensorsy = cellsy
shirubana Sep 1, 2019
a87469f
include logo image (I think)
shirubana Sep 1, 2019
f460ad4
logo!
shirubana Sep 1, 2019
433c771
pip install bifacial_radiance instruction on README and GUI image
shirubana Sep 1, 2019
2c6cf31
Fig 13 notebook correct
cdeline Sep 6, 2019
8d10948
add initial pytest for analysis.py and example notebook
cdeline Sep 11, 2019
53b1d1c
small fix overwritten line #148
shirubana Sep 24, 2019
bcb18eb
sphins quickstart & conf.py configuration
shirubana Sep 25, 2019
64d6f5a
index.rst and mockup pages for readthedocs documentation #149
shirubana Sep 25, 2019
2bca188
doc. update
shirubana Sep 26, 2019
c6647c8
auto_api and documentation improvement
Oct 3, 2019
a9d4e67
removed autoapi
shirubana Oct 4, 2019
2b6a3b7
Fixed typos in documentation.
jalderman9 Oct 4, 2019
63aae6a
Fixed typo. ackowledge -> acknowledge
jalderman9 Oct 4, 2019
3b5efa7
Fixed typo in README. Software is a 'mass noun'.
jalderman9 Oct 4, 2019
6e45061
Fixed typo. have ot -> have to
jalderman9 Oct 4, 2019
ce71830
Fixed typo. teh -> the, hte -> the
jalderman9 Oct 4, 2019
276de0c
Fixed typos. exmaple -> example, wiht -> with, Mising -> Missing
jalderman9 Oct 4, 2019
aa2a8e2
Fixed typos. varaibles -> variables, becuase -> because
jalderman9 Oct 4, 2019
3494642
Fixed typos.
jalderman9 Oct 4, 2019
e7a1453
removing environment.yml
shirubana Oct 4, 2019
d7bde34
small fix - environment comma on extensions
shirubana Oct 4, 2019
08fc707
Simplify conf.py to get working
cdeline Oct 4, 2019
71ec360
remove scipy from requirements.txt
cdeline Oct 4, 2019
ec1813b
master_doc = 'index'
cdeline Oct 4, 2019
1be9d79
Add autodocs to conf.py
cdeline Oct 4, 2019
af87674
update requirements.txt with autoapi
cdeline Oct 4, 2019
9924556
autoapi docs updated
cdeline Oct 4, 2019
00ef3b4
remove /src
cdeline Oct 4, 2019
8b93e11
Adding updated Linux gencumulativesky binary with support for -E opti…
jalderman9 Oct 4, 2019
e08824f
sub-module for interp_sub. Uses np.interp instead of scipy.
cdeline Oct 4, 2019
d7008ff
More structured documentation (no autodocs anymore)
shirubana Oct 4, 2019
594f166
removing extensions ipython
shirubana Oct 4, 2019
64b9016
documentation warnings resolved
cdeline Oct 4, 2019
67d1dea
Merge pull request #152 from Sunfolding/development
shirubana Oct 4, 2019
45d36de
jalderman9 bugfix analysis accuracy
shirubana Oct 4, 2019
6a9f58a
Merge remote-tracking branch 'remotes/NREL/development' into sphinx
cdeline Oct 4, 2019
f4a7a3e
Merge pull request #154 from NREL/sphinx
cdeline Oct 4, 2019
3f25b56
Merge remote-tracking branch 'remotes/NREL/development' into test_ana…
cdeline Oct 4, 2019
83b555b
Merge remote-tracking branch 'remotes/NREL/development' into test_ana…
cdeline Oct 4, 2019
d6c726d
Rename analysis.py to mismatch.py
cdeline Oct 4, 2019
e1da8aa
mad_fn needs float() to work with py27
cdeline Oct 4, 2019
01a4dbb
load.py documentation improvement
shirubana Oct 4, 2019
a3deb34
all functions in documentation and all whatsnew
shirubana Oct 5, 2019
c912157
update whatsnew
shirubana Oct 5, 2019
d34265c
delete tilde files (VIM temporary swap files)
cdeline Oct 7, 2019
b3f99c7
shorten readme
shirubana Oct 7, 2019
9ca02d7
Merge branch 'development' of https://github.com/NREL/bifacial_radian…
shirubana Oct 7, 2019
7a3da0a
make private functions in AnalysisObj
cdeline Oct 7, 2019
47d1bb4
Merge branch 'development' of https://github.com/NREL/bifacial_radian…
cdeline Oct 7, 2019
0d47095
Update analysis.py
shirubana Oct 7, 2019
5448e47
remove EUPVSEC function, make interpolate private
cdeline Oct 7, 2019
55fa540
New pytest for analysisIrradianceandPowerMismatch
cdeline Oct 7, 2019
5e65875
Merge remote-tracking branch 'remotes/NREL/development' into test_ana…
cdeline Oct 7, 2019
464aa51
remove updatelegacynames from mismatch.py
cdeline Oct 7, 2019
3de3300
makeSceneNxR is a private function now.
cdeline Oct 7, 2019
422c3a4
add pvmismatch to requirements.txt
cdeline Oct 7, 2019
bf0b9e7
Merge remote-tracking branch 'remotes/NREL/development' into test_ana…
cdeline Oct 7, 2019
1f14c8e
Merge pull request #156 from NREL/test_analysis
cdeline Oct 7, 2019
e5b0c87
change MetObj.set1axis to private function
cdeline Oct 7, 2019
cf6cb11
update Sphinx docs for removed objects
cdeline Oct 7, 2019
ef6d33a
add ipython to conf.py
cdeline Oct 7, 2019
714e3d2
switch to PVLib>0.6.1 sun_rise_set_transit_spa. Update setup.py. Fix…
cdeline Oct 7, 2019
ce5157b
Journal Updating
Oct 7, 2019
92dfdc8
pvlib 0.6.1 readTMY behavior (works)
cdeline Oct 8, 2019
af1394f
pvlib 0.6.1 compliant readEPW and readTMY.
cdeline Oct 8, 2019
a5895e9
update test_readepw
cdeline Oct 8, 2019
d3e35d2
remove test_readepw.py from the test suite
cdeline Oct 9, 2019
489a45f
add temp.txt back
cdeline Oct 9, 2019
c98cb48
replace empty temp file with .gitignore so it's more obvious what it'…
cdeline Oct 9, 2019
d57bd39
update requirements.txt for ipython and sphinx-rtd-theme
cdeline Oct 9, 2019
efc21a8
ipython 5.8.0 is py27 compliant. update requirements.txt
cdeline Oct 9, 2019
c7ccf1e
delete VIM swap file..
cdeline Oct 9, 2019
f5c238d
Merge pull request #160 from NREL/pvlib_063
cdeline Oct 9, 2019
7d458a3
use temp_epw.csv and -G mode for gencumsky with EPWs too. EPW file is…
cdeline Oct 9, 2019
b147e3e
Add starttime and endtime input options to readTMY and readEPW. forma…
cdeline Oct 9, 2019
37f3c43
update setup.py with C++ Extensions for gencumsky. Currently disable…
cdeline Oct 9, 2019
88bcea3
tutorials
shirubana Oct 9, 2019
9a0002f
Merge branch 'updated_gencumsky' of https://github.com/Sunfolding/bif…
cdeline Oct 9, 2019
6eaa7de
remove test_readepw
cdeline Oct 9, 2019
fe74a1c
Merge branch 'Sunfolding-updated_gencumsky' into development
cdeline Oct 9, 2019
8542602
trackerdict sorted for 1axis routines
Oct 9, 2019
170c07a
Merge branch 'development' of https://github.com/NREL/bifacial_radian…
Oct 9, 2019
c7dbcff
fix issue #167 , add fix to #155
Oct 9, 2019
5c343f8
print warning for exportTrackerDict
Oct 9, 2019
eac1d3e
_saveTempTMY now correctly saves an 8760 with zeros during unwanted p…
cdeline Oct 9, 2019
54b020c
_saveTempTMY bug fix. test_bifiRadiance minor update
cdeline Oct 9, 2019
2aa195c
travis.yml
cdeline Oct 9, 2019
302d344
test_bifacial_radiance tweak
cdeline Oct 9, 2019
21fc25f
Merge remote-tracking branch 'remotes/NREL/development' into gencumsk…
cdeline Oct 9, 2019
0d34bfb
copy gencumulativesky into Radiance $PATH.
cdeline Oct 9, 2019
9e43ce5
add test_gencumsky.py
cdeline Oct 9, 2019
02ac96f
pytest tweak
cdeline Oct 9, 2019
d8514fb
link to coveralls.
cdeline Oct 9, 2019
27ed1db
widen test acceptance window..
cdeline Oct 9, 2019
3e111fd
set up coveralls
cdeline Oct 9, 2019
18468f9
saving cumulative results excel from analysis1axis #166 and added sel…
Oct 9, 2019
41e9dc7
Merge branch 'development' of https://github.com/NREL/bifacial_radian…
Oct 9, 2019
bd48293
add _init_ to /tests/ facilitate coverage test (?)
cdeline Oct 9, 2019
aa170e2
gencumsky is COMICALLY non-repeatable. pytest acceptance window = huge.
cdeline Oct 9, 2019
1a6c930
minor tweak to test window
cdeline Oct 9, 2019
0e67f1a
Tutorial 2 finished + Advanced topics started
Oct 9, 2019
9156389
sceneDict printout instructions modification
Oct 10, 2019
f88f399
return truncated MetObj when readEPW is passed starttime and endtime
cdeline Oct 10, 2019
98bcc40
genCumSky deprecation warning for startdt and enddt.
cdeline Oct 10, 2019
be95063
bug fix for genCumSky1axis. fixes #90.
cdeline Oct 10, 2019
c5e7624
Journal 3 finished
shirubana Oct 10, 2019
752843a
Journals 1-5 Finished + Cleanup
shirubana Oct 11, 2019
f89f078
#166 temporary fix
shirubana Oct 11, 2019
6243ba6
small fix
shirubana Oct 11, 2019
3c0f147
cumulative-result warning print added
shirubana Oct 11, 2019
affac3e
Journals 6 and 7
shirubana Oct 11, 2019
9761da8
modelchain updates to match gencumsky api change.
cdeline Oct 11, 2019
888c506
Journal 2 reran
shirubana Oct 11, 2019
afbef05
1-7 Finished
shirubana Oct 11, 2019
58fdeb4
Merge remote-tracking branch 'remotes/NREL/development' into gencumsk…
cdeline Oct 11, 2019
483d730
tutorial2 path fix
cdeline Oct 11, 2019
7689730
tutorial3 path fix
cdeline Oct 11, 2019
8e2733f
Merge branch 'development' into gencumsky_fix
cdeline Oct 11, 2019
aa3e365
Journals 8 and 9
shirubana Oct 11, 2019
9883cf9
3a because merge conflict thing?
shirubana Oct 11, 2019
a2770c3
not sure what's going on
shirubana Oct 11, 2019
59eee4e
Bug fix - gendaylit1axis
cdeline Oct 11, 2019
0626cbb
EPWs constrained to 2001 to avoid leap-year issues.
cdeline Oct 11, 2019
c1a7bf9
mismatch documentation update
shirubana Oct 11, 2019
5b28dd1
** GUI interface bug fix ** Fixes #175
cdeline Oct 11, 2019
6e59858
Merge pull request #162 from NREL/gencumsky_fix
shirubana Oct 11, 2019
0e1ec6a
journal 4 & 6 minor edits
cdeline Oct 11, 2019
d6b42d3
Journal 8!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
shirubana Oct 11, 2019
33da307
remove readModule duplicate print statement. Fixes #157
cdeline Oct 11, 2019
00776a4
gui: return either gcr or pitch
cdeline Oct 13, 2019
e5bf296
remove readepw.py from __init__.py
cdeline Oct 13, 2019
3bfa7d7
remove legacy readepw.py.
cdeline Oct 13, 2019
4b5cdbb
remove legacy readepw.py. Previous commit fixes #143
cdeline Oct 13, 2019
6193332
Merge branch '0_3_2_bugfixes' of https://github.com/NREL/bifacial_rad…
cdeline Oct 13, 2019
b645b2f
Update v0.3.2.rst
shirubana Oct 14, 2019
716d1f4
Readme and rtfd updates
shirubana Oct 14, 2019
2f864c4
Ressurect tutorial3. remove Sphinx source/generated files.
cdeline Oct 14, 2019
846e6bb
Update README.md
shirubana Oct 14, 2019
92af628
update mismatch test because of sensorsy bug fix.
cdeline Oct 14, 2019
e874621
Merge remote-tracking branch 'remotes/NREL/development' into 0_3_2_bu…
cdeline Oct 14, 2019
80c8298
Merge pull request #176 from NREL/0_3_2_bugfixes
cdeline Oct 14, 2019
7bfc10e
test_gui initial framework for gui test
cdeline Oct 14, 2019
f24acb4
update .gitignore for sphinx generated files.
cdeline Oct 14, 2019
151b14c
sphinx remove readEPW + updates whatsnew
shirubana Oct 14, 2019
8e4195b
Merge branch 'development' of https://github.com/NREL/bifacial_radian…
shirubana Oct 14, 2019
7fd0950
Readme badge update
cdeline Oct 14, 2019
31ee6ae
test_gui troubleshoot...
cdeline Oct 14, 2019
db45e6f
xvfb setup in .travis.yml
cdeline Oct 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
docs/sphinx/build/
docs/sphinx/source/generated/
docs/sphinx/source/savefig/
*.un~
*.rst~

# PyBuilder
target/
Expand Down
18 changes: 15 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,25 @@ env:
- REQ_ENV='-r requirements.txt .'
# - REQ_ENV='--upgrade --upgrade-strategy=eager .'

# GUI testing requires xvfb
dist: xenial
services:
- xvfb

# Radiance is required to run tests. Download and setup v5.2

before_install:
- pwd
- wget https://github.com/NREL/Radiance/releases/download/5.2/radiance-5.2.dd0f8e38a7-Linux.tar.gz -O /tmp/radiance.tar.gz
- tar -xvf /tmp/radiance.tar.gz
- export PATH=$PATH:$PWD/radiance-5.2.dd0f8e38a7-Linux/usr/local/radiance/bin
- export RAYPATH=.:$PWD/radiance-5.2.dd0f8e38a7-Linux/usr/local/radiance/lib
- export MANPATH=$MANPATH:$PWD/radiance-5.2.dd0f8e38a7-Linux/usr/local/radiance/man
- ls -l /home/travis/build/NREL/bifacial_radiance/

# Copy gencumulativesky into RAYPATH...
- ls -l /home/travis/build/NREL/bifacial_radiance/bifacial_radiance/data
- cp /home/travis/build/NREL/bifacial_radiance/bifacial_radiance/data/gencumulativesky $PWD/radiance-5.2.dd0f8e38a7-Linux/usr/local/radiance/bin/
- ls -l $PWD/radiance-5.2.dd0f8e38a7-Linux/usr/local/radiance/bin
# Example from TravisCI: https://docs.travis-ci.com/user/installing-dependencies
#before_install:
# - wget https://github.com/n1k0/casperjs/archive/1.0.2.tar.gz -O /tmp/casper.tar.gz
Expand All @@ -31,10 +41,12 @@ before_install:

install:
- pip install $REQ_ENV
- pip install coveralls

script:
- pytest

- pytest --cov=bifacial_radiance
after_success:
- coveralls
after_script:
# debug what's going on - try to ls-l the tests folder to see where things are saved
- pwd
Expand Down
216 changes: 41 additions & 175 deletions README.md

Large diffs are not rendered by default.

218 changes: 218 additions & 0 deletions README.md~
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
![logo](docs/images_wiki/bifacial_radiance.png)

# bifacial_radiance
Master branch: [![Build Status](https://travis-ci.com/NREL/bifacial_radiance.svg?branch=master)](https://travis-ci.org/NREL/bifacial_radiance)
Development branch: [![Build Status](https://travis-ci.com/NREL/bifacial_radiance.svg?branch=development)](https://travis-ci.org/NREL/bifacial_radiance)

## Introduction

bifacial_radiance contains a series of Python wrapper functions to make working with
RADIANCE easier, particularly for the PV researcher interested in bifacial PV
performance. Please see the instructions here, notebook examples in the
\docs\ folder of the repo, and discussion on the Wiki for more details!

## Installation Video

https://youtu.be/4A9GocfHKyM
This video shows how to install the bifacial_radiance software and all associated software needed. More info on the Wiki. Instructions are also shown below.

## New: GUI!

A GUI has been added in version 3.0. The GUI reads/writes all input parameters necessary to run a simulation, and runs the specified simulation by calling the correct functions with the specified parameters. So no need to use a journal or a script! But you still need to install following the procedure below.

To run the gui, import bifacial_radiance and run bifacial_radiance.gui()

![GUI](docs/images_wiki/bifacial_radiance_GUI.png)


## Install using pip


#### PREREQUISITES (Step 0):
This software requires the previous installation of RADIANCE from https://github.com/NREL/Radiance/releases.

Make sure you add radiance to the system PATH so Python can interact with the radiance program

If you are on a PC you should also copy the Jaloxa radwinexe-5.0.a.8-win64.zip executables into `program files/radiance/bin`: http://www.jaloxa.eu/resources/radiance/radwinexe.shtml

**Note: bifacial_radiance is not endorsed by or officially connected with the Radiance software package or its development team.**

#### STEP 1: Install and import bifacial_radiance

- run `pip install bifacial_radiance `

#### Alternative if you want a development mode:

- clone the bifacial_radiance repo to your local directory or download and unzip the .zip file
- navigate to the \bifacial_radiance directory using anaconda command line
- run `pip install -e .` ( the period . is required, the -e flag is optional and installs in development mode where changes to the bifacial_radiance.py files are immediately incorporated into the module if you re-start the python kernel)
- for best compatibility, deploy in an Anaconda Python 3.7 environment, or run `pip install -r requirements.txt`

#### STEP 2: Move gencumulativesky.exe
Copy gencumulativesky.exe from the repo's `/bifacial_radiance/data/` directory and copy into your Radiance install directory.
This is typically found in `/program files/radiance/bin/`.

**Note: GenCumulativeSky is detailed in the publication "Robinson, D., Stone, A., Irradiation modeling made simple – the cumulative sky approach and its applications, Proc. PLEA 2004, Eindhoven 2004."**
The source is [available from the authors here.](https://documents.epfl.ch/groups/u/ur/urbansimulation/www/GenCumSky/GenCumSky.zip)

#### STEP 3: Create a local Radiance directory for storing the scene files created
Keep scene geometry files separate from the bifacial_radiance directory. Create a local directory somewhere to be used for storing scene files.

#### STEP 4: Reboot the computer
This makes sure the PATH is updated

## Usage


from bifacial_radiance import RadianceObj # the main container for working with radiance

Now that the module is loaded, let's use it.

demo = RadianceObj(name = 'Testrun', path = 'myfolder') #create a new demo run. Files will have the Testrun prefix, and be saved to 'myfolder'

demo.setGround(0.3) # input albedo number or material name like 'concrete'. To see options, run this without any input.

# Now download an EPW climate file for any global lat/lon value :
epwfile = demo.getEPW(37.5,-77.6) # pull EPW data for any global lat/lon

# let's load this epw file into our MetObj container class.
metdata = demo.readEPW(epwfile) # read in the EPW weather data as metdata object. Run this with no input parameters to load a graphical picker
# if you'd rather use a TMY3 file, select one that you've already downloaded:
metdata = demo.readTMY() # select an existing TMY3 climate file. return metdata object.

Now that we have ground albedo and a climate file loaded, we need to start designing the PV system.
Fixed tilt systems can have hourly simulations with gendaylit, or annual simulations with gencumulativesky


# create cumulativesky skyfiles and save it to the \skies\ directory, along with a .cal file in root
demo.genCumSky(demo.epwfile)

--- optionally ----

demo.gendaylit(metdata,4020) # pass in the metdata object, plus the integer number of the hour in the year you want to run (0 to 8759)
# note that for genCumSky, you pass the *name* of the EPW file. for gendaylit you pass the metdata object.


The nice thing about the RadianceObject is that it keeps track of where all of your skyfiles and calfiles are being saved.
Next let's put a PV system together. The details are saved in a dictionary and passed into makeScene. Let's start with a PV module:

# Create a new moduletype: Prism Solar Bi60. width = .984m height = 1.695m.
demo.makeModule(name='Prism Solar Bi60',x=0.984,y=1.695) #x is assumed module width, y is height.

# Let's print the available module types
demo.printModules()

the module details are stored in a module.json file in the bifacial_radiance\data directory so you can re-use module parameters.
Each unit module generates a corresponding .RAD file in \objects\ which is referenced in our array scene.

Starting in version 0.2.3 there are some nifty module generation options including stacking them (e.g. 2-up or 3-up but any number) with a gap, and torque tube down the middle of the string.

Since version 0.2.4, orientation of the module has been deprecated as an input. Now, to define the orientation it has to be done in the makeModule step, assigning the correct values to the x and y of the module. x is the size of the module along the row, therefore for a landscape module x > y.


# make a 72-cell module 2m x 1m arranged 2-up in portrait with a 10cm torque tube behind.
# a 5cm offset between panels and the tube, along with a 5cm array gap between the modules:

demo.makeModule(name = '1axis_2up', x = 1.995, y = 0.995, torquetube = True, tubetype = 'round',
diameter = 0.1, zgap = 0.05, ygap = 0.05, numpanels = 2)


Now we make a sceneDict with details of our PV array. We'll make a rooftop array of Prism Solar modules in landscape
at 10 degrees tilt.

module_name = 'Prism Solar Bi60'
sceneDict = {'tilt':10,'pitch':1.5,'clearance_height':0.2,'azimuth':180, 'nMods': 20, 'nRows': 7}
# this is passed into makeScene to generate the RADIANCE .rad file
scene = demo.makeScene(module_name,sceneDict) #makeScene creates a .rad file with 20 modules per row, 7 rows.

OK, we're almost done. RADIANCE has to combine the skyfiles, groundfiles, material (\*.mtl) files, and scene geometry (.rad) files
into an OCT file using makeOct. Instead of having to remember where all these files are, the RadianceObj keeps track. Or call .getfilelist()

octfile = demo.makeOct(demo.getfilelist()) # the input parameter is optional - maybe you have a custom file list you want to use

The final step is to query the front and rear irradiance of our array. The default is a 9-point scan through the center module of the center row of the array. The actual scan values are set up by .makeScene and returned in your sceneObj (sceneObj.frontscan, sceneObj.backscan). To do this we use an AnalysisObj.


analysis = AnalysisObj(octfile, demo.name) # return an analysis object including the scan dimensions for back irradiance
analysis.analysis(octfile, demo.name, scene.frontscan, scene.backscan) # compare the back vs front irradiance
print('Annual bifacial ratio average: %0.3f' %( sum(analysis.Wm2Back) / sum(analysis.Wm2Front) ) )

Beginning in v0.2.5 we can query specific scans along the array.

# Do a 4-point scan along the 5th module in the 2nd row of the array.
scene = demo.makeScene(module_name,sceneDict)
octfile = demo.makeOct()
analysis = AnalysisObj(octfile, demo.name)
frontscan, backscan = analysis.moduleAnalysis(scene, sensorsy = 4, modWanted = 5, rowWanted = 2)
frontresults,backresults = analysis.analysis(octfile, demo.name, scene.frontscan, scene.backscan)
print('Annual bifacial ratio on 5th Module average: %0.3f' %( sum(analysis.Wm2Back) / sum(analysis.Wm2Front) ) )

# And you can run the scanning for another module.
frontscan, backscan = analysis.moduleAnalysis(scene, sensorsy = 4, modWanted = 1, rowWanted = 2)
frontresults,backresults = analysis.analysis(octfile, demo.name, scene.frontscan, scene.backscan)
print('Annual bifacial ratio average on 1st Module: %0.3f' %( sum(analysis.Wm2Back) / sum(analysis.Wm2Front) ) )




For more usage examples including 1-axis tracking examples, carport examples, and examples of scenes with multiple sceneObjects (different trackers/modules/etc) see the Jupyter notebooks in \docs\




## Functions
`RadianceObj(basename,path)`: This is the basic container for radiance projects.
Pass in a `basename` string to name your radiance scene and append to various
result and image files. `path` points to an existing or empty Radiance directory.
If the directory is empty it will be populated with appropriate ground.rad and view
files.
Default behavior: basename defaults to current date/time, and path defaults to current directory

`RadianceObj.getfilelist()` : return list of material, sky and rad files for the scene

`RadianceObj.returnOctFiles()` : return files in the root directory with .oct extension

`RadianceObj.setGround(material_or_albedo, material_file)`: set the ground to either
a material type (e.g. 'litesoil') or albedo value e.g. 0.25. 'material_file' is a
filename for a specific material RAD file to load with your material description

`RadianceObj.getEPW(lat,lon)` : download the closest EnergyPlus EPW file for a give lat / lon value.
return: filename of downloaded file

`RadianceObj.readWeatherFile(weatherFile)` : call readEPW or readTMY functions to read in a epw or tmy file. Return: metdata

`RadianceObj.readEPW(epwfilename)` : use pyepw to read in a epw file. Return: metdata

`RadianceObj.readTMY(tmyfilename)` : use pvlib to read in a tmy3 file. Return: metdata

`RadianceObj.gendaylit(metdata,timeindex)` : pass in data read from a EPW file.
Select a single time slice of the annual timeseries to conduct gendaylit Perez model
for that given time

`RadianceObj.gencumsky(epwfilename, startdt, enddt)` : use gencumulativesky.exe to do an entire year simulation.
If no epwfilename is passed, the most recent EPW file read by `readEPW` will be used. startdt and enddt are optional
start and endtimes for the gencumulativesky. NOTE: if you don't have gencumulativesky.exe loaded,
look in bifacial_radiance/data/ for a copy

`RadianceObj.makeOct(filelist, octname)`: create a .oct file from the scene .RAD files. By default
this will use RadianceObj.getfilelist() to build the .oct file, and use RadianceObj.basename as the filename.

`RadianceObj.makeScene(moduletype, sceneDict)` : create a PV array scene with nMods modules per row and nRows number of rows. moduletype specifies the type of module which be one of the options saved in module.JSON (makeModule adds a customModule to the Json file). Pre-loaded module options are 'simple_panel', which generates a simple 0.95m x 1.59m module, or 'monopanel' which looks for 'objects/monopanel_1.rad'. sceneDict is a dictionary containing the following keys: 'tilt','pitch','clearance_height','azimuth', 'nMods', 'nRows'.
Return: SceneObj which includes details about the PV scene including frontscan and backscan details

`RadianceObj.getTrackingGeometryTimeIndex(metdata, timeindex, angledelta, roundTrackerAngleBool, backtrack, gcr, hubheight, sceney)`: returns tracker tilt and clearance height for a specific point in time.
Return: tracker_theta, tracker_height, tracker_azimuth_ang

`AnalysisObj(octfile,basename)` : Object for conducting analysis on a .OCT file.

`AnalysisObj.makeImage(viewfile,octfile, basename)` : create visual render of scene 'octfile' from view 'views/viewfile'

`AnalysisObj.makeFalseColor(viewfile,octfile, basename)` : create false color Wm-2
render of scene 'octfile' from view 'views/viewfile'

`AnalysisObj.analysis(octfile, basename, frontscan, backscan)` : conduct a general front / back ratio
analysis of a .oct file. frontscan, backscan: dictionary input for linePtsMakeDict that
is passed from AnalysisObj.makeScene.


MORE DOCS TO COME:
4 changes: 4 additions & 0 deletions bifacial_radiance/TEMP/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
3 changes: 2 additions & 1 deletion bifacial_radiance/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import absolute_import
from bifacial_radiance.main import AnalysisObj, GroundObj, MetObj, RadianceObj, SceneObj
from bifacial_radiance.readepw import readepw
#from bifacial_radiance.readepw import readepw
from bifacial_radiance import load
from bifacial_radiance import modelchain
from bifacial_radiance.gui import gui
from bifacial_radiance import mismatch
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions