Prepare weather

Prepare the weather file(s) specified in the YAML configuration to be used by the pipeline.

CLI arguments match those defined by main().

prepare_weather.adjust_hour(df, colname='hour')

Adjust all hourly values to align with Python representation.

Parameters:
  • df (DataFrame) – Raw weather data, with hours from 1 to 24 hours.

  • colname (str) – The name of the column with hour indicators.

Returns:

A pd.DataFrame object where the hour column has been adjusted to 0 - 23 hours.

Return type:

df

prepare_weather.get_weather_df(filename)

Fetch weather data from the main storage location. Loads weather files from the NREL/openstudio-standards GitHub repository where they are managed.

Parameters:

filename (str) – The filename of a weather file (.epw)

Return type:

DataFrame

Returns:

A dataframe of weather data summarized by day.

prepare_weather.main(config_file=<typer.models.ArgumentInfo object>, epw_file=<typer.models.OptionInfo object>, output_path=<typer.models.OptionInfo object>)

Take raw EPW files as defined in BTAP YAML configuration and prepare it for use by the model. Uses the EnergyPlus configuration to identify and process weather data in EPW format. The weather data is then saved to blob storage for use in later processing stages.

Parameters:
  • config_file (str) – Path to the configuration file used for EnergyPlus.

  • epw_file (str) – The epw key to be used if the config file is not use.

  • output_path (str) – Where output data should be placed. Note that this value should be empty unless this file is called from a pipeline.

Return type:

str

prepare_weather.process_weather_file(filename)

Process a weather file and return the dataframe.

Parameters:

filename (str) – The name of the weather file to load.

Returns:

A pd.DataFrame object with the ready to use weather information.

prepare_weather.process_weather_files(filenames)

Process a batch of weather files and return the dataframe

Parameters:

filenames (list) – The names of the weather files to load.

Returns:

A pd.DataFrame object with the ready to use weather information

prepare_weather.save_epw(df, filename, output_path)

Save preprared EPW data out to blob storage. The filename of the original file is used, with the extension replaced with .parquet.

Parameters:
  • df (DataFrame) – Pandas DataFrame to be saved out.

  • filename (str) – Filename of the source file used to produce the DataFrame.

Return type:

None