2727from pvlib .tools import datetime_to_djd , djd_to_datetime
2828
2929
30- def get_solarposition (
31- time ,
32- latitude ,
33- longitude ,
34- altitude ,
35- pressure = None ,
36- method = 'nrel_numpy' ,
37- temperature = 12. ,
38- ** kwargs
39- ):
30+ def get_solarposition (time , latitude , longitude ,
31+ altitude = None , pressure = None ,
32+ method = 'nrel_numpy' ,
33+ temperature = 12 , ** kwargs ):
4034 """
4135 A convenience wrapper for the solar position calculators.
4236
@@ -131,8 +125,8 @@ def get_solarposition(
131125 return ephem_df
132126
133127
134- def spa_c (time , latitude , longitude , pressure = 101325. , altitude = 0. ,
135- temperature = 12. , delta_t = 67.0 ,
128+ def spa_c (time , latitude , longitude , pressure = 101325 , altitude = 0 ,
129+ temperature = 12 , delta_t = 67.0 ,
136130 raw_spa_output = False ):
137131 r"""
138132 Calculate the solar position using the C implementation of the NREL
@@ -155,11 +149,11 @@ def spa_c(time, latitude, longitude, pressure=101325., altitude=0.,
155149 longitude : float
156150 Longitude in decimal degrees. Positive east of prime meridian,
157151 negative to west.
158- pressure : float, default 101325.0
152+ pressure : float, default 101325
159153 Pressure in Pascals
160- altitude : float, default 0.0
154+ altitude : float, default 0
161155 Height above sea level. [m]
162- temperature : float, default 12.0
156+ temperature : float, default 12
163157 Temperature in C
164158 delta_t : float, default 67.0
165159 Difference between terrestrial time and UT1.
@@ -285,7 +279,7 @@ def _datetime_to_unixtime(dtindex):
285279
286280
287281def spa_python (time , latitude , longitude ,
288- altitude = 0. , pressure = 101325. , temperature = 12. , delta_t = 67.0 ,
282+ altitude = 0 , pressure = 101325 , temperature = 12 , delta_t = 67.0 ,
289283 atmos_refract = None , how = 'numpy' , numthreads = 4 ):
290284 """
291285 Calculate the solar position using a python implementation of the
@@ -308,11 +302,11 @@ def spa_python(time, latitude, longitude,
308302 longitude : float
309303 Longitude in decimal degrees. Positive east of prime meridian,
310304 negative to west.
311- altitude : float, default 0.0
305+ altitude : float, default 0
312306 Distance above sea level.
313- pressure : int or float, optional, default 101325.0
307+ pressure : int or float, optional, default 101325
314308 avg. yearly air pressure in Pascals.
315- temperature : int or float, optional, default 12.0
309+ temperature : int or float, optional, default 12
316310 avg. yearly air temperature in degrees C.
317311 delta_t : float or array, optional, default 67.0
318312 Difference between terrestrial time and UT1.
@@ -513,9 +507,9 @@ def _ephem_setup(latitude, longitude, altitude, pressure, temperature,
513507
514508def sun_rise_set_transit_ephem (times , latitude , longitude ,
515509 next_or_previous = 'next' ,
516- altitude = 0. ,
517- pressure = 101325. ,
518- temperature = 12. , horizon = '0:00' ):
510+ altitude = 0 ,
511+ pressure = 101325 ,
512+ temperature = 12 , horizon = '0:00' ):
519513 """
520514 Calculate the next sunrise and sunset times using the PyEphem package.
521515
@@ -529,11 +523,11 @@ def sun_rise_set_transit_ephem(times, latitude, longitude,
529523 Longitude in degrees, positive east of prime meridian, negative to west
530524 next_or_previous : str
531525 'next' or 'previous' sunrise and sunset relative to time
532- altitude : float, default 0.0
526+ altitude : float, default 0
533527 distance above sea level in meters.
534- pressure : int or float, optional, default 101325.0
528+ pressure : int or float, optional, default 101325
535529 air pressure in Pascals.
536- temperature : int or float, optional, default 12.0
530+ temperature : int or float, optional, default 12
537531 air temperature in degrees C.
538532 horizon : string, format +/-X:YY
539533 arc degrees:arc minutes from geometrical horizon for sunrise and
@@ -596,8 +590,8 @@ def sun_rise_set_transit_ephem(times, latitude, longitude,
596590 'transit' : trans })
597591
598592
599- def pyephem (time , latitude , longitude , altitude = 0. , pressure = 101325. ,
600- temperature = 12. , horizon = '+0:00' ):
593+ def pyephem (time , latitude , longitude , altitude = 0 , pressure = 101325 ,
594+ temperature = 12 , horizon = '+0:00' ):
601595 """
602596 Calculate the solar position using the PyEphem package.
603597
@@ -611,11 +605,11 @@ def pyephem(time, latitude, longitude, altitude=0., pressure=101325.,
611605 longitude : float
612606 Longitude in decimal degrees. Positive east of prime meridian,
613607 negative to west.
614- altitude : float, default 0.0
608+ altitude : float, default 0
615609 Height above sea level in meters. [m]
616- pressure : int or float, optional, default 101325.0
610+ pressure : int or float, optional, default 101325
617611 air pressure in Pascals.
618- temperature : int or float, optional, default 12.0
612+ temperature : int or float, optional, default 12
619613 air temperature in degrees C.
620614 horizon : string, optional, default '+0:00'
621615 arc degrees:arc minutes from geometrical horizon for sunrise and
@@ -685,7 +679,7 @@ def pyephem(time, latitude, longitude, altitude=0., pressure=101325.,
685679 return sun_coords
686680
687681
688- def ephemeris (time , latitude , longitude , pressure = 101325.0 , temperature = 12.0 ):
682+ def ephemeris (time , latitude , longitude , pressure = 101325 , temperature = 12 ):
689683 """
690684 Python-native solar position calculator.
691685 The accuracy of this code is not guaranteed.
@@ -701,9 +695,9 @@ def ephemeris(time, latitude, longitude, pressure=101325.0, temperature=12.0):
701695 longitude : float
702696 Longitude in decimal degrees. Positive east of prime meridian,
703697 negative to west.
704- pressure : float or Series, default 101325.0
698+ pressure : float or Series, default 101325
705699 Ambient pressure (Pascals)
706- temperature : float or Series, default 12.0
700+ temperature : float or Series, default 12
707701 Ambient temperature (C)
708702
709703 Returns
@@ -862,8 +856,8 @@ def ephemeris(time, latitude, longitude, pressure=101325.0, temperature=12.0):
862856
863857
864858def calc_time (lower_bound , upper_bound , latitude , longitude , attribute , value ,
865- altitude = 0.0 , pressure = 101325.0 , temperature = 12.0 ,
866- horizon = '+0:00' , xtol = 1.0e-12 ):
859+ altitude = 0 , pressure = 101325 , temperature = 12 , horizon = '+0:00' ,
860+ xtol = 1.0e-12 ):
867861 """
868862 Calculate the time between lower_bound and upper_bound
869863 where the attribute is equal to value. Uses PyEphem for
@@ -885,12 +879,12 @@ def calc_time(lower_bound, upper_bound, latitude, longitude, attribute, value,
885879 and 'az' (which must be given in radians).
886880 value : int or float
887881 The value of the attribute to solve for
888- altitude : float, default 0.0
882+ altitude : float, default 0
889883 Distance above sea level.
890- pressure : int or float, optional, default 101325.0
884+ pressure : int or float, optional, default 101325
891885 Air pressure in Pascals. Set to 0 for no
892886 atmospheric correction.
893- temperature : int or float, optional, default 12.0
887+ temperature : int or float, optional, default 12
894888 Air temperature in degrees C.
895889 horizon : string, optional, default '+0:00'
896890 arc degrees:arc minutes from geometrical horizon for sunrise and
0 commit comments