Sample Scripts¶
There are a small number of sample scripts that have been written over the years and provide additional information about using pywind.
Note
The names used are probably in need of changing!
Some of the scripts date back several years in origin, so the names may no longer be appropriate!
capacity_ro
¶
This script was written to satisfy the following request by a researcher
For a given list of windfarms, get the capacity and RO certificates issued for a given period (or periods), as an Excel spreadsheet
Ofgem were unable to limit their data to the criteria but did supply an Excel spreadsheet of all their data - which was too large to be opened on most computers!
To use this script to get the information for the station Braes of Doune
$ ./convert_ro.py 201601 201603
Enter a station name (or blank to finish)Braes Of Doune
Enter a station name (or blank to finish)
Total of 1 stations to process
Braes Of Doune
Complete. Generating Excel spreadsheet certificates.xls
When entering station names, you can specify more than one on a line by seperating them with commas, so rerun the above query for the stations Braes of Doune and Boulfruich you could do this
$ ./convert_ro.py --start Jan-2010 --end Dec-2010 --filename two_stations
You can also provide a file with one station name per line, using the –input parameter.
$ cat station.list
Braes Of Doune
Boulfruich
$ ./convert.py --input station.list 201601 201603
An Ofgem search is conducted for each station name supplied and all matching stations are added to the list of stations to have their certificate information queried and recorded.
The output is minimal but intended to keep you up to date with progress as searching for stations takes a while.
$ capacity_ro.py 201601 201603 --stations Griffin
Period covered will be Jan-2016 to Mar-2016. A total of 3 periods
Station names to be searched for:
- Griffin
Enter a station name (or blank to finish)
Searching for stations...
- Griffin
found
A total of 4 stations will be recorded
Getting certificate data (this is quicker)...
- Griffin Wind Farm
added to spreadsheet
- William Griffin 6.0kwp
nothing to add
- Griffin PV System
nothing to add
- Ronald Griffin Solar Hub
nothing to add
Data saved to certificates.xls
Note
It would be nice to have better formatting for the output, but as this is just a sample script I haven’t spent any time adding them, e.g. the date format on the exported spreadsheet needs setting.
annual_output
¶
This sample script was written on behalf of Graham and an enquiry he had for a years worth of output data for Hydro & Biogas stations.
As usual REGO output will be used a proxy for output.
The library appears unable to cope with setting the technology field directly and so we restrict the options setting to the year, month and scheme and then simply filter the returned data.
derived_unit_data
¶
This script demonstrates how to use the bmreports.UnitData class to get information about Constraint Payments.
It does not attempt to cater for long or short days and simply assumes that there will be 48 settlement periods.
ofgem_certificate_search
¶
One of the most common requests is to search the Ofgem database for certificate issuance.
This script provides an example of using pywind
to do this.
$ ofgem_certificate_search --period 201601 --generator R00160SQSC
Contacting Ofgem and preparing to search.
Filtering search:
- generator id R00160SQSC
- period should be 201601
Total of 1 records returned
Issue Date Period Station Name Scheme Status Certificates
---------- -------- ----------------------------------- ------ ---------- ------------
2016-04-08 Jan-2016 Griffin Wind Farm RO Issued 37491
ofgem_station_search
¶
Sample script to demonstrate using pywind
to search for Ofgem Stations.
$ ofgem_station_search.py --station Griffin
Connecting with Ofgem website and preparing the search...
Setting up filters:
- station name contains Griffin
Getting results from Ofgem...
Query returned 4 results
Station Name Commission Dt Capacity Technology Country Generator ID
----------------------------------- ------------- ------------ -------------------- -------------------- ---------------
Griffin Wind Farm 2011-07-05 186170.00 On-shore wind (RO... Scotland R00160SQSC
William Griffin 6.0kwp 2013-11-21 6.00 PV with a DNC of ... Northern Ireland R03770NGNI
Griffin PV System 2014-11-20 3.50 PV with a DNC of ... Northern Ireland R09926NGNI
Ronald Griffin Solar Hub 2014-09-19 4.00 PV with a DNC of ... Northern Ireland R09542NGNI
$ ofgem_station_search.py --organisation Speedwell
Connecting with Ofgem website and preparing the search...
Setting up filters:
- organisation contains Speedwell
Getting results from Ofgem...
Query returned 1 results
Station Name Commission Dt Capacity Technology Country Generator ID
----------------------------------- ------------- ------------ -------------------- -------------------- ---------------
Speedwell 2013-10-01 6.50 PV with a DNC of ... Northern Ireland R03360NGNI