Skip to content

Commit

Permalink
rescalc: fix for newer Numpy versions
Browse files Browse the repository at this point in the history
Change-Id: I85e4461c1ac53c8234f8d91f72e590d40d341e60
Reviewed-on: https://forge.frm2.tum.de/review/c/frm2/nicos/nicos/+/34654
Reviewed-by: Enrico Faulhaber <[email protected]>
Reviewed-by: Georg Brandl <[email protected]>
Tested-by: Jenkins Automated Tests <[email protected]>
  • Loading branch information
birkenfeld committed Sep 17, 2024
1 parent ae9d0c9 commit 4a9289a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions nicos/devices/tas/rescalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,7 @@ def calc_popovici(self): # pylint: disable=too-many-locals,too-many-statements
alf0_guide = MIN2RAD * 2 * pi * guide_h / ki
bet0 = MIN2RAD * 2 * pi * guide_v / ki

if alf0_guide <= alf0:
alf0 = alf0_guide # take into account collimator in the guide
alf0 = min(alf0, alf0_guide) # take into account collimator in the guide

G = matrix(zeros((8, 8)))
G[0, 0] = 1 / alf0**2 # horizontal and vertical collimation matrix. The 4 Soller collimators
Expand Down Expand Up @@ -826,10 +825,10 @@ def calcResEllipsoid(self, h, k, l, en):
TT = real(self.S * matrix([h, k, l]).transpose())
# cos(theta) and sin(theta) are the projections of the Q vector onto
# the directions V1 and V2
cos_theta = float(TT[0, 0] / sqrt(dot(TT.transpose(), TT)))
sin_theta = float(TT[1, 0] / sqrt(dot(TT.transpose(), TT)))
cos_theta = float(TT[0, 0] / sqrt(dot(TT.transpose(), TT))[0, 0])
sin_theta = float(TT[1, 0] / sqrt(dot(TT.transpose(), TT))[0, 0])

#----- Rotation matrix from system of resolution matrix
# ----- Rotation matrix from system of resolution matrix
# to system defined by V1, V2, V3 => V1,V2 define scattering plane,
# V3 is zone axis, thus perpendicular to the scattering plane
R = [[cos_theta, sin_theta, 0], [-sin_theta, cos_theta, 0], [0, 0, 1]]
Expand Down

0 comments on commit 4a9289a

Please sign in to comment.