diff --git a/tofu/data/_class8_compute.py b/tofu/data/_class8_compute.py index e43d3d73f..a6c268381 100644 --- a/tofu/data/_class8_compute.py +++ b/tofu/data/_class8_compute.py @@ -1126,7 +1126,7 @@ def _get_data( # basic check on data if data is not None: lquant = ['etendue', 'amin', 'amax'] # 'los' - lcomp = ['length', 'tangency radius', 'alpha'] + lcomp = ['length', 'tangency radius', 'alpha', 'alpha_pixel'] if spectro: llamb = ['lamb', 'lambmin', 'lambmax', 'dlamb', 'res'] lvos = ['vos_lamb', 'vos_dlamb', 'vos_ph_integ'] @@ -1294,6 +1294,22 @@ def _get_data( else: units = 'rad' + elif data == 'alpha_pixel': + for cc in key_cam: + + klos = coll.dobj['diagnostic'][key]['doptics'][cc]['los'] + vectx, vecty, vectz = coll.get_rays_vect(klos) + dvect = coll.get_camera_unit_vectors(cc) + sca = ( + dvect['nin_x'] * vectx + + dvect['nin_y'] * vecty + + dvect['nin_z'] * vectz + ) + + ddata[cc] = np.arccos(sca) + dref[cc] = coll.dobj['camera'][cc]['dgeom']['ref'] + units = 'rad' + elif data in lsynth: dref = {}