opyplus.WeatherData
- class opyplus.WeatherData(weather_series, latitude, longitude, timezone_offset, elevation, city=None, state_province_region=None, country=None, source=None, wmo=None, design_conditions_source=None, design_conditions=None, typical_extreme_periods=None, ground_temperatures=None, leap_year_observed='yes', daylight_savings_start_day=0, daylight_savings_end_day=0, holidays=None, comments_1='', comments_2='', start_day_of_week=None)
Class describing E+ weather data.
For more information on following concepts, see EnergyPlus documentation : AuxiliaryPrograms.pdf: Weather Converter Program/EnergyPlus Weather File (EPW) Data Dictionary
- Parameters:
- weather_series: pandas.DataFrame
containing epw columns (some may be missing)
missing values may be None or E+ missing value
- latitude
- longitude
- timezone_offset
- elevation
- city
- state_province_region
- country
- source
- wmo
- design_conditions_source
- design_conditions
- typical_extreme_periods
- ground_temperatures
- leap_year_observed
- daylight_savings_start_day
- daylight_savings_end_day
- holidays
- comments_1
- comments_2
- start_day_of_week
- Attributes:
has_datetime_instantsCheck if datetime instants have been created.
Methods
create_datetime_instants([start_year])Add a datetime index to the weather series data frame.
from_epw(buffer_or_path[, ...])See load.
get_bounds([use_datetimes])Get datetime instants of beginning and end of data.
get_info()Get WeatherData info.
Get the weather series dataframe.
load(buffer_or_path[, ...])Load weather data from an epw file.
save([buffer_or_path, use_datetimes])Save weather data as an epw file.
set_weather_series(weather_series[, ...])Set a new weather series dataframe.
to_epw([buffer_or_path, use_datetimes])See save.
- create_datetime_instants(start_year=None)
Add a datetime index to the weather series data frame.
- Parameters:
- start_year: int or None, default None
if given, will force year column with start_year (multi-year not supported for now)
- classmethod from_epw(buffer_or_path, create_datetime_instants=False, start_year=None) WeatherData
See load.
- get_bounds(use_datetimes=True)
Get datetime instants of beginning and end of data. If no data, will be: (None, None).
- Parameters:
- use_datetimes: bool
- Returns:
- datetime.datetime or None
start
- datetime.datetime or None
end
- get_info()
Get WeatherData info.
- Returns:
- str
- get_weather_series()
Get the weather series dataframe.
- Returns:
- pandas.DataFrame
weather series dataframe, which contains all the timeseries data. Will be a datetime series or a tuple instants series depending on current mode.
- property has_datetime_instants
Check if datetime instants have been created.
- Returns:
- bool
- classmethod load(buffer_or_path, create_datetime_instants=False, start_year=None) WeatherData
Load weather data from an epw file.
- Parameters:
- buffer_or_path: str or typing.StringIO
buffer or path containing epw format.
- create_datetime_instants: bool
set datetime instants index after file was loaded
- start_year: int or None
only used if create_datetime_instants is True if given, will force year column with start_year (multi-year not supported for now)
- Returns:
- WeatherData instance.
- save(buffer_or_path=None, use_datetimes=True)
Save weather data as an epw file.
- Parameters:
- buffer_or_path: str or typing.StringIO
Buffer or path to write into. If None, will return a string containing epw info.
- use_datetimes: bool
if True and datetime index was created, will use this index to generate epw (start day and data) else: will use instant columns information
- Returns:
- str or None
- set_weather_series(weather_series, start_day_of_week=None)
Set a new weather series dataframe.
- Parameters:
- weather_series: pandas.DataFrame
weather series dataframe, which contains all the timeseries data.
- start_day_of_week: str, default None
“Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”
- to_epw(buffer_or_path=None, use_datetimes=True)
See save.