enex_analysis.weather

Weather data processing and irradiance calculations.

Functions

decompose_ghi_to_poa(ghi, latitude, ...[, ...])

Decompose GHI to POA (Plane of Array) total irradiance.

load_kma_T0_sol_hourly_csv(csv_path[, encoding])

Load KMA hourly temperature and solar irradiance CSV.

load_kma_solar_csv(csv_path[, encoding])

Load KMA (기상청) 1-minute cumulative solar irradiance CSV.

enex_analysis.weather.load_kma_solar_csv(csv_path, encoding='euc-kr')[source]

Load KMA (기상청) 1-minute cumulative solar irradiance CSV.

Parameters:
  • csv_path (str) – Path to CSV file.

  • encoding (str, optional) – File encoding. Default is ‘euc-kr’.

Returns:

DataFrame with datetime index and ‘ghi’ column [W/m2].

Return type:

pd.DataFrame

enex_analysis.weather.load_kma_T0_sol_hourly_csv(csv_path, encoding='euc-kr')[source]

Load KMA hourly temperature and solar irradiance CSV.

Parameters:
  • csv_path (str) – Path to CSV file.

  • encoding (str, optional) – File encoding. Default is ‘euc-kr’.

Returns:

DataFrame with datetime index, ‘T0_K’, and ‘ghi’ columns.

Return type:

pd.DataFrame

enex_analysis.weather.decompose_ghi_to_poa(ghi, latitude, longitude, tilt, azimuth, altitude=0, tz='Asia/Seoul', decomposition='erbs', transposition='perez')[source]

Decompose GHI to POA (Plane of Array) total irradiance.

Parameters:
  • ghi (np.ndarray or pd.Series) – Global horizontal irradiance timeseries [W/m2]. Must have DatetimeIndex.

  • latitude (float) – Location latitude.

  • longitude (float) – Location longitude.

  • tilt (float) – Surface tilt angle [deg].

  • azimuth (float) – Surface azimuth [deg]. 180 is South.

  • altitude (float, optional) – Location altitude [m]. Default is 0.

  • tz (str, optional) – Timezone. Default is ‘Asia/Seoul’.

  • decomposition (str, optional) – DNI/DHI decomposition model (‘erbs’, ‘dirint’, etc). Default is ‘erbs’.

  • transposition (str, optional) – POA transposition model (‘perez’, ‘isotropic’, etc). Default is ‘perez’.

Returns:

DataFrame with ‘poa_global’, ‘poa_direct’, ‘poa_diffuse’.

Return type:

pd.DataFrame