1
2 import empro
3 import math
4
5 _HALF_CIRCLE = (0, math.radians(180), math.radians(2.5))
6 _FULL_CIRCLE = (0, math.radians(360), math.radians(2.5))
7
9 '''
10 makeFarZoneThetaPhi( theta, phi)
11 Adds a new request for far zone sensor.
12 @type theta: list<float> | float
13 @param theta: specification of Theta, (start, end, increment) or constant
14 @type phi: list<float> | float
15 @param phi: specification of Phi, (start, end, increment) or constant
16 @type name: string
17 @param name: name of sensors
18 @rtype: L{FarZoneSensor}
19 @return: the newly create far zone sensor
20 '''
21 sensor = empro.sensor.FarZoneSensor()
22 sensor.name = name
23 sensor.coordinateSystemType = "ThetaPhi"
24 sensor.collectSteadyState = True
25 sensor.collectTransient = False
26 try:
27 sensor.angle1Start, sensor.angle1Stop, sensor.angle1Increment = theta
28 except:
29 sensor.angle1Start = theta
30 sensor.useConstantAngle1 = True
31 try:
32 sensor.angle2Start, sensor.angle2Stop, sensor.angle2Increment = phi
33 except:
34 sensor.angle2Start = phi
35 sensor.useConstantAngle2 = True
36 return sensor
37
38
40 '''
41 makeFarZoneCutTheta90([name])
42 wrapper around makeFarZoneThetaPhi that creates a circular far zone sensor with Theta = 90 degrees
43 @rtype: L{FarZoneSensor}
44 @return: the newly create far zone sensor
45 '''
46 return makeFarZoneThetaPhi(theta = math.radians(90), phi = _FULL_CIRCLE, name = name)
47
48
50 '''
51 makeFarZoneCutTheta90([name])
52 wrapper around makeFarZoneThetaPhi that creates a circular far zone sensor with Phi = 90 degrees
53 @rtype: L{FarZoneSensor}
54 @return: the newly create far zone sensor
55 '''
56 return makeFarZoneThetaPhi(theta = _FULL_CIRCLE, phi = math.radians(90), name = name)
57