30
30
def get_solarposition (time , latitude , longitude ,
31
31
altitude = None , pressure = None ,
32
32
method = 'nrel_numpy' ,
33
- temperature = 12 , ** kwargs ):
33
+ temperature = 12.0 , ** kwargs ):
34
34
"""
35
35
A convenience wrapper for the solar position calculators.
36
36
@@ -125,8 +125,8 @@ def get_solarposition(time, latitude, longitude,
125
125
return ephem_df
126
126
127
127
128
- def spa_c (time , latitude , longitude , pressure = 101325 , altitude = 0 ,
129
- temperature = 12 , delta_t = 67.0 ,
128
+ def spa_c (time , latitude , longitude , pressure = 101325. , altitude = 0. ,
129
+ temperature = 12. , delta_t = 67.0 ,
130
130
raw_spa_output = False ):
131
131
r"""
132
132
Calculate the solar position using the C implementation of the NREL
@@ -149,11 +149,11 @@ def spa_c(time, latitude, longitude, pressure=101325, altitude=0,
149
149
longitude : float
150
150
Longitude in decimal degrees. Positive east of prime meridian,
151
151
negative to west.
152
- pressure : float, default 101325
152
+ pressure : float, default 101325.0
153
153
Pressure in Pascals
154
- altitude : float, default 0
154
+ altitude : float, default 0.0
155
155
Height above sea level. [m]
156
- temperature : float, default 12
156
+ temperature : float, default 12.0
157
157
Temperature in C
158
158
delta_t : float, default 67.0
159
159
Difference between terrestrial time and UT1.
@@ -279,7 +279,7 @@ def _datetime_to_unixtime(dtindex):
279
279
280
280
281
281
def spa_python (time , latitude , longitude ,
282
- altitude = 0 , pressure = 101325 , temperature = 12 , delta_t = 67.0 ,
282
+ altitude = 0. , pressure = 101325. , temperature = 12. , delta_t = 67.0 ,
283
283
atmos_refract = None , how = 'numpy' , numthreads = 4 ):
284
284
"""
285
285
Calculate the solar position using a python implementation of the
@@ -302,11 +302,11 @@ def spa_python(time, latitude, longitude,
302
302
longitude : float
303
303
Longitude in decimal degrees. Positive east of prime meridian,
304
304
negative to west.
305
- altitude : float, default 0
305
+ altitude : float, default 0.0
306
306
Distance above sea level.
307
- pressure : int or float, optional, default 101325
307
+ pressure : int or float, optional, default 101325.0
308
308
avg. yearly air pressure in Pascals.
309
- temperature : int or float, optional, default 12
309
+ temperature : int or float, optional, default 12.0
310
310
avg. yearly air temperature in degrees C.
311
311
delta_t : float or array, optional, default 67.0
312
312
Difference between terrestrial time and UT1.
@@ -507,9 +507,9 @@ def _ephem_setup(latitude, longitude, altitude, pressure, temperature,
507
507
508
508
def sun_rise_set_transit_ephem (times , latitude , longitude ,
509
509
next_or_previous = 'next' ,
510
- altitude = 0 ,
511
- pressure = 101325 ,
512
- temperature = 12 , horizon = '0:00' ):
510
+ altitude = 0. ,
511
+ pressure = 101325. ,
512
+ temperature = 12. , horizon = '0:00' ):
513
513
"""
514
514
Calculate the next sunrise and sunset times using the PyEphem package.
515
515
@@ -523,11 +523,11 @@ def sun_rise_set_transit_ephem(times, latitude, longitude,
523
523
Longitude in degrees, positive east of prime meridian, negative to west
524
524
next_or_previous : str
525
525
'next' or 'previous' sunrise and sunset relative to time
526
- altitude : float, default 0
526
+ altitude : float, default 0.0
527
527
distance above sea level in meters.
528
- pressure : int or float, optional, default 101325
528
+ pressure : int or float, optional, default 101325.0
529
529
air pressure in Pascals.
530
- temperature : int or float, optional, default 12
530
+ temperature : int or float, optional, default 12.0
531
531
air temperature in degrees C.
532
532
horizon : string, format +/-X:YY
533
533
arc degrees:arc minutes from geometrical horizon for sunrise and
@@ -590,8 +590,8 @@ def sun_rise_set_transit_ephem(times, latitude, longitude,
590
590
'transit' : trans })
591
591
592
592
593
- def pyephem (time , latitude , longitude , altitude = 0 , pressure = 101325 ,
594
- temperature = 12 , horizon = '+0:00' ):
593
+ def pyephem (time , latitude , longitude , altitude = 0. , pressure = 101325. ,
594
+ temperature = 12. , horizon = '+0:00' ):
595
595
"""
596
596
Calculate the solar position using the PyEphem package.
597
597
@@ -605,11 +605,11 @@ def pyephem(time, latitude, longitude, altitude=0, pressure=101325,
605
605
longitude : float
606
606
Longitude in decimal degrees. Positive east of prime meridian,
607
607
negative to west.
608
- altitude : float, default 0
608
+ altitude : float, default 0.0
609
609
Height above sea level in meters. [m]
610
- pressure : int or float, optional, default 101325
610
+ pressure : int or float, optional, default 101325.0
611
611
air pressure in Pascals.
612
- temperature : int or float, optional, default 12
612
+ temperature : int or float, optional, default 12.0
613
613
air temperature in degrees C.
614
614
horizon : string, optional, default '+0:00'
615
615
arc degrees:arc minutes from geometrical horizon for sunrise and
@@ -679,7 +679,7 @@ def pyephem(time, latitude, longitude, altitude=0, pressure=101325,
679
679
return sun_coords
680
680
681
681
682
- def ephemeris (time , latitude , longitude , pressure = 101325 , temperature = 12 ):
682
+ def ephemeris (time , latitude , longitude , pressure = 101325.0 , temperature = 12.0 ):
683
683
"""
684
684
Python-native solar position calculator.
685
685
The accuracy of this code is not guaranteed.
@@ -695,9 +695,9 @@ def ephemeris(time, latitude, longitude, pressure=101325, temperature=12):
695
695
longitude : float
696
696
Longitude in decimal degrees. Positive east of prime meridian,
697
697
negative to west.
698
- pressure : float or Series, default 101325
698
+ pressure : float or Series, default 101325.0
699
699
Ambient pressure (Pascals)
700
- temperature : float or Series, default 12
700
+ temperature : float or Series, default 12.0
701
701
Ambient temperature (C)
702
702
703
703
Returns
@@ -856,8 +856,8 @@ def ephemeris(time, latitude, longitude, pressure=101325, temperature=12):
856
856
857
857
858
858
def calc_time (lower_bound , upper_bound , latitude , longitude , attribute , value ,
859
- altitude = 0 , pressure = 101325 , temperature = 12 , horizon = '+0:00' ,
860
- xtol = 1.0e-12 ):
859
+ altitude = 0.0 , pressure = 101325.0 , temperature = 12.0 ,
860
+ horizon = '+0:00' , xtol = 1.0e-12 ):
861
861
"""
862
862
Calculate the time between lower_bound and upper_bound
863
863
where the attribute is equal to value. Uses PyEphem for
@@ -879,12 +879,12 @@ def calc_time(lower_bound, upper_bound, latitude, longitude, attribute, value,
879
879
and 'az' (which must be given in radians).
880
880
value : int or float
881
881
The value of the attribute to solve for
882
- altitude : float, default 0
882
+ altitude : float, default 0.0
883
883
Distance above sea level.
884
- pressure : int or float, optional, default 101325
884
+ pressure : int or float, optional, default 101325.0
885
885
Air pressure in Pascals. Set to 0 for no
886
886
atmospheric correction.
887
- temperature : int or float, optional, default 12
887
+ temperature : int or float, optional, default 12.0
888
888
Air temperature in degrees C.
889
889
horizon : string, optional, default '+0:00'
890
890
arc degrees:arc minutes from geometrical horizon for sunrise and
0 commit comments