Skip to main content

A Python package for PV roof mapping and analysis

Project description

PyPVRoof

A Python package for extracting characteristics of rooftop PV installations.

Installation

Basic Installation

You can install the package using pip:

pip install pypvroof

Installation with GDAL Support

For full functionality including DEM processing, install with GDAL support:

pip install pypvroof[gdal]

Note: GDAL installation might require additional system dependencies. On macOS, you can install them using:

brew install gdal

Development Installation

For development purposes, install with additional development tools:

pip install pypvroof[dev]

Installation from Source

git clone https://github.com/gabrielkasmi/pypvroof.git
cd pypvroof
pip install -e .

For development from source with all extras:

pip install -e ".[dev,gdal]"

System Requirements

  • Python >= 3.8
  • Core dependencies are automatically installed
  • GDAL >= 3.6.2 (optional, for DEM processing)
  • System-level GDAL installation might be required for full functionality

Documentation

Quick Start

The supplementary data is accessible on our Zenodo repository: DOI

import geojson
from pypvroof import MetadataExtraction


# load the data 
index =1356
arrays=geojson.load(open("path/to/geojson/with/arrays"))
case=arrays['features'][index]


# Example parameters dictionary
# choose your own methods
params = {
    "azimuth-method": "bounding-box", # choose between bounding-box and theil-sen
    "tilt-method": "lut", # choose between constant, lut and theil-sen
#    "raster-folder":"input" # specify the location of the raster as a .tif file if using theil-sen
    "regression-type": "linear", # choose between constant, linear or clustered
#    "constant-tilt": 30, # default parameters if no lookup table of DEM
#    "default-coefficient": 1/(6.5) # default parameter if no data to calibrate the linear regression coefficients
}

# initialize the object for extracting the metadata
extractor = MetadataExtraction(p=params)

# extract all characteristics at once for a single polygon
characteristics = extractor.extract_all_characteristics(case)


# or if you want a dataframe with all the characteristics for multiple polygons

dataframe = extractor.extract_all_characteristics(arrays)

Repository Structure

pypvroof/
├── src/                    # Package source code
├── examples/              # Example scripts
│   ├── basic_usage.py
│   └── advanced_usage.py
├── notebooks/            # Jupyter notebooks
│   ├── hands-on.ipynb
│   └── advanced_features.ipynb
├── docs/                # Additional documentation
│   ├── api.md
│   └── tutorials/
├── tests/              # Test suite
├── setup.py
├── README.md
└── LICENSE

Features

  • Extract PV roof characteristics from GeoJSON polygons
  • Support for multiple computation methods
  • Custom lookup table support
  • Flexible parameter configuration

The package is shipped with the lookup table for France used in [3] and array metadata from BDPV database and with a dataset of PV systems characteristics coming from BDPV if you want to use the linear regression for deriving the installed capacity of the system.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Overview and motivation

PyPVRoof is an all-in-one approach for extracting metadata of rooftop PV installations. The approach is modular, depending on the data available, we use different methods to extract these characteristics. The user only has to set his preferred parameters depending on the data available and the module will automatically proceed a single polygon or a complete .geojson file. We extract the following characteristics:

  • Localization (latitude, longitude)
  • Tilt angle
  • Azimuth angle
  • Surface
  • Installed capacity

These characteristics can be deduced from overhead imagery and some additional data (a PV registry or surface models). Besides, these characteristics are sufficient for a broad range of application, e.g. surveying 1 or regional PV estimation 2

This software offers practitionners a fast and efficient way to extract installations metadata to generate consistent registries. This work expands and completes the characteristics extraction module of 3.

The flowchart of the package is summarized below:

Citation

If you wish to use this work, please cite us as:

@article{tremenbert2023pypvroof,
  title={PyPVRoof: a Python package for extracting the characteristics of rooftop PV installations using remote sensing data},
  author={Tr{\'e}menbert, Yann and Kasmi, Gabriel and Dubus, Laurent and Saint-Drenan, Yves-Marie and Blanc, Philippe},
  journal={arXiv preprint arXiv:2309.07143},
  year={2023}
}

Like this work ? Do not hesitate to star us !

References

[1] De Jong, T., Bromuri, S., Chang, X., Debusschere, M., Rosenski, N., Schartner, C., ... & Curier, L. (2020). Monitoring spatial sustainable development: semi-automated analysis of satellite and aerial images for energy transition and sustainability indicators. arXiv preprint arXiv:2009.05738.

[2] Killinger, S., Lingfors, D., Saint-Drenan, Y. M., Moraitis, P., van Sark, W., Taylor, J., ... & Bright, J. M. (2018). On the search for representative characteristics of PV systems: Data collection and analysis of PV system azimuth, tilt, capacity, yield and shading. Solar Energy, 173, 1087-1106.

[3] Kasmi, G., Dubus, L., Blanc, P., & Saint-Drenan, Y. M. (2022, September). Towards unsupervised assessment with open-source data of the accuracy of deep learning-based distributed PV mapping. In Workshop on Machine Learning for Earth Observation (MACLEAN), in Conjunction with the ECML/PKDD 2022.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypvroof-0.1.1.tar.gz (55.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypvroof-0.1.1-py3-none-any.whl (52.1 kB view details)

Uploaded Python 3

File details

Details for the file pypvroof-0.1.1.tar.gz.

File metadata

  • Download URL: pypvroof-0.1.1.tar.gz
  • Upload date:
  • Size: 55.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pypvroof-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e141f80855bb9636847ad2a4674c7d2bdc4cbfa8f77958f37967812f63a11c3f
MD5 439655213ad89d0727da0d994a933eda
BLAKE2b-256 50c2ceb0cb891c838537015a7c96188adddbafe418c2844e8eef42b4b06d9003

See more details on using hashes here.

File details

Details for the file pypvroof-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pypvroof-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 52.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pypvroof-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 07ee7e35ed0acb9ce8f06dcb3615c9badde1b0b1f434c9188c779290dd4f4c2e
MD5 0d8e711e2ff1964cba06e2d04c03c86e
BLAKE2b-256 6f60901cacc1cf5e15d4a1fcbbe3f614c5bad7d450c1eab055439b7307a6f40c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page