Skip to content
Snippets Groups Projects
Commit 183a6c59 authored by Marcus Hardt's avatar Marcus Hardt Committed by Uwe Jandt (DESY, HIFIS)
Browse files

Fix plots

parent 10d6f14e
No related branches found
No related tags found
1 merge request!11Fix plots
Pipeline #106218 passed
#!/bin/bash
if [ ! -e ../plots/pdf ]; then mkdir -v ../plots/pdf; fi
if [ ! -e ../plots/png ]; then mkdir -v ../plots/png; fi
if [ ! -e ../plots/svg ]; then mkdir -v ../plots/svg; fi
if [ ! -d ../plots/pdf ]; then mkdir -pv ../plots/pdf; fi
if [ ! -d ../plots/png ]; then mkdir -pv ../plots/png; fi
if [ ! -d ../plots/svg ]; then mkdir -pv ../plots/svg; fi
# create plot(s) for every data.csv found within data folder
for datafile in ../data/*/data.csv; do
{
echo -e "\n------------------- ${datafile}"
test -f ${datafile} || {
echo "File ${datafile} does not exist, skipping"
continue
}
# cut on last "/" to get folder name
folder=$(echo $datafile | rev | cut -d "/" -f 2- | rev)
folder=`dirname ${datafile}`
basefile=`basename ${datafile}`
# Clean up any remaining *_plot.csv if there are any. They must be created on the fly.
if [ -e "${datafile%.csv}_plot.csv" ]; then
......@@ -22,9 +30,10 @@ for datafile in ../data/*/data.csv; do
pushd "$folder"
./filter.sh
popd
echo "Filter done"
else
# Link from same directory, so use bare file name without path
ln -sv "$(echo $datafile | rev | cut -d "/" -f 1 | rev)" "${datafile%.csv}_plot.csv"
ln -sv "${basefile}" "${datafile%.csv}_plot.csv"
fi
# Plotting.
......@@ -33,6 +42,9 @@ for datafile in ../data/*/data.csv; do
# - there is a specific plot.plt already deposited for the specific folder.
if [ ! -e "$folder"/plot.plt ]; then
# remove the non-existing file, just to eliminate broken symlinks
rm -f "$folder"/plot.plt
echo ln -sv "$(pwd)"/plot.plt "$folder"/;
ln -sv "$(pwd)"/plot.plt "$folder"/;
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment