This is a brief set of clues on how to get SIREN working using the source from github and packages from SourceForge. More may be forthcoming. The SIREN help file (help.html) is worth a read (You can also view the SIREN help file at https://rawgit.com/ozsolarwind/siren/master/help.html). In terms of setup refer to :-
SIREN is packaged for Windows to enable that user base to install and use it with minimal technical knowledge. This version has been created with PyInstaller (see below). It has also been executed successfully on Mac using WineBottler
. To run it in other environments, or to run your own Windows version you need:
[Files]
Section of the Preferences file. SIREN expects the SDK, ssc.dll
to be in the x64
(or win64
) sub-foldersiren
folder, e.g. sam-sdk-2023-12-17
I use PyInstaller (https://pypi.org/project/pyinstaller/ currently Version 6.10.0) and Advanced Installer (https://www.advancedinstaller.com/ currently Version 21.5) to package SIREN for Windows in Microsoft Installer (MSI) format (previously zip files were created). I use the multi-package facility to create executables for powermap.py, siren.py, sirensetup.py
and the tools (flexiplot.py, getera5.py, getmap.py, getmerra2.py, indexweather.py, makegrid.py, makeweatherfiles.py, pmtmldetail.py, powermatch.py, powerplot.py, sirenupd.py
and updateswis.py
). siren_application.spec
is the spec file (pyinstaller.exe siren_application.spec
with options --log-level ERROR
and/or --noconfirm
... pyinstaller.exe --noconfirm --log-level ERROR siren_application.spec
). This enables all programs to be included in a single library for distribution. PyInstaller places them in individual directories - I use package_siren.py
to copy all the executables into the siren directory and remove some unwanted files that are included as part of the packaging process.
All these files have a version file where the version is <major>,<minor>.<yyyy>.<mmdd>
. <major>
and <minor>
refer to the SIREN release. The date part is the date the program was last changed. The version numbering simulates Microsoft version numbers. template_version
provides a template for the version files to enable new SIREN releases to be packaged. The current major
version is 5
(1
was the initial version, 2
for the change from Python2 to Python3, and for the change from PyQt4 to PyQt5, and 4
for a change to a new packaging environment, Windows 10 rather than Windows 7, and a change to 64-bit Python, and 5
for a change to the API, cdsapi, for ERA5 satellite data).
To enable the modules to be built correctly most require hiddenimports
, as identified in siren_application.spec
, as often PyInstaller will fail to identify all imports from libraries used by the SIREN program.
Weather files suitable for SAM can be obtained from either ERA5 or MERRA-2 satellite data. I again use the multi-package facility to create executables for getera5.py, getmerra2.py
and makeweatherfiles.py
to provide a standalone tool to create SAM weather files from ERA5 or MERRA-2 datasets. package_makeweatherfiles.py
packages these three programs.
A Python version of SIREN is a viable alternative for Linux and MacOS (and for Windows users who have Python installed). The following instructions may assist:
python3 -m venv <siren-master>/
where <siren-master>
is the directory you created for SIREN. If you use python3 -m venv --system-site-packages <siren-master>/
it will use your site libraries and save space<siren-master>
directory (e.g. cd <siren-master>/
)source bin/activate
to activate the virtual environmentpip install -r siren_requirements.txt
to install the packages used by SIREN that are not part of the standard installation[Files]
Section of the Preferences file. For Linux SIREN looks for /linux64/ssc.so
and for macOX /osx64/ssc.dylib
python3 siren.py
(or perhaps python siren.py
) to invoke SIREN. The first time you run it will present a file menu to locate the models directory. This creates a file siren_models_location.txt
with the location of the models folderdeactivate
to deactivate the virtual environmentNew versions of SIREN programs can be obtained using sirenupd
. For programs packaged for Windows this will contain any changes to Python programs include
d by the program. For Python the same approach can be used by creating a zip file that contains both the target Python program, e.g. powermatch.py, plus other include
d Python programs that have been updated.
https://github.com/ozsolarwind/siren contains the Python source and associated image files for SIREN plus a few additional items:
You should download all files (except the package and spec files) to your target “home” folder for SIREN.
https://sourceforge.net/projects/sensiren/ contains a number of Windows MSI and/or self-extracting zip files for the full SIREN Toolkit and a number of the components. See Installation.
These libraries may need to be installed using either pip or your software installer.
Library | Standard library? | Notes |
cdsapi | API to download ERA5 data | |
configparser | y | |
csv | y | |
ctypes | y | |
datetime | y | |
et_xmlfile | Windows. Required by openpyxl? | |
functools | y | |
gzip | y | |
heapq | y | |
http.client | y | |
io | y | |
jdcal | Windows. Required by openpyxl | |
math | y | |
matplotlib | Includes pylab | |
python3-mpltoolkits.basemap | Note: Must have basemap/data/epsg or basemap_data/epsg file (location may have changed with recent versions). | |
netCDF4 | ||
numpy | ||
os | y | |
plotly | ||
python3-openpyxl | ||
pwd | y | Linux ? |
python3-distutils | ||
python3-matplotlib | ||
python3-pyproj | Windows? | |
python3-pyqt5 | ||
python3-pil | ||
python3-pil.imagetk | ||
python3-tk | y | |
random | y | |
scipy | ||
shutil | y | |
ssc | SAM | |
struct | y | |
subprocess | y | |
sys | y | |
tempfile | y | |
time | ||
urllib3 | ||
webbrowser | y | |
win32api | Windows | |
xlrd | ||
xlwt | ||
xml.etree.ElementTree | y | |
zipfile | y |
This is a list of the Python source programs for SIREN. Where there is a dependency on the os environment the programs test sys.platform
. These programs are highlighted in the list with an asterisk (*).
Program | Purpose |
colours.py | Display update colours for objects |
credits.py (*) | Display SIREN Credits window |
dataview.py | Prototype to display generation charts per MERRA-2 cell |
dijkstra_4.py | Find shortest path to grid and to load centre |
displayobject.py (*) | Display an object |
displaytable.py | Display a table |
editini.py (*) | Edit window for Preferences (model) file |
flexiplot.py | A standalone program that can be used to produce charts from a spreadsheet that contains data in rows or columns
|
floaters.py | Display floating windows for legend, menu, status, and progress bar |
getera5.py (*) | Download ERA5 files |
getmap.py | Download map tiles to create a map image |
getmerra2.py (*) | Invoke wget to download MERRA-2 files |
getmodels.py | Provides a location pointer to the SIREN Preferences (model) files |
grid.py | Grid class. Process grid items |
indexweather.py | Create index file for weather files |
inisyntax.py | Syntax highlighting for Preferences Edit window |
makegrid.py | Create weather grid files |
makeweatherfiles.py (*) | Standalone program to create weather files from MERRA-2 data |
newstation.py | Create/edit a new power station |
plot3d.py | A prototype and incomplete program to produce 3D plots (charts) for Powermatch batch |
plotweather.py (*) | Plot (chart) weather data |
pmtmldetail.py | Produce a more detailed Powermatch Detail worksheet which contains hourly details on how RE is used to meet load |
powerclasses.py | Classes used by PowerModel (powermodel.py) |
powermap.py (*) | Main power modelling program. Formerly named sirenm.py |
powermatch.py | Match generation to load. Produce costed scenarios |
powermodel.py (*) | Process SAM models for stations to produce spreadsheets and charts |
powerplot.py | A standalone program that will produce either hourly or diurnal charts from a spreadsheet that conforms to certain constraints |
sammodels.py | Routines for SAM/NREL models for DHI, DNI and Zenith angle |
samrun.py | Run a SAM model |
senplot3d.py | Support for 3D charts using plotly |
senutils.py (*) | Some common functions. Adjust file names from [Parents] properties in config (.ini) file; Obtain current userid details; “Clean” tech names; ClickableQLabel |
siren.py (*) | Display a menu of SIREN Models (invokes powermap.py for the chosen Model) |
sirenicons.py | Get a technology icon |
sirensetup.py | Set up to use siren_sample when SIREN is installed in read-only storage |
sirenupd.py | Update to newer SIREN programs without having to download the full toolkit |
ssc.py (*) | Access SAM models |
station.py | Station class. Populate stations from files and scenarios |
superpower.py | SuperPower class called by PowerModel (powermodel.py) |
towns.py | Town class. Populate towns from files |
turbine.py | Turbine class. |
updateswis.py | Check and update SWIS stations and load |
viewresource.py (*) | Overlay energy resource grid over map |
visualise.py (*) | Visualise hourly generation on map |
wascene.py | Create and manage displayed map |
worldwindow.py | Display a world map for getmap and getmerra2 |
zoompan.py | Implement a more dynamic zoom and pan for hourly charts |
The parameters and variables utilised by the SAM API often change between versions. sam_models_list.py
can be run to list the SAM models and variables for different SAM versions. Usage:
python sam_models_list.py
⇒ Produce HTML file of models for current SSC versionpython sam_models_list.py <Preference file>
⇒ Produce HTML file of models for chosen SSC versionpython sam_models_list.py <Preference file> <SAM model>
⇒ Produce spreadsheet of variables for model of chosen SSC versionpython sam_models_list.py <Preference file> <SAM model> <Ver 1> <Ver 2>
Produce spreadsheet comparing model variables between two SSC versionsWhere:
<Preference file>
is a SIREN Prefences (.ini) file containing the directory for the SAM SDK<SAM model>
is a SAM Model<Ver n>
is an SDK Versionopt_debug.py
can be used to debug the powermatch
optimisation routine. It doesn't need to be packaged with SIREN.
Angus King
May 2025