From 769048193838e8ecc89ecd0bf13e0607015b3fa1 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Mon, 8 Nov 2021 14:24:09 +0100 Subject: [PATCH] secop_psi.softcal: default path for calib Change-Id: I5ad2159587f13e1a0bcb75764397d4c784ed1c87 --- cfg/sim_uniax.cfg | 2 +- cfg/uniax.cfg | 2 +- secop_psi/softcal.py | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cfg/sim_uniax.cfg b/cfg/sim_uniax.cfg index ab56ee7..2081ec8 100644 --- a/cfg/sim_uniax.cfg +++ b/cfg/sim_uniax.cfg @@ -40,5 +40,5 @@ value.datatype = {"type":"double", "unit":"Ohm"} class=secop_psi.softcal.Sensor description=temperature sensor, soft calibration rawsensor=res -calib = /home/l_samenv/frappy/secop_psi/calcurves/X132254.340 +calib = X132254 value.unit = "K" diff --git a/cfg/uniax.cfg b/cfg/uniax.cfg index 3131094..da86987 100644 --- a/cfg/uniax.cfg +++ b/cfg/uniax.cfg @@ -49,5 +49,5 @@ channel = A [T] class = secop_psi.softcal.Sensor rawsensor = res -calib = /home/l_samenv/frappy/secop_psi/calcurves/X132254.340 +calib = X132254 value.unit = K diff --git a/secop_psi/softcal.py b/secop_psi/softcal.py index cbcacec..17a2f17 100644 --- a/secop_psi/softcal.py +++ b/secop_psi/softcal.py @@ -22,7 +22,7 @@ import math import os -from os.path import basename, exists, join +from os.path import basename, dirname, exists, join import numpy as np from scipy.interpolate import splev, splrep # pylint: disable=import-error @@ -109,7 +109,9 @@ class CalCurve: calibname = sensopt.pop(0) _, dot, ext = basename(calibname).rpartition('.') kind = None - for path in os.environ.get('FRAPPY_CALIB_PATH', '').split(','): + pathlist = os.environ.get('FRAPPY_CALIB_PATH', '').split(',') + pathlist.append(join(dirname(__file__), 'calcurves')) + for path in pathlist: # first try without adding kind filename = join(path.strip(), calibname) if exists(filename):