Coder Social home page Coder Social logo

tum-ens / pygreta Goto Github PK

View Code? Open in Web Editor NEW
38.0 6.0 14.0 229.19 MB

python Generator of REnewable Time series and mAps

License: GNU General Public License v3.0

Python 100.00%
renewable-energy renewable-timeseries potentials wind pv csp gis high-resolution

pygreta's Introduction

pyGRETA_logo

Documentation Status DOI Code style: black License: GPL v3 All Contributors

python Generator of REnewable Time series and mAps: a tool that generates high-resolution potential maps and time series for user-defined regions within the globe.

Features

  • Generation of potential maps and time series for user-defined regions within the globe
  • Modeled technologies: onshore wind, offshore wind, PV, CSP (user-defined technology characteristics)
  • Use of MERRA-2 reanalysis data, with the option to detect and correct outliers
  • High resolution potential taking into account the land use suitability/availability, topography, bathymetry, slope, distance to urban areas, etc.
  • Statistical reports with summaries (available area, maximum capacity, maximum energy output, etc.) for each user-defined region
  • Generation of several time series for each technology and region, based on user's preferences
  • Possibility to combine the time series into one using linear regression to match given full-load hours and temporal fluctuations

Applications

This code is useful if:

  • You want to estimate the theoretical and/or technical potential of an area, which you can define through a shapefile
  • You want to obtain high resolution maps
  • You want to define your own technology characteristics
  • You want to generate time series for an area after excluding parts of it that are not suitable for renewable power plants
  • You want to generate multiple time series for the same area (best site, upper 10%, median, lower 25%, etc.)
  • You want to match historical capacity factors of countries from the IRENA database

You do not need to use the code (but you can) if:

Outputs

Potential maps for solar PV and onshore wind in Australia, using weather data for 2015:

FLH_solar_PV_Australia_2015FLH_wind_onshore_Australia_2015
Australia_PV_wo_quant

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


kais-siala

๐Ÿ’ฌ ๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿค” ๐Ÿšง ๐Ÿ‘€ โš ๏ธ ๐Ÿ“ข

HoussameH

๐Ÿ’ฌ ๐Ÿ’ป ๐Ÿ“–

Pierre Grimaud

๐Ÿ›

thushara2020

๐Ÿ‘€

lodersky

๐Ÿ“– ๐Ÿ’ป ๐Ÿ‘€

sonercandas

๐Ÿ“–

patrick-buchenberg

๐Ÿ“ฆ

molarana

๐ŸŽจ

This project follows the all-contributors specification. Contributions of any kind welcome!

Please cite as:

Kais Siala, & Houssame Houmy. (2020, June 1). tum-ens/pyGRETA: python Generator of REnewable Time series and mAps (Version v1.1.0). Zenodo. https://doi.org/10.5281/zenodo.3727416

pygreta's People

Contributors

allcontributors[bot] avatar houssameh avatar kais-siala avatar lodersky avatar patrick-buchenberg avatar sonercandas avatar thushara2020 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pygreta's Issues

PV does not seem to work correctly

There were two main errors:

  1. The code always returned CF_csp. I could not fully understand why.
    Instead of writing...
    aux = np.zeros(len(reg_ind[0]))
    aux[filter] = CF_pv
    CF_pv = aux
    aux[filter] = CF_csp
    CF_csp = aux
    

I added a new line that seemed redundant to me and it worked (= returned CF_pv).

    aux = np.zeros(len(reg_ind[0]))
    aux[filter] = CF_pv
    CF_pv = aux
    aux = np.zeros(len(reg_ind[0]))
    aux[filter] = CF_csp
    CF_csp = aux

I suspect that before, all the names CF_pv, aux and CF_csp used to point to the same thing in the memory.

  1. The filter is incorrect. I turned it off and it works now. I think I filtered the afternoon hours out, which I should not do. This needs to be fixed. Without filtering, the code works but is slow.

Paths for report

Put the paths in the config file
Add the region name to the file name, to be consistent with other files

calc_gcr

move function to Master and rename it as generate_ground_cover_ratio.
It should only run if "PV" is in the list of technologies and the TIF file does not exist yet.

cProfile

is the cporfile at the end of the script usable?

Broken Link: Download of MERRA data via FTP not possible any longer

Hey,

I was going through the documentation and found that the link for the MERRA2 weather data is not available any longer.

Deprecation of the MERRA and MERRA-2 Unique Web Interface Subsetter 

It seems that now users need to use the Web API. Is there already a script as a template available for the the download of required data? Otherwise I would probably write one which could be also added to the docs for example?

References

