@@ -1,5 +1,12 | |||
|
1 | 1 | import numpy |
|
2 | 2 | |
|
3 | class Beam: | |
|
4 | def __init__(self): | |
|
5 | self.codeList = [] | |
|
6 | self.azimuthList = [] | |
|
7 | self.zenithList = [] | |
|
8 | ||
|
9 | ||
|
3 | 10 | class AMISR: |
|
4 | 11 | def __init__(self): |
|
5 | 12 | self.flagNoData = True |
@@ -51,6 +58,10 class AMISR: | |||
|
51 | 58 | |
|
52 | 59 | self.npulseByFrame = None |
|
53 | 60 | |
|
61 | self.profileIndex = None | |
|
62 | ||
|
63 | self.beam = Beam() | |
|
64 | ||
|
54 | 65 | def copy(self, inputObj=None): |
|
55 | 66 | |
|
56 | 67 | if inputObj == None: |
@@ -58,8 +69,14 class AMISR: | |||
|
58 | 69 | |
|
59 | 70 | for key in inputObj.__dict__.keys(): |
|
60 | 71 | self.__dict__[key] = inputObj.__dict__[key] |
|
72 | ||
|
73 | def getNHeights(self): | |
|
74 | ||
|
75 | return len(self.heightList) | |
|
61 | 76 | |
|
62 | 77 | |
|
63 | 78 | def isEmpty(self): |
|
64 | 79 | |
|
65 | return self.flagNoData No newline at end of file | |
|
80 | return self.flagNoData | |
|
81 | ||
|
82 | nHeights = property(getNHeights, "I'm the 'nHeights' property.") No newline at end of file |
@@ -89,6 +89,12 def hildebrand_sekhon(data, navg): | |||
|
89 | 89 | stdv = numpy.sqrt((sumq - lnoise**2)/(j - 1)) |
|
90 | 90 | return lnoise |
|
91 | 91 | |
|
92 | class Beam: | |
|
93 | def __init__(self): | |
|
94 | self.codeList = [] | |
|
95 | self.azimuthList = [] | |
|
96 | self.zenithList = [] | |
|
97 | ||
|
92 | 98 | class GenericData(object): |
|
93 | 99 | |
|
94 | 100 | flagNoData = True |
@@ -193,6 +199,8 class JROData(GenericData): | |||
|
193 | 199 | |
|
194 | 200 | zenith = None |
|
195 | 201 | |
|
202 | beam = Beam() | |
|
203 | ||
|
196 | 204 | def __init__(self): |
|
197 | 205 | |
|
198 | 206 | raise ValueError, "This class has not been implemented" |
@@ -735,6 +743,4 class Fits: | |||
|
735 | 743 | noise = property(getNoise, "I'm the 'nHeights' property.") |
|
736 | 744 | datatime = property(getDatatime, "I'm the 'datatime' property") |
|
737 | 745 | ltctime = property(getltctime, "I'm the 'ltctime' property") |
|
738 | ||
|
739 | ltctime = property(getltctime, "I'm the 'ltctime' property") | |
|
740 | 746 |
@@ -166,6 +166,9 class SpectraPlot(Figure): | |||
|
166 | 166 | for i in range(self.nplots): |
|
167 | 167 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) |
|
168 | 168 | title = "Channel %d: %4.2fdB: %s" %(dataOut.channelList[i]+1, noisedB[i], str_datetime) |
|
169 | if len(dataOut.beam.codeList) != 0: | |
|
170 | title = "Ch%d:%4.2fdB,%2.2f,%2.2f:%s" %(dataOut.channelList[i]+1, noisedB[i], dataOut.beam.azimuthList[i], dataOut.beam.zenithList[i], str_datetime) | |
|
171 | ||
|
169 | 172 | axes = self.axesList[i*self.__nsubplots] |
|
170 | 173 | axes.pcolor(x, y, zdB[i,:,:], |
|
171 | 174 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
@@ -77,7 +77,7 def printLabels(ax, xlabel, ylabel, title): | |||
|
77 | 77 | |
|
78 | 78 | ax.set_xlabel(xlabel, size=11) |
|
79 | 79 | ax.set_ylabel(ylabel, size=11) |
|
80 |
ax.set_title(title, size= |
|
|
80 | ax.set_title(title, size=8) | |
|
81 | 81 | |
|
82 | 82 | def createPline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', |
|
83 | 83 | ticksize=9, xtick_visible=True, ytick_visible=True, |
@@ -600,7 +600,7 class AMISRReader(ProcessingUnit): | |||
|
600 | 600 | self.dataOut.data = numpy.reshape(self.datablock[self.profileIndex,:],(1,-1)) |
|
601 | 601 | |
|
602 | 602 | self.dataOut.utctime = self.radacTimeByFrame[self.profileIndex] |
|
603 | ||
|
603 | self.dataOut.profileIndex = self.profileIndex | |
|
604 | 604 | self.dataOut.flagNoData = False |
|
605 | 605 | |
|
606 | 606 | self.profileIndex += 1 |
@@ -1,7 +1,7 | |||
|
1 | 1 | ''' |
|
2 | 2 | @author: Daniel Suarez |
|
3 | 3 | ''' |
|
4 | ||
|
4 | import numpy | |
|
5 | 5 | from jroproc_base import ProcessingUnit, Operation |
|
6 | 6 | from model.data.jroamisr import AMISR |
|
7 | 7 | |
@@ -88,4 +88,43 class BeamSelector(Operation): | |||
|
88 | 88 | else: |
|
89 | 89 | raise ValueError, "BeamSelector needs beam value" |
|
90 | 90 | |
|
91 |
return 0 |
|
|
91 | return 0 | |
|
92 | ||
|
93 | class ProfileToChannels(Operation): | |
|
94 | ||
|
95 | def __init__(self): | |
|
96 | self.__isConfig = False | |
|
97 | self.__counter_chan = 0 | |
|
98 | self.buffer = None | |
|
99 | ||
|
100 | ||
|
101 | def run(self, dataOut): | |
|
102 | ||
|
103 | dataOut.flagNoData = True | |
|
104 | ||
|
105 | if not(self.__isConfig): | |
|
106 | nchannels = len(dataOut.beamRangeDict.keys()) | |
|
107 | nsamples = dataOut.nHeights | |
|
108 | self.buffer = numpy.zeros((nchannels, nsamples), dtype = 'complex128') | |
|
109 | self.__isConfig = True | |
|
110 | ||
|
111 | for i in range(self.buffer.shape[0]): | |
|
112 | if dataOut.profileIndex in dataOut.beamRangeDict[i]: | |
|
113 | self.buffer[i,:] = dataOut.data | |
|
114 | if len(dataOut.beam.codeList) < self.buffer.shape[0]: | |
|
115 | beamInfo = dataOut.beamCodeDict[i] | |
|
116 | dataOut.beam.codeList.append(beamInfo[0]) | |
|
117 | dataOut.beam.azimuthList.append(beamInfo[1]) | |
|
118 | dataOut.beam.zenithList.append(beamInfo[2]) | |
|
119 | break | |
|
120 | ||
|
121 | self.__counter_chan += 1 | |
|
122 | ||
|
123 | if self.__counter_chan >= self.buffer.shape[0]: | |
|
124 | self.__counter_chan = 0 | |
|
125 | dataOut.data = self.buffer.copy() | |
|
126 | dataOut.channelList = range(self.buffer.shape[0]) | |
|
127 | self.__isConfig = False | |
|
128 | dataOut.flagNoData = False | |
|
129 | pass | |
|
130 | No newline at end of file |
@@ -53,6 +53,10 class SpectraProc(ProcessingUnit): | |||
|
53 | 53 | self.dataOut.azimuth = self.dataIn.azimuth |
|
54 | 54 | self.dataOut.zenith = self.dataIn.zenith |
|
55 | 55 | |
|
56 | self.dataOut.beam.codeList = self.dataIn.beam.codeList | |
|
57 | self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList | |
|
58 | self.dataOut.beam.zenithList = self.dataIn.beam.zenithList | |
|
59 | ||
|
56 | 60 | def __getFft(self): |
|
57 | 61 | """ |
|
58 | 62 | Convierte valores de Voltaje a Spectra |
@@ -44,6 +44,10 class VoltageProc(ProcessingUnit): | |||
|
44 | 44 | |
|
45 | 45 | self.dataOut.azimuth = self.dataIn.azimuth |
|
46 | 46 | self.dataOut.zenith = self.dataIn.zenith |
|
47 | ||
|
48 | self.dataOut.beam.codeList = self.dataIn.beam.codeList | |
|
49 | self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList | |
|
50 | self.dataOut.beam.zenithList = self.dataIn.beam.zenithList | |
|
47 | 51 | # |
|
48 | 52 | # pass# |
|
49 | 53 | # |
@@ -15,13 +15,13 controllerObj.setup(id = '191', name='test01', description=desc) | |||
|
15 | 15 | |
|
16 | 16 | |
|
17 | 17 | path = os.path.join(os.environ['HOME'],'Development/amisr/data') |
|
18 | #path = os.path.join(os.environ['HOME'],'Documents/amisr') | |
|
18 | path = '/media/administrator/KINGSTON/amisr' | |
|
19 | 19 | figpath = os.path.join(os.environ['HOME'],'Pictures/amisr') |
|
20 | 20 | |
|
21 | 21 | readUnitConfObj = controllerObj.addReadUnit(datatype='AMISRReader', |
|
22 | 22 | path=path, |
|
23 |
startDate='2014/ |
|
|
24 |
endDate='2014/1 |
|
|
23 | startDate='2014/10/21', | |
|
24 | endDate='2014/10/21', | |
|
25 | 25 | startTime='00:00:00', |
|
26 | 26 | endTime='23:59:59', |
|
27 | 27 | walk=1, |
@@ -32,38 +32,47 procUnitAMISRBeam0 = controllerObj.addProcUnit(datatype='AMISRProc', inputId=rea | |||
|
32 | 32 | |
|
33 | 33 | opObj11 = procUnitAMISRBeam0.addOperation(name='PrintInfo', optype='other') |
|
34 | 34 | |
|
35 | #Reshaper | |
|
36 | opObj11 = procUnitAMISRBeam0.addOperation(name='ProfileToChannels', optype='other') | |
|
37 | ||
|
38 | ||
|
35 | 39 | #Beam Selector |
|
36 | opObj11 = procUnitAMISRBeam0.addOperation(name='BeamSelector', optype='other') | |
|
37 | opObj11.addParameter(name='beam', value='0', format='int') | |
|
40 | #opObj11 = procUnitAMISRBeam0.addOperation(name='BeamSelector', optype='other') | |
|
41 | #opObj11.addParameter(name='beam', value='0', format='int') | |
|
38 | 42 | |
|
39 | 43 | #Voltage Processing Unit |
|
40 | 44 | procUnitConfObjBeam0 = controllerObj.addProcUnit(datatype='VoltageProc', inputId=procUnitAMISRBeam0.getId()) |
|
41 | 45 | #Coherent Integration |
|
42 | 46 | opObj11 = procUnitConfObjBeam0.addOperation(name='CohInt', optype='other') |
|
43 |
opObj11.addParameter(name='n', value=' |
|
|
47 | opObj11.addParameter(name='n', value='8', format='int') | |
|
44 | 48 | #Spectra Unit Processing, getting spectras with nProfiles and nFFTPoints |
|
45 | 49 | procUnitConfObjSpectraBeam0 = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjBeam0.getId()) |
|
46 | 50 | procUnitConfObjSpectraBeam0.addParameter(name='nFFTPoints', value=32, format='int') |
|
47 | 51 | procUnitConfObjSpectraBeam0.addParameter(name='nProfiles', value=32, format='int') |
|
52 | #RemoveDc | |
|
53 | opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='removeDC') | |
|
54 | ||
|
48 | 55 | #Noise Estimation |
|
49 | 56 | opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='getNoise') |
|
50 |
opObj11.addParameter(name='minHei', value=' |
|
|
51 |
opObj11.addParameter(name='maxHei', value=' |
|
|
57 | opObj11.addParameter(name='minHei', value='5', format='float') | |
|
58 | opObj11.addParameter(name='maxHei', value='20', format='float') | |
|
52 | 59 | |
|
53 | 60 | #SpectraPlot |
|
54 | 61 | opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='SpectraPlot', optype='other') |
|
55 | 62 | opObj11.addParameter(name='id', value='100', format='int') |
|
56 | 63 | opObj11.addParameter(name='wintitle', value='AMISR Beam 0', format='str') |
|
64 | opObj11.addParameter(name='zmin', value='30', format='int') | |
|
65 | opObj11.addParameter(name='zmax', value='80', format='int') | |
|
57 | 66 | |
|
58 | 67 | #RTIPlot |
|
59 | title0 = 'RTI AMISR Beam 0' | |
|
60 | opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='RTIPlot', optype='other') | |
|
61 | opObj11.addParameter(name='id', value='200', format='int') | |
|
62 | opObj11.addParameter(name='wintitle', value=title0, format='str') | |
|
63 | opObj11.addParameter(name='showprofile', value='0', format='int') | |
|
64 | #Setting RTI time using xmin,xmax | |
|
65 | opObj11.addParameter(name='xmin', value='15', format='int') | |
|
66 | opObj11.addParameter(name='xmax', value='23', format='int') | |
|
68 | #title0 = 'RTI AMISR Beam 0' | |
|
69 | #opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='RTIPlot', optype='other') | |
|
70 | #opObj11.addParameter(name='id', value='200', format='int') | |
|
71 | #opObj11.addParameter(name='wintitle', value=title0, format='str') | |
|
72 | #opObj11.addParameter(name='showprofile', value='0', format='int') | |
|
73 | ##Setting RTI time using xmin,xmax | |
|
74 | #opObj11.addParameter(name='xmin', value='15', format='int') | |
|
75 | #opObj11.addParameter(name='xmax', value='23', format='int') | |
|
67 | 76 | #Setting dB range with zmin, zmax |
|
68 | 77 | #opObj11.addParameter(name='zmin', value='45', format='int') |
|
69 | 78 | #opObj11.addParameter(name='zmax', value='70', format='int') |
General Comments 0
You need to be logged in to leave comments.
Login now