Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# now apply the DOM orientation (this will flip over the DOM)
flasherDir = omGeo.orientation.rotate_out(flasherDir)
#flasherDir = omGeo.orientation.rotate(flasherDir)
# for standard DOMs (i.e. pointing down), flashers are now
# ordered clockwise when viewed from above
flasherPos = dataclasses.I3Direction()
# flasher position on flasher board
flasherPos.set_theta_phi(90.*I3Units.deg, flasherAziRotation) # no upwards tilt for position
# flasher position in DOM coordinates
flasherPos = dataclasses.I3Position(flasherPos.x*flasherRadiusInDOM, flasherPos.y*flasherRadiusInDOM, flasherZPosInDOM)
# apply the DOM orientation (this will flip over the DOM)
#flasherPos = omGeo.orientation.rotate(flasherPos)
flasherPos = omGeo.orientation.rotate_out(flasherPos)
# shift to the actual position in global coordinates
flasherPos = dataclasses.I3Position(domPos.x + flasherPos.x, domPos.y + flasherPos.y, domPos.z - flasherPos.z)
else:
# old-style I3OMGeo (only up/down enum and aziangle for DOM orientation):
# do calculations in global coordinate system (DOM axis towards -z)
# the rotation of flashers is clockwise when viewed from above
# flasher LED1 and LED7 (both flasherPosIndex==0) are assumed
# to point towards the DOM's x-axis.
flasherAziRotation = -60.*I3Units.deg * float(flasherPosIndex)
flasherUpwardsTiltAngle = 0.
if tiltedFlasher: flasherUpwardsTiltAngle=48.*I3Units.deg # (or 42deg down from the vertical)
flasherDir = dataclasses.I3Direction()
flasherDir.set_theta_phi(90.*I3Units.deg - flasherUpwardsTiltAngle, flasherAziRotation - omGeo.aziangle)
flasherPos = dataclasses.I3Direction()
# flasher position on flasher board
flasherUpwardsTiltAngle = 0.
if tiltedFlasher: flasherUpwardsTiltAngle=48.*I3Units.deg # (or 42deg down from the vertical)
flasherDir = dataclasses.I3Direction()
flasherDir.set_theta_phi(90.*I3Units.deg + flasherUpwardsTiltAngle, flasherAziRotation)
# now apply the DOM orientation (this will flip over the DOM)
flasherDir = omGeo.orientation.rotate_out(flasherDir)
#flasherDir = omGeo.orientation.rotate(flasherDir)
# for standard DOMs (i.e. pointing down), flashers are now
# ordered clockwise when viewed from above
flasherPos = dataclasses.I3Direction()
# flasher position on flasher board
flasherPos.set_theta_phi(90.*I3Units.deg, flasherAziRotation) # no upwards tilt for position
# flasher position in DOM coordinates
flasherPos = dataclasses.I3Position(flasherPos.x*flasherRadiusInDOM, flasherPos.y*flasherRadiusInDOM, flasherZPosInDOM)
# apply the DOM orientation (this will flip over the DOM)
#flasherPos = omGeo.orientation.rotate(flasherPos)
flasherPos = omGeo.orientation.rotate_out(flasherPos)
# shift to the actual position in global coordinates
flasherPos = dataclasses.I3Position(domPos.x + flasherPos.x, domPos.y + flasherPos.y, domPos.z - flasherPos.z)
else:
# old-style I3OMGeo (only up/down enum and aziangle for DOM orientation):
# do calculations in global coordinate system (DOM axis towards -z)
# the rotation of flashers is clockwise when viewed from above
# flasher LED1 and LED7 (both flasherPosIndex==0) are assumed
# to point towards the DOM's x-axis.
flasherAziRotation = -60.*I3Units.deg * float(flasherPosIndex)
flasherUpwardsTiltAngle = 0.
if tiltedFlasher: flasherUpwardsTiltAngle=48.*I3Units.deg # (or 42deg down from the vertical)