ladybug.cli.translate module¶
ladybug file translation commands.
- ladybug.cli.translate.epw_to_ddy(epw_file, percentile=0.4, output_file=None)[source]¶
Get a DDY file with a heating + cooling design day from this EPW.
This function will first check if there is a heating or cooling design day that meets the input percentile within the EPW itself. If None is found, the heating and cooling design days will be derived from analysis of the annual data within the EPW, which is usually less accurate.
- Parameters:
epw_file – Path to an .epw file.
percentile – A number between 0 and 50 for the percentile difference from the most extreme conditions within the EPW to be used for the design day. Typical values are 0.4 and 1.0. (Default: 0.4).
output_file – Optional file to output the string of the DDY file contents. If None, the string will simply be returned from this method.
- ladybug.cli.translate.epw_to_wea(epw_file, analysis_period=None, timestep=1, output_file=None)[source]¶
Translate an .epw file to a .wea file.
- Parameters:
epw_file – Path to an .epw file.
analysis_period – An AnalysisPeriod string to filter the datetimes in the resulting Wea (eg. “6/21 to 9/21 between 8 and 16 @1”). If None, the Wea will be annual.
timestep – An optional integer to set the number of time steps per hour. Default is 1 for one value per hour. Note that this input will only do a linear interpolation over the data in the EPW file.
output_file – Optional file to output the string of the Wea file contents. If None, the string will simply be returned from this method.
- ladybug.cli.translate.wea_to_constant(wea_file, value=1000, output_file=None)[source]¶
Convert a Wea or an EPW file to have a constant value for each datetime.
This is useful in workflows where hourly irradiance values are inconsequential to the analysis and one is only using the Wea as a format to pass location and datetime information (eg. for direct sun hours).
- Parameters:
wea_file – Full path to .wea file. This can also be an .epw file.
value – The direct and diffuse irradiance value that will be written in for all datetimes of the Wea. (Default: 1000).
output_file – Optional file to output the string of the Wea file contents. If None, the string will simply be returned from this method.