breos.weather.fetch_tmy_weather_data#

breos.weather.fetch_tmy_weather_data(latitude, longitude, sample_year=2025, freq='h', timezone=None, save_to_file=False)[source]#

Fetch Typical Meteorological Year (TMY) weather data from PVGIS.

Parameters:
  • latitude (float) – Latitude of the location

  • longitude (float) – Longitude of the location

  • sample_year (Optional[int]) – Year to use for index (default: 2025). Set to None to keep original TMY index.

  • freq (str) – Frequency for output data (‘h’ for hourly, ‘15min’ for 15-minute)

  • timezone (Optional[str]) – Timezone string used to determine the location’s whole-hour UTC offset (offset taken at Jan 1 of sample_year, i.e. standard time for northern-hemisphere locations). Auto-detected if None.

  • save_to_file (bool) – Whether to save the data to CSV

Return type:

Tuple[DataFrame, dict]

Returns:

Tuple of (tmy_data DataFrame, metadata dict). When sample_year is set, the index is fixed-offset local time starting at local midnight of Jan 1; rows are rolled (not relabeled) so each timestamp remains the correct UTC instant for its irradiance values.

Raises:

ValueError – If sample_year is a leap year (TMY has 8760 hours)