IO Tools

Functions for retrieving, reading, and writing data from a variety of sources and file formats relevant to solar energy modeling.


Read a TMY2 file in to a DataFrame.

iotools.read_tmy3(filename[, coerce_year, …])

Read a TMY3 file in to a pandas dataframe.

iotools.read_epw(filename[, coerce_year])

Read an EPW file in to a pandas dataframe.

iotools.parse_epw(csvdata[, coerce_year])

Given a file-like buffer with data in Energy Plus Weather (EPW) format, parse the data into a dataframe.


Read University of Oregon SRML 1min .tsv file into pandas dataframe.

iotools.read_srml_month_from_solardat(…[, …])

Request a month of SRML data from solardat and read it into a Dataframe.

iotools.read_surfrad(filename[, map_variables])

Read in a daily NOAA SURFRAD file.

iotools.read_midc(filename[, variable_map, …])

Read in National Renewable Energy Laboratory Measurement and Instrumentation Data Center weather data.

iotools.read_midc_raw_data_from_nrel(site, …)

Request and read MIDC data directly from the raw data api.

iotools.read_ecmwf_macc(filename, latitude, …)

Read data from ECMWF MACC reanalysis netCDF4 file.

iotools.get_ecmwf_macc(filename, params, …)

Download data from ECMWF MACC Reanalysis API.


Read a NOAA USCRN fixed-width file into pandas dataframe.


Read NOAA SOLRAD fixed-width file into pandas dataframe.

iotools.get_psm3(latitude, longitude, …[, …])

Retrieve NSRDB PSM3 timeseries weather data from the PSM3 API.


Read an NSRDB PSM3 weather file (formatted as SAM CSV).


Parse an NSRDB PSM3 weather file (formatted as SAM CSV).

iotools.get_pvgis_tmy(latitude, longitude[, …])

Get TMY data from PVGIS.

iotools.read_pvgis_tmy(filename[, …])

Read a file downloaded from PVGIS.

iotools.get_pvgis_hourly(latitude, longitude)

Get hourly solar irradiation and modeled PV power output from PVGIS.

iotools.read_pvgis_hourly(filename[, …])

Read a PVGIS hourly file.

iotools.get_bsrn(station, start, end, …[, …])

Retrieve ground measured irradiance data from the BSRN FTP server.

iotools.read_bsrn(filename[, logical_records])

Read a BSRN station-to-archive file into a DataFrame.

iotools.parse_bsrn(fbuf[, logical_records])

Parse a file-like buffer of a BSRN station-to-archive file.

iotools.get_cams(latitude, longitude, start, …)

Retrieve time-series of radiation and/or clear-sky global, beam, and diffuse radiation from CAMS.

iotools.read_cams(filename[, integrated, …])

Read a CAMS Radiation or McClear file into a pandas DataFrame.

iotools.parse_cams(fbuf[, integrated, …])

Parse a file-like buffer with data in the format of a CAMS Radiation or McClear file.

A Location object may be created from metadata in some files.

location.Location.from_tmy(tmy_metadata[, …])

Create an object based on a metadata dictionary from tmy2 or tmy3 data readers.

location.Location.from_epw(metadata[, data])

Create a Location object based on a metadata dictionary from epw data readers.