Skip to content

Instantly share code, notes, and snippets.

@jurand71
Created April 2, 2023 09:52
Show Gist options
  • Save jurand71/85d74b6e2ef213573ebe9e8bd162d6c9 to your computer and use it in GitHub Desktop.
Save jurand71/85d74b6e2ef213573ebe9e8bd162d6c9 to your computer and use it in GitHub Desktop.
# convert temperature
df['temp_air'] = kelvin_to_celsius(df['temp_air'])
# covert wind component to wind speed
df['wind_speed'] = uv_to_speed(df)
# resampling to 5min temporal resolution
df_interpol = df.resample('5min').interpolate(method='time')
# cloud types: total_clouds, low_clouds,mid_clouds,high_clouds,boundary_clouds,convect_clouds
resampled_irrads = cloud_cover_to_irradiance(df_interpol, clouds_type='total_clouds', how='clearsky_scaling')
# calculate irradiance estimates from cloud cover
# uses a cloud_cover to ghi model or
# uses a cloud_cover to transmittance to irradiance model
# irrads = cloud_cover_to_irradiance(df, how='clearsky_scaling')
df = df_interpol.join(resampled_irrads, how='outer')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment