forked from Ripalda/Tandems
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genBins.py
59 lines (43 loc) · 2.69 KB
/
genBins.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*- coding: utf-8 -*-
"""This pyhton script can be used to generate the .npy files with the spectra
used to calculate the yearly energy yield"""
import tandems
# Use spectra from National Solar Resource DataBase
tandems.generate_spectral_bins(NSRDBfile='Reno.csv')
# Use spectra from National Solar Resource DataBase
tandems.generate_spectral_bins(NSRDBfile='Boulder.csv')
# Use spectra from National Solar Resource DataBase
tandems.generate_spectral_bins(NSRDBfile='Indianapolis.csv')
# Use spectra from National Solar Resource DataBase
tandems.generate_spectral_bins(NSRDBfile='Philadelphia.csv')
# Fixed lattitude, tracking for both global and direct spectra, random AOD and PW
tandems.generate_spectral_bins(latMin=40,latMax=40,fname='lat40', saveFullSpectra=True)
# No tracking for global spectra, plane tilted 37 degrees
tandems.generate_spectral_bins(latMin=40,latMax=40,tracking='38 37 180',fname='lat40tilted')
# 1 axis azimutal tracking for global spectra, plane tilted 37 degrees
tandems.generate_spectral_bins(latMin=40,latMax=40,tracking='38 37 -999',fname='lat401axis')
# Lattitude = 60
tandems.generate_spectral_bins(latMin=60,latMax=60,fname='lat60')
# Lattitude = 0
tandems.generate_spectral_bins(latMin=0,latMax=0,fname='lat0')
# Fixed AOD and PW
tandems.generate_spectral_bins(latMin=40,latMax=40,fname='lat40lowAOD',AOD=0.084,PW=1.416)
# Random locations with -50 < Lattitude < 50
tandems.generate_spectral_bins(latMin=-50,latMax=50,fname='randomLocations')
specs = tandems.np.load('lat40.full.npy')
specs[0, :, :] = specs[0, :, :] - specs[1, :, :] # diffuse = Global - Direct
tandems.np.save('diffuse.full',specs)
tandems.generate_spectral_bins(loadFullSpectra = True, fname='diffuse')
# FUNCTION tandems.generate_spectral_bins(latMin=40 , latMax=40, longitude='random', AOD='random', PW='random', tracking=True, NSRDBfile='', fname='Iscs')
# Generates a file with a complete set of binned averaged spectra for yearly energy yield calculations
# Location can be randomized within given lattitude limits: latMin, latMax.
# This might be useful to optimize cell designs to yield maximum energy for a range of lattitudes and atmospheric conditions, rather than at a single specific location.
# NECESARY CHANGES IN SMARTS 2.9.5 SOURCE CODE
# Line 189
# batch = .TRUE.
# Line 1514
# IF(Zenit.LE.75.5224)GOTO 13
# WRITE(16,103,iostat = Ierr24)Zenit
# 103 FORMAT(//,'Zenit = ',F6.2,' is > 75.5224 deg. (90 in original code) This is equivalent to AM < 4'
# This change is needed because trackers are shadowed by neighboring trackers when the sun is near the horizon.
# Zenit 80 is already too close to the horizon to use in most cases due to shadowing issues.