-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update nasa_power VARIABLE_MAP with additional parameters #2762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
60638bf
ff1fe1f
0cf7b93
96918f8
98c38d1
879abc8
3777c77
2af015a
7498f01
cc6829f
6c539b2
15b69cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,11 +14,18 @@ | |
| 'ALLSKY_SFC_SW_DWN': 'ghi', | ||
| 'ALLSKY_SFC_SW_DIFF': 'dhi', | ||
| 'ALLSKY_SFC_SW_DNI': 'dni', | ||
| 'ALLSKY_SRF_ALB': 'albedo', | ||
| 'ALLSKY_SFC_LW_DWN': 'longwave_down', | ||
| 'CLRSKY_SFC_SW_DIFF': 'dhi_clear', | ||
| 'CLRSKY_SFC_SW_DWN': 'ghi_clear', | ||
| 'PS': 'pressure', | ||
| 'RH2M': 'relative_humidity', | ||
| 'T2M': 'temp_air', | ||
| 'T2MDEW': 'temp_dew', | ||
| 'TQV': 'precipitable_water', | ||
|
karlhillx marked this conversation as resolved.
|
||
| 'TOA_SW_DWN': 'ghi_extra', | ||
| 'WS2M': 'wind_speed_2m', | ||
| 'WS10M': 'wind_speed', | ||
| 'ALLSKY_SRF_ALB': 'albedo', | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -75,7 +82,10 @@ def get_nasa_power(latitude, longitude, start, end, | |
| include a site elevation with the request. | ||
| map_variables: bool, default True | ||
| When true, renames columns of the Dataframe to pvlib variable names | ||
| where applicable. See variable :const:`VARIABLE_MAP`. | ||
| where applicable. See variable :const:`VARIABLE_MAP`. Note that the | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the "Note..." belongs better in a Notes section of the function |
||
| following unit conversions are applied after renaming: pressure is | ||
| converted from kPa to Pa, and precipitable water is converted from | ||
| kg/m\u00b2 (mm) to cm. | ||
|
|
||
| Raises | ||
| ------ | ||
|
|
@@ -150,5 +160,14 @@ 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. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would probably delete this comment; there can be more functions in the future, so no need to make it specific |
||
| if 'pressure' in df.columns: | ||
| df['pressure'] = df['pressure'] * 1000 | ||
| # NASA POWER returns TQV in kg/m^2 (=mm); pvlib convention is cm. | ||
| # Required for pvlib.atmosphere.kasten96_lt and other clear-sky models. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
| if 'precipitable_water' in df.columns: | ||
| df['precipitable_water'] = df['precipitable_water'] / 10 | ||
|
|
||
| return df, meta | ||
Uh oh!
There was an error while loading. Please reload this page.