This mini-tutorial describes how to create DIRSIG-friendly formatted weather files (.wth) using weather data.

Note The tool used in this tutorial (makewth.py) is very primitive. It was developed enough to do a specific function and is not meant to be a robust tool.

Requirements

  • Python 3

  • A "Properly formatted" weather data file (this very specific formatting is how weather data comes from the National Solar Radiation Database (NSRDB):

    • 30-minute time resolution

    • Data with specific column names:

      • "Temperature" - temperature in Celcius

      • "Pressure" - pressure in mbar

      • "Relative Humidity" - relative humidity in %

      • "Wind Speed" - wind speed in m/s

      • "DNI" - direct normal irradiance in W/m^2 (direct sun)

      • "DHI" - diffuse horizontal irradiance in W/m^2 (diffuse sky)

  • The makewth.py tool distributed with DIRSIG (can be found in the extra/makewth folder inside the DIRSIG installation directory)

Setting up makewth.py

  • ❏ Make a copy of makewth.py that you can edit. Using this tool requires that you edit this script with appropriate inputs. Making a copy of this file in your home directory or My Documents folder is the easiest, safest way to accomplish this step.

folder
Figure 1. An example of how one might organize their weather folder is shown here.
  • ❏ Edit the options section of the script.

    • ❏ Set the infile variable to the file that contains your weather data.

    • ❏ Set the outfile variable to the filename you want your ouput .wth to be.

    • ❏ Set the daysoffset to the number of days you want to skip from the beginning of the data file.

options
Figure 2. Look for the Options section inside make_wth.py. The script contains more details about how the data is converted.
Note The output .wth file contains 48 hours of data at 15-minute time resolution. If your input data file contains, for example, 1 year of data, use the daysoffset variable to "select" which days you would like in your output.
  • ❏ Run makewth.py. This can be done multiple ways. If you need help you can search online (eg. search "run python3 script in Windows 10"). Specific instructions for this step are not provided in this manual because this can vary system to system.

The output .wth file is ready to be used in your DIRSIG simulations.