Skip to main content

Grapa - graphing and photovoltaics analysis

Project description

DOI: 10.5281/zenodo.1164571

https://carronr.github.io/grapa/

Description

Grapa is a python package providing a graphical interface and the underlying code dedicated to the visualization, analysis and presentation of scientific data, with a focus on photovoltaic research.

A wide range of data formats can loaded by default. The produced graphs are saved both as graphical objects and as text files for later modifications.

The data analysis functions currently focus on photovoltaics and semiconductor material science. Advanced analysis or fitting functions are notably provided for the following characterization techniques: EQE, JV, C-V, C-f, TRPL, SIMS, reflectance, transmittance (not comprehensive list).

The software has extended capabilities for advanced plotting including subplots and insets, and can be used for creating high-quality figures for scientific publications.

Last, the user can add to the software and to the graphical interface his own specific data loading functions as well new data types and analysis functions, with no modification of the existing code.

Grapa stands for “GRAphing and Photovoltaics Analysis”.

Cheers!

Features overview

  • Open and merge a wide range of experimental data. Data import possible from clipboard.

  • Graphical data presentation and graph customisation.

  • Graph export in various file formats with user-defined dpi. Additionally create a .txt file containing the raw data for later modifications.

  • The supported image formats are the one supported by the savefig function of matplotlib. .emf is also supported, provided a path to an inkscape executable is provided in the config.txt file.

  • Drop-down menu to switch between data-relevant views (e.g. log-view for JV data, Tauc plot for EQE)

  • Drop-down menu to switch between linear or logarithmic data visualisation.

  • A data picker allows selecting and storing chosen data points.

  • Can colorize a graph using color gradients.

  • Some data types can be fitted. The parameters of the fitted curves can be modified afterwards.

  • Data can be loaded from other files or from clipboard, then converted to the desired data type to benefit from data visualisation and processing and fitting options.

Installation

There are several options to install grapa. The easiest is certainly:

pip install grapa

Alternatively, the source can be retrieved from the development page on github (https://github.com/carronr/grapa). Download the latest release and place its content in a folder named “grapa” somewhere on your hard drive, and can be run with your favorite python distribution.

The software graphical user interface GUI can be started by executing the following lines:

import grapa
grapa.grapa()

Grapa can also be used in scripts or own code. To help you to get started, the GUI offers a checkbox “Commands in console” right above the console. Use the GUI and learn from the printouts.

Grapa is developed using python 3.13 and matplotlib 3.10, and should be backwards-compatible down to python 3.7 and matplotlib 1.5.

License

MIT License

Details of the features

The grapa packages comes with a graphical user interface (GUI), which allows handling most features of the package. Many matplotlib plotting methods are supported, as well as insets and subplots. Using grapa in python code allows further customization of the produced graphs.

The central object of the package is the Graph object. A graph is stored in a Graph object. The Graph class can be thought as a combination of a dict storing plotting information (axes, text annotations, etc.) together with a list of Curves which stores the data and the corresponding plotting information (color, aspect, etc.). The Graph.plot() method returns the produced figure and axes for further modifications. Existing figures and axes can as well be provided. List of relevant keywords: see GUI, or file keywordsdata_graph.txt

A Curve object contains the data usually accessed as a pair of vectors, as well as a dict-like metadata storage, including plotting information. Child classes of Curve can be implemented in order to provide dedicated data analysis tools. List of relevant keywords: see GUI, or file keywordsdata_curve.txt Every Curve type provides dedicated functions (e.g. for analysis or plotting) as well as specific data visualizations accessible from a GUI drop-down menu. Default Curve type for plotting purpose: Curve_Subplot, Curve_Inset, Curve_Image

Other Curve types are provided for analysis of scientific data: EQE, J-V, Jsc-Voc pairs, Spectrum, SIMS, C-V, C-f, TRPL, XRF

Scripts are provided: - Load all files from one folder - JV data fit, cell-by-cell, or cell separately - JV sample maps - Boxplots, both generic and specific behavior for JV data - Processing of C-V data temperature series - Processing of C-f data temperature series - Correlation

Configuration file: a set of user preferences can be stored in a configuration file and indicated to the Graph object at creation. A personalized configuration file can also be provided to the GUI when using a application launcher as a second argument (it will be retrieved using sys.argv[1]) Whenever needed the software will query for provided values, and use default settings if no suitable keyword is found.

Create a file parser

To create a file parser you will need to create inside folde “datatypes” a python file named for example graphMyfile.py (must start with “graph”, with a small g). This file must contains a class named “GraphMyfile” (capital G, same ending as file name) that inherits from class Graph. The class must contain at least 1 attribute and 2 methods:

  • CURVE: a string identifier, for recognition within grapa.

  • isFileReadable(cls, filename, fileext, line1=””, line2=””, line3=””, **kwargs)

    Must return True is the file can be opened using your class, otherwise False

  • readDataFromFile(self, attributes, **kwargs)

Actually opens the file, which can be accessed from self.filename. attributes is a dict which can be given to the constructor of the Curves. Example: see files howto/example_sinx_x.txt, graphMydata.py

You may also want to create your own Curve type, for example to provide customised analysis or visualisation functions inside the GUI. For this, you have to create in folder “datatypes” a file named for example “curveMycurve.py” (file name must start with “curve” with a small c). The file must contain a class named “CurveMycurve” (capital C, same ending as the file name) inheriting from class Curve. An example is provided in file howto/curveMycurve.py.

Questions?

Author: Romain Carron (Empa, Laboratory for Thin Films and Photovoltaics)

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

grapa-0.8.0.2.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

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

grapa-0.8.0.2-py3-none-any.whl (3.0 MB view details)

Uploaded Python 3

File details

Details for the file grapa-0.8.0.2.tar.gz.

File metadata

  • Download URL: grapa-0.8.0.2.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for grapa-0.8.0.2.tar.gz
Algorithm Hash digest
SHA256 bf6f0ad12c18cca932edfad82878fa5699c74c45624b388e0a03cdf13723a452
MD5 fa003d0996fc01aa6cec3443fe07169f
BLAKE2b-256 98cd4fd381a4d44d0799b78d0574a39552f043cdddc1e50497246eb5b845e27c

See more details on using hashes here.

File details

Details for the file grapa-0.8.0.2-py3-none-any.whl.

File metadata

  • Download URL: grapa-0.8.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for grapa-0.8.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 07b5c542cf27678a32ea2a8703d305db46f0a5d8afdf7df52ba54f4f44195fb1
MD5 e929403f94e9878a7ebf5e42577f618b
BLAKE2b-256 e475206ec2fc2a0f8a89ffaf450e114bbc512fea8cf171e67e70fb6c72f0550c

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