pvlib.iotools.read_tmy3#
- pvlib.iotools.read_tmy3(filename, coerce_year=None, recolumn=True)[source]#
Read a TMY3 file into a pandas dataframe.
Note that values contained in the metadata dictionary are unchanged from the TMY3 file (i.e. units are retained). In the case of any discrepancies between this documentation and the TMY3 User’s Manual 1, the TMY3 User’s Manual takes precedence.
The TMY3 files were updated in Jan. 2015. This function requires the use of the updated files.
- Parameters
filename (str) – A relative file path or absolute file path.
coerce_year (None or int, default None) – If supplied, the year of the index will be set to coerce_year, except for the last index value which will be set to the next year so that the index increases monotonically.
recolumn (bool, default True) – If
True
, apply standard names to TMY3 columns. Typically this results in stripping the units from the column name.
- Returns
Tuple of the form (data, metadata).
data (DataFrame) – A pandas dataframe with the columns described in the table below. For more detailed descriptions of each component, please consult the TMY3 User’s Manual (1), especially tables 1-1 through 1-6.
metadata (dict) – The site metadata available in the file.
Notes
The returned structures have the following fields.
key
format
description
altitude
Float
site elevation
latitude
Float
site latitudeitude
longitude
Float
site longitudeitude
Name
String
site name
State
String
state
TZ
Float
UTC offset
USAF
Int
USAF identifier
field
description
Index
A pandas datetime index. NOTE, the index is timezone aware, and times are set to local standard time (daylight savings is not included)
ETR
Extraterrestrial horizontal radiation recv’d during 60 minutes prior to timestamp, Wh/m^2
ETRN
Extraterrestrial normal radiation recv’d during 60 minutes prior to timestamp, Wh/m^2
GHI
Direct and diffuse horizontal radiation recv’d during 60 minutes prior to timestamp, Wh/m^2
GHISource
See 1, Table 1-4
GHIUncertainty
Uncertainty based on random and bias error estimates see 2
DNI
Amount of direct normal radiation (modeled) recv’d during 60 mintues prior to timestamp, Wh/m^2
DNISource
See 1, Table 1-4
DNIUncertainty
Uncertainty based on random and bias error estimates see 2
DHI
Amount of diffuse horizontal radiation recv’d during 60 minutes prior to timestamp, Wh/m^2
DHISource
See 1, Table 1-4
DHIUncertainty
Uncertainty based on random and bias error estimates see 2
GHillum
Avg. total horizontal illuminance recv’d during the 60 minutes prior to timestamp, lx
GHillumSource
See 1, Table 1-4
GHillumUncertainty
Uncertainty based on random and bias error estimates see 2
DNillum
Avg. direct normal illuminance recv’d during the 60 minutes prior to timestamp, lx
DNillumSource
See 1, Table 1-4
DNillumUncertainty
Uncertainty based on random and bias error estimates see 2
DHillum
Avg. horizontal diffuse illuminance recv’d during the 60 minutes prior to timestamp, lx
DHillumSource
See 1, Table 1-4
DHillumUncertainty
Uncertainty based on random and bias error estimates see 2
Zenithlum
Avg. luminance at the sky’s zenith during the 60 minutes prior to timestamp, cd/m^2
ZenithlumSource
See 1, Table 1-4
ZenithlumUncertainty
Uncertainty based on random and bias error estimates see 1 section 2.10
TotCld
Amount of sky dome covered by clouds or obscuring phenonema at time stamp, tenths of sky
TotCldSource
See 1, Table 1-5
TotCldUncertainty
See 1, Table 1-6
OpqCld
Amount of sky dome covered by clouds or obscuring phenonema that prevent observing the sky at time stamp, tenths of sky
OpqCldSource
See 1, Table 1-5
OpqCldUncertainty
See 1, Table 1-6
DryBulb
Dry bulb temperature at the time indicated, deg C
DryBulbSource
See 1, Table 1-5
DryBulbUncertainty
See 1, Table 1-6
DewPoint
Dew-point temperature at the time indicated, deg C
DewPointSource
See 1, Table 1-5
DewPointUncertainty
See 1, Table 1-6
RHum
Relatitudeive humidity at the time indicated, percent
RHumSource
See 1, Table 1-5
RHumUncertainty
See 1, Table 1-6
Pressure
Station pressure at the time indicated, 1 mbar
PressureSource
See 1, Table 1-5
PressureUncertainty
See 1, Table 1-6
Wdir
Wind direction at time indicated, degrees from north (360 = north; 0 = undefined,calm)
WdirSource
See 1, Table 1-5
WdirUncertainty
See 1, Table 1-6
Wspd
Wind speed at the time indicated, meter/second
WspdSource
See 1, Table 1-5
WspdUncertainty
See 1, Table 1-6
Hvis
Distance to discernable remote objects at time indicated (7777=unlimited), meter
HvisSource
See 1, Table 1-5
HvisUncertainty
See 1, Table 1-6
CeilHgt
Height of cloud base above local terrain (7777=unlimited), meter
CeilHgtSource
See 1, Table 1-5
CeilHgtUncertainty
See 1, Table 1-6
Pwat
Total precipitable water contained in a column of unit cross section from earth to top of atmosphere, cm
PwatSource
See 1, Table 1-5
PwatUncertainty
See 1, Table 1-6
AOD
The broadband aerosol optical depth per unit of air mass due to extinction by aerosol component of atmosphere, unitless
AODSource
See 1, Table 1-5
AODUncertainty
See 1, Table 1-6
Alb
The ratio of reflected solar irradiance to global horizontal irradiance, unitless
AlbSource
See 1, Table 1-5
AlbUncertainty
See 1, Table 1-6
Lprecipdepth
The amount of liquid precipitation observed at indicated time for the period indicated in the liquid precipitation quantity field, millimeter
Lprecipquantity
The period of accumulatitudeion for the liquid precipitation depth field, hour
LprecipSource
See 1, Table 1-5
LprecipUncertainty
See 1, Table 1-6
PresWth
Present weather code, see 2.
PresWthSource
Present weather code source, see 2.
PresWthUncertainty
Present weather code uncertainty, see 2.
Midnight representation
The function is able to handle midnight represented as 24:00 (NREL TMY3 format, see 1) and as 00:00 (SolarAnywhere TMY3 format, see 3).
Warning
TMY3 irradiance data corresponds to the previous hour, so the first index is 1AM, corresponding to the irradiance from midnight to 1AM, and the last index is midnight of the next year. For example, if the last index in the TMY3 file was 1988-12-31 24:00:00 this becomes 1989-01-01 00:00:00 after calling
read_tmy3()
.Warning
When coercing the year, the last index in the dataframe will become midnight of the next year. For example, if the last index in the TMY3 was 1988-12-31 24:00:00, and year is coerced to 1990 then this becomes 1991-01-01 00:00:00.
References
- 1(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)
Wilcox, S and Marion, W. “Users Manual for TMY3 Data Sets”. NREL/TP-581-43156, Revised May 2008.
- 2(1,2,3,4,5,6,7,8,9)
Wilcox, S. (2007). National Solar Radiation Database 1991 2005 Update: Users Manual. 472 pp.; NREL Report No. TP-581-41364.
- 3
Examples using pvlib.iotools.read_tmy3
#

Simulating PV system DC output using the ADR module efficiency model