This Python script converts wind resource data from a CSV file into the SRW (Standard Resource Wind) format, suitable for use in wind energy analysis tools.
- Select any CSV file containing wind speed, wind direction, temperature, and optionally pressure columns.
- Flexible column matching (case-insensitive, partial matches).
- Skips non-numeric and header rows automatically.
- Outputs a formatted SRW file with standard headers and repeated heights.
- Simple GUI for file selection and output configuration.
- Python 3.7+
- pandas
- tkinter (usually included with Python)
- Run the script:
& ".venv/Scripts/python.exe" "convert_any_csv_to_srw.py"
- Follow the prompts to:
- Select your wind resource CSV file.
- Enter the output SRW filename (must end with
.srw). - Choose a folder to save the SRW file.
- On success, a message will show the location of your new SRW file.
- The script expects columns for wind speed, wind direction, and temperature. Pressure is optional.
- Column names are matched by keywords (e.g., "wind speed", "direction", "temperature", "pressure").
- Non-numeric rows (such as extra headers) are skipped automatically.
| Wind Direction(degree) | Wind Speed(m/s) | Temperature(C) | Pressure(atm) |
|---|---|---|---|
| 180 | 5.2 | 22.1 | 1.01 |
| ... | ... | ... | ... |