pvlib.iotools.get_merra2#

pvlib.iotools.get_merra2(latitude, longitude, start, end, username, password, dataset, variables, map_variables=True)[source]#

Retrieve MERRA-2 time-series irradiance and meteorological reanalysis data from NASA’s GESDISC data archive.

MERRA-2 [1] offers modeled data for many atmospheric quantities at hourly resolution on a 0.5° x 0.625° global grid.

Access must be granted to the GESDISC data archive before EarthData credentials will work. See [2] for instructions.

Parameters:
  • latitude (float) – In decimal degrees, north is positive (ISO 19115).

  • longitude (float) – In decimal degrees, east is positive (ISO 19115).

  • start (datetime like or str) – First timestamp of the requested period. If a timezone is not specified, UTC is assumed.

  • end (datetime like or str) – Last timestamp of the requested period. If a timezone is not specified, UTC is assumed. Must be in the same year as start.

  • username (str) – NASA EarthData username.

  • password (str) – NASA EarthData password.

  • dataset (str) – Dataset name (with version), e.g. “M2T1NXRAD.5.12.4”.

  • variables (list of str) – List of variable names to retrieve. See the documentation of the specific dataset you are accessing for options.

  • map_variables (bool, default True) – When true, renames columns of the DataFrame to pvlib variable names where applicable. See variable VARIABLE_MAP.

Raises:

ValueError – If start and end are in different years, when converted to UTC.

Returns:

  • data (pd.DataFrame) – Time series data. The index corresponds to the middle of the interval.

  • meta (dict) – Metadata.

Notes

The following datasets provide quantities useful for PV modeling:

Dataset

Variable

pvlib name

M2T1NXRAD.5.12.4

SWGDN

ghi

SWGDNCLR

ghi_clear

ALBEDO

albedo

LWGAB

longwave_down

LWGNT

longwave_net

LWGEM

longwave_up

M2T1NXSLV.5.12.4

T2M

temp_air

U10

n/a

V10

n/a

T2MDEW

temp_dew

PS

pressure

TO3

n/a

TQV

n/a

M2T1NXAER.5.12.4

TOTEXTTAU

aod550

TOTSCATAU

n/a

TOTANGSTR

n/a

A complete list of datasets and their documentation is available at [3].

Note that MERRA2 does not currently provide DNI or DHI.

References