Ausführbare Programme für MS-Windows (Datei PhyPraExe.zip)


Die zip-Datei PhyPraExe.zip enthält einige stand-alone Programme zur Visualisierung von Daten, zur Konvertierung von Datenformaten und zur Anpassung von Modellen an Messdaten. Damit stehen wichtige Funktionen von PhyPraKit auch Windows-Nutzern zur Verfügung, die keine komplette Python-Installation zur Verfügung haben.

Enthalten sind die ausführbaren Dateien
- csv2yml.exe zur Konversion von Daten im CSV- ins yaml-Format
- plotCSV.exe zur grafischen Darstellung von Daten im CSV-Format
- smoothCSV.exe zur Glättung von Datensätzen mit zu hoher Sampling-Rate
- plotData.exe zur grafischen Darstellung von Daten im yaml-Format
- run_phyFit.exe zur Modellanpassung
- kafe2go.exe zur Modellanpassung mit kafe2

Das Verzeichnis
- _internal/ enthält notwendige Bibliotheken und Konfigurationsdateien.

Zur Installation muss lediglich die Archiv-Datei PhyPraExe.zip in ein Verzeichnis (z.B. PhyPraExe) entpackt werden. Dieses Verzeichnis sollte auch im Suchpfad für ausführbare Programme enthalten sein, damit die dort abgelegten Programme ohne Pfadangabe gestartet werden können. Die Programme führt man man idealerweise in einem Windows-Terminal auf der Kommandozeile aus, weil dann auch die Parameter und Optionen angegeben werden können. Durch Eingabe von <Programm_Name> --help wird eine Hilfe mit allen vorhandenen Optionen angezeigt.

Im Folgenden sind die einzelnen Programme kurz beschrieben.

csv2yaml.exe

Einlesen von Spalten mit Fließkommazahlen in allgemeinem .txt-Format und Ausgabe als Block im yaml-Format. Dabei wird das Dezimalkomma ggf. in einen Dezimalpunkt umgewandelt, so dass Programmpakete aus dem Umfeld des wissenschaftlichen Rechnens damit umgehen können.

Als Optionen können die Zahl der Kopfzeilen (headerlines), die Kopfzeile mit den Spaltenbezeichnungen (key_line) und der Feldtrenner (seprator) angegeben werden. Für aus MS-Excel exportierte Daten ist die Optionen -s ; wichtig.

usage: csv2yml.exe  [-h] [-s] [-H] [-q] [-d DELIMITER] [-n HEADERLINES] [-k KEY_LINE] filename

convert csv to yaml format

positional arguments:
  filename              name of input file in csv format

options:
  -h, --help            show this help message and exit
  -s, --save            save result in file
  -H, --Header          print csv Header lines
  -q, --quiet           quiet - no output to screen
  -d DELIMITER, --delimiter DELIMITER
                        delimiter, default=','
  -n HEADERLINES, --headerlines HEADERLINES
                        numer of header lines, default=1
  -k KEY_LINE, --key_line KEY_LINE
                        header line containing keys, default=0

plotCSV.exe

Grafische Darstellung von Daten im CSV_Format. Als Optionen können die Zahl der Kopfzeilen (headerlines), die Kopfzeile mit den Spaltenbezeichnungen (key_line) und der Feldtrenner (seprator) angegeben werden. Für aus MS-Excel exportierte Daten ist die Optionen -s ; wichtig.

usage: plotCSV.exe [-h] [-v] [-s SEPARATOR] [-H HEADERLINES] [-k KEY_LINE] filename [filename ...]

plot contents of CSV file

positional arguments:
  filename              name of csv file

options:
  -h, --help            show this help message and exit
  -v, --verbose         full printout to screen
  -s SEPARATOR, --separator SEPARATOR
                        character used as field separator
  -H HEADERLINES, --Headerlines HEADERLINES
                        number of header lines
  -k KEY_LINE, --key_line KEY_LINE
                        header line containing keys, default=0

smoothCSV.exe

Für die Weiterverwendung von Rohdaten muss häufig nach dem Export aus einem Messgerät die Sampling-Rate angepasst werden. Dazu werden die Daten durch Mittelwertbildung geglättet und ggf. nur ein Anteil der ursprünglichen Daten in eine neue Datei exportiert werden.

usage: smoothCSV.exe [-h] [-n] [-r] [-s SEPARATOR] [-H HEADERLINES] [-w WINDOWSIZE] [-k KEY_LINE]
                    filename [filename ...]

smooth CSV file

positional arguments:
  filename              name of csv file

options:
  -h, --help            show this help message and exit
  -n, --noplot          suppress figure
  -r, --resample        down-sampling of smoothed data
  -s SEPARATOR, --separator SEPARATOR
                        character used as field separator
  -H HEADERLINES, --Headerlines HEADERLINES
                        number of header lines
  -w WINDOWSIZE, --WindowSize WINDOWSIZE
                        window size
  -k KEY_LINE, --key_line KEY_LINE
                        header line containing keys, default=0

