BladePositioning.py 852 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 10 14:02:34 2016

@author: hermann_b & sauerwein_n
"""
import numpy as np
import os

import Devices.BladePositioningTools.smaract as s
from Devices.BladePositioningTools.correction_factor import cor

'''
config file:
pos_R:              angle of rotational stage [degree]
pos_L:              radius of blade set by linear stage [mm]

measurement file (n.a)
'''

class BladePositioning:
22 23 24
    def __init__(self, config, init = 1):
        if init:
            s.init()
25 26 27
        
        self.set_config(config)
        
28 29 30
    def set_config(self, config):
        s.maaR(config['pos_R'])
        s.mpaL(config['pos_L']+cor(s.getposR()))
31
        
32
    def get_config(self):
33
        config = {}
34 35
        config['pos_R'] = s.getposR()
        config['pos_L'] = s.getposL() - cor(s.getposR())
36 37 38
        return config