energy_methods.kgpv#

Köppen-Geiger-Photovoltaic classification: 2019 Fig. A1 and Table 4.

The thesis is the primary citation. Classification uses the paper’s precedence and fixed irradiation thresholds, not a fresh percentile fit to each region.

class energy_methods.kgpv.KGPVResult(tp_zone, irradiation_zone, raw_zone, zone, class_id, precipitation_threshold_mm)[source]#

Bases: object

Cellwise classifications; empty raw labels / class ID zero mean no data.

Parameters:
  • tp_zone (ndarray[tuple[Any, ...], dtype[str_]])

  • irradiation_zone (ndarray[tuple[Any, ...], dtype[str_]])

  • raw_zone (ndarray[tuple[Any, ...], dtype[str_]])

  • zone (ndarray[tuple[Any, ...], dtype[str_]])

  • class_id (ndarray[tuple[Any, ...], dtype[uint8]])

  • precipitation_threshold_mm (ndarray[tuple[Any, ...], dtype[float64]])

tp_zone: ndarray[tuple[Any, ...], dtype[str_]]#
irradiation_zone: ndarray[tuple[Any, ...], dtype[str_]]#
raw_zone: ndarray[tuple[Any, ...], dtype[str_]]#
zone: ndarray[tuple[Any, ...], dtype[str_]]#
class_id: ndarray[tuple[Any, ...], dtype[uint8]]#
precipitation_threshold_mm: ndarray[tuple[Any, ...], dtype[float64]]#
energy_methods.kgpv.classify_kgpv(temperature_c, precipitation_mm, annual_ghi_kwh_m2, latitude)[source]#

Classify one cell or any grid with a final January..December axis of length 12.

Temperature is monthly mean Celsius, precipitation monthly total mm, GHI annual irradiation kWh/m². Other inputs must broadcast to the spatial shape. NaN in any required month yields no data; infinity/negative rain/GHI fail. Summer = Apr-Sep in the north (including equator), Oct-Mar in the south. Kottek Eq. 2.1 uses two thirds seasonal rain, not the later 70% variant.

Precedence: polar (warmest <=10), desert (P<=5*Pth), steppe (P<=10*Pth), tropical (coldest >=18), temperate (coldest >-3), cold. Exact 18 is assigned tropical to close Fig. A1’s strict-inequality gap. I-zone upper edges are inclusive: L<=1130, M<=1560, H<=2070; this equality convention is explicit.

Parameters:
  • temperature_c (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

  • precipitation_mm (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

  • annual_ghi_kwh_m2 (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

  • latitude (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

Return type:

KGPVResult

energy_methods.kgpv.map_kgpv(temperature, precipitation, annual_ghi)[source]#

Create an auditable map on exactly aligned lat/lon grids and baseline years.

Use mapping.regrid explicitly on continuous inputs before calling. Missing land/ocean cells stay missing. Supply a land mask to inputs when needed; CRU TS already excludes Antarctica. The method never invents irradiation.

Parameters:
  • temperature (DataArray)

  • precipitation (DataArray)

  • annual_ghi (DataArray)

Return type:

Dataset