pvlib.iotools.parse_psm3¶
-
pvlib.iotools.
parse_psm3
(fbuf)[source]¶ Parse an NSRDB [1] PSM3 weather file (formatted as SAM CSV [2]).
Parameters: fbuf (file-like object) – File-like object containing data to read. Returns: - headers (dict) – metadata from NREL PSM3 about the record, see notes for fields
- data (pandas.DataFrame) – timeseries data from NREL PSM3
Notes
The return is a tuple with two items. The first item is a header with metadata from NREL PSM3 about the record containing the following fields:
- Source
- Location ID
- City
- State
- Country
- Latitude
- Longitude
- Time Zone
- Elevation
- Local Time Zone
- Clearsky DHI Units
- Clearsky DNI Units
- Clearsky GHI Units
- Dew Point Units
- DHI Units
- DNI Units
- GHI Units
- Solar Zenith Angle Units
- Temperature Units
- Pressure Units
- Relative Humidity Units
- Precipitable Water Units
- Wind Direction Units
- Wind Speed
- Cloud Type -15
- Cloud Type 0
- Cloud Type 1
- Cloud Type 2
- Cloud Type 3
- Cloud Type 4
- Cloud Type 5
- Cloud Type 6
- Cloud Type 7
- Cloud Type 8
- Cloud Type 9
- Cloud Type 10
- Cloud Type 11
- Cloud Type 12
- Fill Flag 0
- Fill Flag 1
- Fill Flag 2
- Fill Flag 3
- Fill Flag 4
- Fill Flag 5
- Surface Albedo Units
- Version
The second item is a dataframe with the PSM3 timeseries data.
Examples
>>> # Read a local PSM3 file: >>> with open(filename, 'r') as f: # doctest: +SKIP ... metadata, df = iotools.parse_psm3(f) # doctest: +SKIP
References
[1] NREL National Solar Radiation Database (NSRDB) [2] Standard Time Series Data File Format