@@ -1,103 +1,105 | |||
|
1 | 1 | ''' |
|
2 | 2 | Created on Feb 7, 2012 |
|
3 | 3 | |
|
4 | 4 | @author $Author$ |
|
5 | 5 | @version $Id$ |
|
6 | 6 | ''' |
|
7 | 7 | import copy |
|
8 | import numpy | |
|
9 | ||
|
8 | 10 | from JROHeader import RadarControllerHeader, ProcessingHeader, SystemHeader, BasicHeader |
|
9 | 11 | |
|
10 | 12 | class Data: |
|
11 | 13 | ''' |
|
12 | 14 | classdocs |
|
13 | 15 | ''' |
|
14 | 16 | |
|
15 | 17 | def __init__(self): |
|
16 | 18 | ''' |
|
17 | 19 | Constructor |
|
18 | 20 | ''' |
|
19 | 21 | raise ValueError, "This class has not been implemented" |
|
20 | 22 | |
|
21 | 23 | def copy(self, objIn=None): |
|
22 | 24 | |
|
23 | 25 | if objIn == None: |
|
24 | 26 | return copy.deepcopy(self) |
|
25 | 27 | |
|
26 | 28 | for key in objIn.__dict__.keys(): |
|
27 | 29 | self.__dict__[key] = objIn.__dict__[key] |
|
28 | 30 | |
|
29 | 31 | def deepcopy(self): |
|
30 | 32 | |
|
31 | 33 | return copy.deepcopy(self) |
|
32 | 34 | |
|
33 | 35 | class Noise(Data): |
|
34 | 36 | ''' |
|
35 | 37 | classdocs |
|
36 | 38 | ''' |
|
37 | 39 | |
|
38 | 40 | def __init__(self): |
|
39 | 41 | ''' |
|
40 | 42 | Constructor |
|
41 | 43 | ''' |
|
42 | 44 | pass |
|
43 | 45 | |
|
44 | 46 | class JROData(Data): |
|
45 | 47 | ''' |
|
46 | 48 | classdocs |
|
47 | 49 | ''' |
|
48 | 50 | |
|
49 | 51 | m_RadarControllerHeader = RadarControllerHeader() |
|
50 | 52 | |
|
51 | 53 | m_ProcessingHeader = ProcessingHeader() |
|
52 | 54 | |
|
53 | 55 | m_SystemHeader = SystemHeader() |
|
54 | 56 | |
|
55 | 57 | m_BasicHeader = BasicHeader() |
|
56 | 58 | |
|
57 | 59 | m_NoiseObj = Noise() |
|
58 | 60 | |
|
59 | 61 | type = None |
|
60 | 62 | |
|
61 | 63 | dataType = None |
|
62 | 64 | |
|
63 | 65 | nHeights = None |
|
64 | 66 | |
|
65 | 67 | nChannels = None |
|
66 | 68 | |
|
67 | 69 | heightList = None |
|
68 | 70 | |
|
69 | 71 | channelList = None |
|
70 | 72 | |
|
71 | 73 | flagNoData = False |
|
72 | 74 | |
|
73 | 75 | flagResetProcessing = False |
|
74 | 76 | |
|
75 | 77 | def __init__(self): |
|
76 | 78 | ''' |
|
77 | 79 | Constructor |
|
78 | 80 | ''' |
|
79 | 81 | raise ValueError, "This class has not been implemented" |
|
80 | 82 | |
|
81 | 83 | def updateHeaderFromObj(self): |
|
82 | 84 | |
|
83 | 85 | xi = self.heightList[0] |
|
84 | 86 | step = self.heightList[1] - self.heightList[0] |
|
85 | 87 | |
|
86 | 88 | self.m_ProcessingHeader.firstHeight = xi |
|
87 | 89 | self.m_ProcessingHeader.deltaHeight = step |
|
88 | 90 | |
|
89 | 91 | self.m_ProcessingHeader.numHeights = self.nHeights |
|
90 | 92 | self.m_SystemHeader.numChannels = self.nChannels |
|
91 | 93 | |
|
92 | 94 | def updateObjFromHeader(self): |
|
93 | 95 | |
|
94 | 96 | xi = self.m_ProcessingHeader.firstHeight |
|
95 | 97 | step = self.m_ProcessingHeader.deltaHeight |
|
96 | 98 | xf = xi + self.m_ProcessingHeader.numHeights*step |
|
97 | 99 | |
|
98 | 100 | self.heightList = numpy.arange(xi, xf, step) |
|
99 | 101 | self.channelList = numpy.arange(self.m_SystemHeader.numChannels) |
|
100 | 102 | |
|
101 | 103 | self.nHeights = len(self.heightList) |
|
102 | 104 | self.nChannels = len(self.channelList) |
|
103 | 105 | No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now