Zugehörige Institution(en) am KIT | Institut für Mikrostrukturtechnik (IMT) Lichttechnisches Institut (LTI) |
Publikationstyp | Forschungsdaten |
Publikationsdatum | 23.02.2023 |
Erstellungsdatum | 01.01.2022 - 19.02.2023 |
Identifikator | DOI: 10.5445/IR/1000156174 KITopen-ID: 1000156174 |
Lizenz | GPLv3 - GNU General Public License or (at your option) any later version |
Externe Relationen | Forschungsdaten/Software Forschungsdaten/Software |
Schlagwörter | RSE, metadata, data evaluation, python |
Liesmich | 🔬️ Experiment EvaluationPython module for the evaluation of lab experiments. The module implements functions to import meta-data of measurements, filters to search for subsets of them and routines to import and plot data from this meta-data. It works well in its original context but is currently in open alpha since it will be restructured in order to be compatible with new lab environments. Examples of its usage in scientific works will soon be published by the author that can be used to reference it. Feel free to use it for your own projects and to ask questions. For now you can cite this repository as source. 💻️ InstallationYou need a running python3 installation on your OS. The module was written on Debian/GNU-Linux, was tested on Windows and should also run on other OS. DependenciesDependencies are the usual scientific modules like numpy, matplotlib, pandas but also astropy. See the
Alternatively you can also install the required modules from the shell etc.. The author recommends to also install jupyter that includes the interactive ipython:
The module itselfInside your virtual environment there is a folder From within your code (try it from an interactive ipython session) you should now be able to import it via:
Matplotlib styleIn order to use the fancy custom styles (for example for consistent looking graphs throughout your publication) it is advised to use matplotlib styles. For the provided styles, copy the custom styles "thesis_default.mplstyle" etc. from the folder 🧑💻 UsageA good way to learn its usage is to have a look at the example file. But since the module is work in progress we first explain some concepts. ✨ Why meta-data?The module automates several steps of experiment evaluations. But the highlight is its capability to handle experimental meta-data. This enables the user to automatically choose and plot data with a question in mind (example: plot all EQE-curves at -2V and 173Hz) instead of repeatedly choosing files manually. For calculations that need more than one measurement this becomes extremely useful but also for implementing statistics. The module includes some generic functions but to use it for your specific lab environment you might need to add experiment and plot specific functions. 💾️ How to save your experiment files?In general lab measurement files stem from different devices and export routines. So frankly speaking lab-data is often a mess! But to use automatic evaluation tools some sort of system to recognize the measurement-type and store the meta-data is needed. In an ideal world a lab would decide on one file format for all measurements and labels them systematically. To include different data-types and their meta-data within one file-type there exists the *.asdf (advanced scientific data format, see their documentation for further insight). So if you are just starting with your PhD try to use this file format everywhere ;). Example of useful file naming for EQE measurements: In the case of my PhD I decided to use what I found: store the different file formats, store them in folders with the name of the experiment and include meta-data in the file-names (bad example: 📑️ DatabaseFor calculations and filtering of datasets the meta-data and data needs to be accessible in a machine readable form. For the time being the module imports all meta-data into a pandas DataFrame that represents our database (For very large datasets this would possibly be needed to be changed). For this we have to name the root folder that includes all experiment files/folders. Hint: If you did not follow the unique labeling/numbering for all your experiments you can still use this module by choosing a root folder that only includes the current experiment.
We can specify some pre-filtering for the specific experiment we want to evaluate:
Then we import the metadata into the pandas DataFrame database via
💡️ Advanced note:Internally Import data and meta-dataTo import now some measurement data for plotting we use the information inside meta_table with custom import routines and python dictionaries implementing our filters:
This yields python lists So with this few lines of code you already did some advanced data filtering and import! 🌡️ Physical unitsThe module astropy includes a submodule astropy.units. Since we deal with real world data, it is a good idea to also include units in calculations.
📝️ CalculationsIf you have to repeatedly do some advanced calculations or fits for some plots, include them as functions in the source-code. An example would be 📊️ PlotsFor plotting there exists many modules in python. Due to its grate power we use matplotlib. This comes with the cost of some complexity (definitely have a look at its documentation!). But this enables us for example to have a consistence color style, figure-size and text-size in large projects like a PhD-thesis:
In order to not invent the wheel over and over again it makes sense to wrap some plotting routines for each experiment inside some custom functions. For further detail see the documentation/recommended function signature for matplotlib specialized functions. This enables easy experiment-type specific plotting (even with statistics) once all functions are set up:
Only 5 lines of code! For further details see the example file! 📖 FAQ
👥️ Contributors and acknowledgmentMany question were answered by searching through forums and the author is very thankful for the culture of openness in the FOSS community. A warm thank you goes to Jyh-Miin Lin who provided a helpful example and explanations on how to use the excellent pynufft package for non-uniform FFT. 💌️ LicenseLicense: Copyright (C) 2022-2023 Mervin Seiberlich Author - Mervin Seiberlich This file is part of experiment_evaluation. experiment_evaluation is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. experiment_evaluation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with experiment_evaluation. If not, see <https://www.gnu.org/licenses/>. |
Art der Forschungsdaten | Dataset |