1
1
"""
2
- The ``atmosphere`` module contains methods to calculate
2
+ The ``atmosphere`` module contains methods to calculate
3
3
relative and absolute airmass and to determine
4
4
pressure from altitude or vice versa.
5
5
"""
@@ -29,7 +29,7 @@ def pres2alt(pressure):
29
29
Returns
30
30
-------
31
31
altitude : scalar or Series
32
- Altitude in meters above sea level
32
+ Altitude in meters above sea level
33
33
34
34
Notes
35
35
------
@@ -66,7 +66,7 @@ def alt2pres(altitude):
66
66
Parameters
67
67
----------
68
68
Altitude : scalar or Series
69
- Altitude in meters above sea level
69
+ Altitude in meters above sea level
70
70
71
71
Returns
72
72
-------
@@ -103,26 +103,26 @@ def alt2pres(altitude):
103
103
104
104
def absoluteairmass (airmass_relative , pressure = 101325. ):
105
105
'''
106
- Determine absolute (pressure corrected) airmass from relative
106
+ Determine absolute (pressure corrected) airmass from relative
107
107
airmass and pressure
108
108
109
109
Gives the airmass for locations not at sea-level (i.e. not at standard
110
110
pressure). The input argument "AMrelative" is the relative airmass. The
111
111
input argument "pressure" is the pressure (in Pascals) at the location
112
112
of interest and must be greater than 0. The calculation for
113
113
absolute airmass is
114
-
114
+
115
115
.. math::
116
116
absolute airmass = (relative airmass)*pressure/101325
117
117
118
118
Parameters
119
119
----------
120
120
121
- airmass_relative : scalar or Series
122
- The airmass at sea-level.
121
+ airmass_relative : scalar or Series
122
+ The airmass at sea-level.
123
123
124
124
pressure : scalar or Series
125
- The site pressure in Pascal.
125
+ The site pressure in Pascal.
126
126
127
127
Returns
128
128
-------
@@ -131,7 +131,7 @@ def absoluteairmass(airmass_relative, pressure=101325.):
131
131
132
132
References
133
133
----------
134
- [1] C. Gueymard, "Critical analysis and performance assessment of
134
+ [1] C. Gueymard, "Critical analysis and performance assessment of
135
135
clear sky solar irradiance models using theoretical and measured data,"
136
136
Solar Energy, vol. 51, pp. 121-138, 1993.
137
137
@@ -147,26 +147,26 @@ def relativeairmass(zenith, model='kastenyoung1989'):
147
147
Gives the relative (not pressure-corrected) airmass.
148
148
149
149
Gives the airmass at sea-level when given a sun zenith angle
150
- (in degrees).
150
+ (in degrees).
151
151
The ``model`` variable allows selection of different airmass models
152
- (described below). If ``model`` is not
152
+ (described below). If ``model`` is not
153
153
included or is not valid, the default model is 'kastenyoung1989'.
154
154
155
155
Parameters
156
156
----------
157
157
158
- zenith : float or Series
159
- Zenith angle of the sun in degrees.
158
+ zenith : float or Series
159
+ Zenith angle of the sun in degrees.
160
160
Note that some models use the apparent (refraction corrected)
161
161
zenith angle, and some models use the true
162
162
(not refraction-corrected) zenith angle.
163
163
See model descriptions to determine which type of zenith
164
164
angle is required.
165
165
Apparent zenith angles must be calculated at sea level.
166
-
167
- model : String
166
+
167
+ model : String
168
168
Available models include the following:
169
-
169
+
170
170
* 'simple' - secant(apparent zenith angle) -
171
171
Note that this gives -inf at zenith=90
172
172
* 'kasten1966' - See reference [1] - requires apparent sun zenith
@@ -178,8 +178,8 @@ def relativeairmass(zenith, model='kastenyoung1989'):
178
178
179
179
Returns
180
180
-------
181
- airmass_relative : float or Series
182
- Relative airmass at sea level. Will return NaN values for any
181
+ airmass_relative : float or Series
182
+ Relative airmass at sea level. Will return NaN values for any
183
183
zenith angle greater than 90 degrees.
184
184
185
185
References
@@ -190,31 +190,31 @@ def relativeairmass(zenith, model='kastenyoung1989'):
190
190
Army Material Command, CRREL.
191
191
192
192
[2] A. T. Young and W. M. Irvine, "Multicolor Photoelectric Photometry
193
- of the Brighter Planets," The Astronomical Journal, vol. 72,
193
+ of the Brighter Planets," The Astronomical Journal, vol. 72,
194
194
pp. 945-950, 1967.
195
195
196
196
[3] Fritz Kasten and Andrew Young. "Revised optical air mass tables and
197
197
approximation formula". Applied Optics 28:4735-4738
198
198
199
- [4] C. Gueymard, "Critical analysis and performance assessment of
199
+ [4] C. Gueymard, "Critical analysis and performance assessment of
200
200
clear sky solar irradiance models using theoretical and measured data,"
201
201
Solar Energy, vol. 51, pp. 121-138, 1993.
202
202
203
- [5] A. T. Young, "AIR-MASS AND REFRACTION," Applied Optics, vol. 33,
203
+ [5] A. T. Young, "AIR-MASS AND REFRACTION," Applied Optics, vol. 33,
204
204
pp. 1108-1110, Feb 1994.
205
205
206
206
[6] Keith A. Pickering. "The Ancient Star Catalog". DIO 12:1, 20,
207
-
207
+
208
208
[7] Matthew J. Reno, Clifford W. Hansen and Joshua S. Stein,
209
209
"Global Horizontal Irradiance Clear Sky Models: Implementation and Analysis"
210
210
Sandia Report, (2012).
211
211
'''
212
-
212
+
213
213
z = zenith
214
214
zenith_rad = np .radians (z )
215
-
215
+
216
216
model = model .lower ()
217
-
217
+
218
218
if 'kastenyoung1989' == model :
219
219
AM = ( 1.0 / (np .cos (zenith_rad ) +
220
220
0.50572 * (((6.07995 + (90 - z )) ** - 1.6364 ))) )
@@ -242,10 +242,10 @@ def relativeairmass(zenith, model='kastenyoung1989'):
242
242
model )
243
243
AM = ( 1.0 / (np .cos (zenith_rad ) +
244
244
0.50572 * (((6.07995 + (90 - z )) ** - 1.6364 ))) )
245
-
245
+
246
246
try :
247
247
AM [z > 90 ] = np .nan
248
248
except TypeError :
249
249
AM = np .nan if z > 90 else AM
250
-
250
+
251
251
return AM
0 commit comments