Skip to content

Commit

Permalink
Merge pull request #833 from ToFuProject/Issue832_IncidenceAngleCamera
Browse files Browse the repository at this point in the history
[#832] get_diagnostic_data(data='alpha_pixel') implemented
  • Loading branch information
Didou09 authored Sep 17, 2023
2 parents fa2d93c + 4f5aa56 commit bea2f94
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tofu/data/_class8_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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 = {}
Expand Down

0 comments on commit bea2f94

Please sign in to comment.