Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion pvlib/iotools/nasa_power.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@
'T2M': 'temp_air',
'WS2M': 'wind_speed_2m',
'WS10M': 'wind_speed',
'ALLSKY_SRF_ALB': 'albedo',
'ALLSKY_SFC_LW_DWN': 'longwave_down',
'ALLSKY_TOA_SW_DWN': 'ghi_extra',
'CLRSKY_DIFF': 'dhi_clear',
'PS': 'pressure',
'T2MDEW': 'temp_dew',
'T2MWET': 'temp_dew',
'RH2M': 'relative_humidity',
'SRF_ALB': 'albedo',
'TQV': 'precipitable_water',
}


Expand Down Expand Up @@ -150,5 +158,10 @@ def get_nasa_power(latitude, longitude, start, end,
# Rename according to pvlib convention
if map_variables:
df = df.rename(columns=VARIABLE_MAP)
# NASA POWER returns PS in kPa; pvlib convention is Pa.
# Conversion required for pvlib.atmosphere.pres2alt, alt2pres,
# get_absolute_airmass, and other pressure-dependent functions.
if 'pressure' in df.columns:
df['pressure'] = df['pressure'] * 1000

return df, meta