Currently, the references are displayed correctly in the web version, but not in the PDF.
In fact, they appear as footnotes in the PDF, whereas I would like to have only one section at the end called "References", which shows the sources as it would do in a bibliography.

New name for repo

Any suggestions?
Apparently, I can rename it and users who search for the other link get redirected to the new one.

generate_area

The calculation of the area should not be done for each technology, but once in the beginning.
And... let's save it as a mat file, not a tif. A tif file for Europe is 1 GB!

Regression paramters

It would be nice if we could differentiate between hub_heights for onshore and offshore.
Can we run the script for CSP as well?

list_regions for regression

Right now it is the intersection of EMHIRES and IRENA.
In the future, I want it to be based on the file of IRENA that is saved in the regression folder. If that region is not in EMHIRES, then a back-up time series should be used instead.
Any thoughts on this?

Add module for reporting

It would be nice to have a table that provides a report after masking and weighting.
The rows will be regions.
Possible columns (not exhaustive):

  • number of points before masking (using A_land, A_eez)
  • number of points after masking
  • area after weighting in kmยฒ
  • mean, median, max, min, std before masking
  • mean, median, max, min, std after masking
  • power potential in TW peak
  • energy potential in TWh before weighting and masking
  • energy potential in TWh after weighting
  • energy potential in TWh after weighting and masking (could be redundant, if weighting includes masking)
  • sorted sample of FLH values before masking (length: 10000 pixels?)
  • sorted sample of FLH values after masking (same length)
  • sorted sample of FLH values after weighting (same length)

I have a Matlab script that does some of these things. Also a zonal_statistics module written in Python. They can be useful!

Describe modules and functions

Use the triple quotation mark to provide a description of modules that could appear if we type "help module_name".
The description should include a definition of the arguments and the outputs (size, unit...).

Fix Index in documentation

I used :noindex: in Master.py to avoid warnings, but it led to no indices for the functions within that module. I would like to fix this without getting any warnings.

The issue does not arise for util.py, because I am not splitting it into thematic groups of functions.

Pysal 2.0

Check where we use Pysal, and how we should rewrite the functions so that we can use Pysal 2.0 instead of v1.14.
Also update the env file.

Separate regression

The regression modules requires that the user reruns the script after moving the files manually anyway. I suggest separating it from "Master.py" and creating another script just for it. The script might still use the assumptions in config.py

generate the maps for any resolution (flexible res_high)

Right now only res_high = [1/240 1/240] is possible.
For this to work correctly, we have to rewrite many parts of the code.
A_lu will not be a 2-D matrix any more, but a 3-D matrix, where each pixel is replaced by a 1x17 vector that counts the occurrence of certain land use types. In the trivial case of res_high = [1/240 1/240], those vectors will be filled with 16 zeros and 1 one. Or it will be replaced with the most common land use type (easy).
For float values (elevation, bathymetry), we would calculate the average.

Expected outputs and recommended workflow

Should we merge these two sections of the User Manual? This could be done with a general graph a the start describing the sequence of functions, followed by a quick description of the major modules with examples of their outputs and a link to their function description?

generate_wind_correction

Right now we read res_correction of onshore wind in the beginning. However, we should also read it for offshore wind. That part is missing.

Clean commit history

Currently @HoussameH has almost 2 million lines of code added and deleted... could you identify the exact commit where that happened? It should be in the beginning of May, I think.
We can rebase the history to fix that error. It must be some files that you have forgot to ignore.

Missing functions' description

The functions Generate_wind_correction(), weighting() , calc_gwa_correction(), and sumnorm_MERRA2() are still missing descriptions.

clean EMHIRES

instead of copying EMHIRES text files, I would rather read them, clean/filter them, and save the part that is used by the code in the regression folder, similarly to IRENA.

Replace (m x n) arrays with vectors of valid points

If we keep working with regions in the calculation of FLH, we can store the indices of the valid pixels using A_region (one long vector, linear indexing) and filter the matrices with that vector.
We can also scrap the for-loop of regions and just filter using A_land / A_eez.

Objective: avoid redundancy, and only calculate what is needed at the end.
The size of the matrices will be smaller --> better use of memory and CPU power.
Also, the scripts calculating the FLH will be similar to those calculating particular points at particular locations. The list of points will simply be longer.

sub2ind and ind2sub

Verify whether these two functions are still needed. If not, delete them.

Regression Coefficients

Implement Regression_coefficient module:
Finds the best fit for EMHIRES TS shape, with IRENA FLH constraint.

Required steps:

  • reorganize the script to generate multiple heights
  • Set up Pyomo abstract model
  • implement data_input function
  • Test results

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.