Building SIREN from github and SourceForge

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 :-

Windows package

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:

Packaging for Windows

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.

Makeweatherfiles

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

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:

New versions of SIREN programs can be obtained using sirenupd. For programs packaged for Windows this will contain any changes to Python programs included 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 included Python programs that have been updated.

github

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.

SourceForge

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.

Python Libraries

These libraries may need to be installed using either pip or your software installer.

LibraryStandard library?Notes
cdsapiAPI to download ERA5 data
configparsery
csvy
ctypesy
datetimey
et_xmlfile Windows. Required by openpyxl?
functoolsy
gzipy
heapqy
http.clienty
ioy
jdcal Windows. Required by openpyxl
mathy
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
osy
plotly
python3-openpyxl
pwdyLinux ?
pyexcel Support for spreadsheet. No longer used
pyexcel-io CSV files
pyexcel-ods ODS (LibreOffice) files
pyexcel-xls XLS (Excel) files
pyexcel-xlsx XLSX (Excel) files
python3-distutils
python3-matplotlib
python3-pyproj Windows?
python3-pyqt5
python3-pil
python3-pil.imagetk
python3-tky
randomy
scipy
shutily
ssc SAM
structy
subprocessy
sysy
tempfiley
time
urllib3
webbrowsery
win32api Windows
xlrd
xlwt
xml.etree.ElementTreey
zipfiley

SIREN Programs

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 (*).

ProgramPurpose
colours.pyDisplay update colours for objects
credits.py (*)Display SIREN Credits window
dataview.pyPrototype to display generation charts per MERRA-2 cell
dijkstra_4.pyFind shortest path to grid and to load centre
displayobject.py (*)Display an object
displaytable.pyDisplay a table
editini.py (*)Edit window for Preferences (model) file
flexiplot.pyA standalone program that can be used to produce charts from a spreadsheet that contains data in rows or columns
This uses pyexcel to allow flexibility in input file formats, but seems to perform quite poorly due to that choice
floaters.pyDisplay floating windows for legend, menu, status, and progress bar
getera5.py (*)Download ERA5 files
getmap.pyDownload map tiles to create a map image
getmerra2.py (*)Invoke wget to download MERRA-2 files
getmodels.pyProvides a location pointer to the SIREN Preferences (model) files
grid.pyGrid class. Process grid items
indexweather.pyCreate index file for weather files
inisyntax.pySyntax highlighting for Preferences Edit window
makegrid.pyCreate weather grid files
makerainfall2.pyCreate rainfall files from MERRA-2 data
makeweatherfiles.py (*)Standalone program to create weather files from MERRA-2 data
newstation.pyCreate/edit a new power station
plot3d.pyA prototype and incomplete program to produce 3D plots (charts) for Powermatch batch
plotweather.py (*)Plot (chart) weather data
pmtmldetail.pyProduce a more detailed Powermatch Detail worksheet which contains hourly details on how RE is used to meet load
powerclasses.pyClasses used by PowerModel (powermodel.py)
powermap.py (*)Main power modelling program. Formerly named sirenm.py
powermatch.pyMatch generation to load. Produce costed scenarios
powermodel.py (*)Process SAM models for stations to produce spreadsheets and charts
powerplot.pyA standalone program that will produce either hourly or diurnal charts from a spreadsheet that conforms to certain constraints
sammodels.pyRoutines for SAM/NREL models for DHI, DNI and Zenith angle
samrun.pyRun a SAM model
senplot3d.pySupport 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.pyGet a technology icon
sirensetup.pySet up to use siren_sample when SIREN is installed in read-only storage
sirenupd.pyUpdate to newer SIREN programs without having to download the full toolkit
ssc.py (*)Access SAM models
station.pyStation class. Populate stations from files and scenarios
superpower.pySuperPower class called by PowerModel (powermodel.py)
towns.pyTown class. Populate towns from files
turbine.pyTurbine class.
updateswis.pyCheck and update SWIS stations and load
viewresource.py (*)Overlay energy resource grid over map
visualise.py (*)Visualise hourly generation on map
wascene.pyCreate and manage displayed map
worldwindow.pyDisplay a world map for getmap and getmerra2
zoompan.pyImplement a more dynamic zoom and pan for hourly charts

Useful tools

sam_models_list

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:

Where:

opt_debug

opt_debug.py can be used to debug the powermatch optimisation routine. It doesn't need to be packaged with SIREN.

Angus King
May 2025