This commit is contained in:
2022-08-17 20:01:56 +02:00
parent 22fcad62c1
commit c4cdf15bad
4 changed files with 116 additions and 83 deletions

View File

@@ -63,68 +63,28 @@ class AppCfg(QSettings):
self.setValue(AppCfg.GEO_BEAM_POS, [23.4, -54.2]) # beam position relativ to optical center in mm
if AppCfg.GEO_PIX2POS not in keys:
_log.warning(f'{AppCfg.GEO_OPT_CTR} not defined. calc default')
import geometry
geo=geometry.geometry()
pix2pos_measure={
1:[(-3.0, -7.6, 116.99110193046, 632.5463827525),
(-2.0, -7.6, 934.07501517856, 600.7926167715),
(-2.0, -7.1, 916.54131238102, 191.0366615002),
(-3.0, -7.1, 103.74668003329, 226.2150231456)],
200:[(-3.1, -7.3, 113.66321353086, 824.9041423107),
(-2.3, -7.3, 1065.97386092697, 792.2851118419),
(-2.3, -6.7, 1033.68452410347, 74.0336610693),
(-3.1, -6.7, 84.62681572700, 116.6832971512)],
400:[(-3.4, -6.7, 155.00053674203, 601.3838942136),
(-3.0, -6.7, 957.95919656052, 573.0827012272),
(-3.2, -6.5, 541.08684037200, 187.9171307943),
(-3.2, -6.8, 564.32152887203, 789.1146957326)],
600:[(-3.3, -6.8, 328.27244399903, 509.5061192017),
(-3.1, -6.8, 992.78996735279, 488.0323963092),
(-3.2, -6.9, 672.03111567934, 832.4122409755),
(-3.2, -6.7, 645.70960116180, 164.2534779331)],
800:[(-3.2, -6.7, 639.52253576449, 53.4455632943),
(-3.2, -6.85, 671.47023245203, 882.6335091391),
(-3.3, -6.75, 105.12470026379, 361.3051859197),
(-3.1, -6.75, 1195.96864609255, 313.1068618673)],
1000:[(-3.25, -6.75, 195.05641095116, 353.3492286375),
(-3.15, -6.75, 1117.27204644084, 314.9636405871),
(-3.2, -6.8, 675.10991143017, 790.3040145281),
(-3.2, -6.72, 638.98580653116, 59.3803912957)]}
geo.update_pix2pos(pix2pos_measure)
self.setValue(AppCfg.GEO_PIX2POS, geo._lut_pix2pos)
_log.warning(f'{AppCfg.GEO_OPT_CTR} not defined. use default')
import numpy as np
lut_pix2pos=(np.array([1., 200., 400., 600., 800., 1000.]),
np.array([[[ 2.42827273e-03, -9.22117396e-05],
[-1.10489804e-04, -2.42592492e-03]],
[[ 1.64346103e-03, -7.52341417e-05],
[-6.60711165e-05, -1.64190224e-03]],
[[ 9.91307639e-04, -4.02008751e-05],
[-4.23878232e-05, -9.91563507e-04]],
[[ 5.98443038e-04, -2.54046255e-05],
[-2.76831563e-05, -6.02738142e-04]],
[[ 3.64418977e-04, -1.41389267e-05],
[-1.55708176e-05, -3.66233567e-04]],
[[ 2.16526433e-04, -8.23070130e-06],
[-9.29894004e-06, -2.16842976e-04]]]))
self.setValue(AppCfg.GEO_PIX2POS, lut_pix2pos)
if AppCfg.GEO_OPT_CTR not in keys:
_log.warning(f'{AppCfg.GEO_OPT_CTR} not defined. calc default')
import geometry
geo=geometry.geometry()
opt_ctr_meas={ # x,y = 0.02, -4.89
1000:[(1057.4251530483375, 116.10122290395591),
(117.84916300310408, 190.27827474963223),
(184.2181041281829, 963.2812360887852),
(1092.5616512910262, 899.514998537239)],
800:[(888.2494207687248, 203.2917926172947),
(329.96950424600305, 248.83910515411347),
(372.9141132092893, 708.2162858826),
(906.4683457834523, 675.6824912134438)],
600:[(781.5385742538922, 251.44180872764602),
(447.09116505496564, 264.4553265953085),
(471.81684900352445, 554.6567750441825),
(798.4561474818535, 535.1364982426887)],
400:[(722.9777438494109, 286.5783069703348),
(525.1722722609408, 295.68776947769857),
(535.5830865550707, 462.26079818377866),
(729.4845027832422, 450.5486321028824)],
200:[(689.1425973934884, 308.70128734536104),
(565.5141776506945, 307.39993555859473),
(574.6236401580583, 406.30267135282986),
(693.0466527537872, 399.79591241899857)],
1:[(673.5263759522934, 307.39993555859473),
(591.5412133860195, 308.70128734536104),
(595.4452687463182, 376.3715802572061),
(672.2250241655271, 373.7688766836736)]}
geo.update_optical_center(opt_ctr_meas)
self.setValue(AppCfg.GEO_OPT_CTR, geo._opt_ctr)
_log.warning(f'{AppCfg.GEO_OPT_CTR} not defined. use default')
import numpy as np
opt_ctr=np.array([603.28688025, 520.01112846])
self.setValue(AppCfg.GEO_OPT_CTR, opt_ctr)
#if AppCfg.ACTIVATE_PULSE_PICKER not in keys:
# self.setValue(AppCfg.ACTIVATE_PULSE_PICKER, False)