plotData.exe

Mit diesem Programm werden Daten im yaml-Format und - falls vorhanden- auch eine Modellfunktion grafisch dargestellt. Das für grafische Darstellung und Modellanpassung verwendete Datenformat ist im Skript Datenauswertung in Grundlagenpraktika zur Physik beschreiben.

usage: plotData.exe [-h] [-s] [-f FORMAT] [-n] filename [filename ...]

Plot data with error bars or a histrogram from file in yaml format

positional arguments:
  filename              name(s) of input file(s) in yaml format

options:
  -h, --help            show this help message and exit
  -s, --saveplot        save plot(s) in file(s)
  -f FORMAT, --format FORMAT
                        graphics output format, default=pdf
  -n, --noplot          suppress ouput of plots on screen

run_phyFit.exe

Mit diesem Programm wird eine nutzerdefinierte, in der Sprache Python codierte Modellfunktion an Daten angepasst. Daten und Modellfunktion werden im yaml-Format angegeben, das im Skript Datenauswertung in Grundlagenpraktika zur Physik beschreiben ist. Es ist auch möglich, eine Modellfunktion an Häufigkeitsverteilungen anzupassen.

usage: run_phyFit.exe [-h] [-v] [-r] [-n] [-s] [-c] [--noband] [-f FORMAT] filename [filename ...]

Perform a fit with PhyPraKit.phyFit package driven by input file

positional arguments:
  filename              name(s) of fit input file(s) in yaml format

options:
  -h, --help            show this help message and exit
  -v, --verbose         full printout to screen
  -r, --result_to_file  store results to file
  -n, --noplot          suppress ouput of plots on screen
  -s, --saveplot        save plot(s) in file(s)
  -c, --contour         plot contours and profiles
  --noband              suppress 1-sigma band around function
  -f FORMAT, --format FORMAT
                        graphics output format, default=pdf

kafe2go.exe

kafe2go biete ein einfache Interface zum mächtigen Anpassungspaket kafe2, das nur durch eine Eingabedatei im yaml-Format gesteuert wird. Diese Datei enthält die Eingabedaten, deren Unsicherheiten sowie die Modellfunktion und zahlreiche Optionen. Die Besonderheit von kafe2 liegt darin, dass dieses Paket mit Unsicherheiten in Abszissen- und Ordinatenrichtung umgehen kann, die entweder unabhängig oder korreliert und absolut oder relativ sind. Mehrere Quellen solcher Unsicherheiten können gleichzeitig in der Anpassung berücksichtigt werden.

usage: kafe2go.exe [-h] [-if INPUTFORMAT] [-s] [-pf PLOTFORMAT] [-n] [-r] [-R] [-a] [-c] [--grid GRID]
               [--noband] [--noinfobox] [--separate] [--noreport]
               filename [filename ...]

Perform a fit with the kafe2 package driven by an input file. Example files can be found at
https://github.com/PhiLFitters/kafe2/tree/master/examples. Further information on how to 
create input files is given at https://kafe2.readthedocs.io/en/latest/parts/user_guide.html#kafe2go 

positional arguments:
  filename              Name(s) of fit input file(s).

options:
  -h, --help            show this help message and exit
  -if INPUTFORMAT, --inputformat INPUTFORMAT
                        File input format. The default format is yaml.
  -s, --saveplot        Save plot(s) to file(s). The plot(s) will be saved in the current working directory.
  -pf PLOTFORMAT, --plotformat PLOTFORMAT
                        Graphics output file format. E.g. pdf, png, svg, ... The default format is pdf.
  -n, --noplot          Don't show plots on screen.
  -r, --ratio           Show data/model ratio below the main plot.
  -R, --residual        Show residuals below the main plot.
  -a, --asymmetric      Show asymmetric parameter uncertainties when displaying the fit information. This
                        affects the fit report to the terminal as well as the information box of the plot.
  -c, --contours        Plot contours and profiles.
  --grid GRID           Add a grid to the contour profiles. Available options are either all, contours or
                        profiles.
  --noband              Don't draw the 1-sigma band around the fitted function. This will only affect plots
                        of XY-fits.
  --noinfobox           Don't add the model info boxes to the plot(s).
  --separate            Create a separate figure for each fit when plotting.
  --noreport            Don't print fit report(s) to the terminal after fitting.

Beispiele

Im Verzeichnis PhyPraKit/tools des Pakets PhyPraKit sind einige Beispiele enthalten, die die Anwendung der oben beschriebenen Programme illustrieren und als Ausgangsbasis für eigene Anwendungen dienen sollen.

plotCSV.exe -H 3 oversampled.csv

smoothCSV.exe -H 3 oversampled.csv

plotData.exe xyFit.yfit

plotData.exe hFit.yfit

run_phyFit.exe xyFit.yfit

kafe2go.exe xyFit.yfit

kafe2go.exe hFit.yfit ..