@@ -191,17 +191,17 def cmap1_init(colormap="gray"): | |||||
191 | def setColormap(colormap="jet"): |
|
191 | def setColormap(colormap="jet"): | |
192 | cmap1_init(colormap) |
|
192 | cmap1_init(colormap) | |
193 |
|
193 | |||
194 |
def savePlplot( |
|
194 | def savePlplot(filename,width,height): | |
195 | curr_strm = plplot.plgstrm() |
|
195 | curr_strm = plplot.plgstrm() | |
196 | save_strm = plplot.plmkstrm() |
|
196 | save_strm = plplot.plmkstrm() | |
197 |
plplot.plsetopt("geometry", "%dx%d"%(width |
|
197 | plplot.plsetopt("geometry", "%dx%d"%(width,height)) | |
198 |
plplot.plsdev("png |
|
198 | plplot.plsdev("png") | |
199 | plplot.plsfnam(filename) |
|
199 | plplot.plsfnam(filename) | |
200 | plplot.plcpstrm(curr_strm,0) |
|
200 | plplot.plcpstrm(curr_strm,0) | |
201 | plplot.plreplot() |
|
201 | plplot.plreplot() | |
|
202 | plplot.plclear() | |||
202 | plplot.plend1() |
|
203 | plplot.plend1() | |
203 |
plplot.plsstrm( |
|
204 | plplot.plsstrm(curr_strm) | |
204 | print '' |
|
|||
205 |
|
205 | |||
206 |
|
206 | |||
207 | def initPlplot(indexPlot,ncol,nrow,winTitle,width,height): |
|
207 | def initPlplot(indexPlot,ncol,nrow,winTitle,width,height): | |
@@ -740,7 +740,9 class SpectraPlot: | |||||
740 | now = datetime.datetime.now().timetuple() |
|
740 | now = datetime.datetime.now().timetuple() | |
741 | file = "spc_img%02d_%03d_%02d%02d%02d"%(indexPlot,now[7],now[3],now[4],now[5]) |
|
741 | file = "spc_img%02d_%03d_%02d%02d%02d"%(indexPlot,now[7],now[3],now[4],now[5]) | |
742 | filename = os.path.join(path,file+".png") |
|
742 | filename = os.path.join(path,file+".png") | |
743 | savePlplot(indexPlot,filename,self.ncol,self.nrow,self.width,self.height) |
|
743 | width = self.width*self.ncol | |
|
744 | hei = self.height*self.nrow | |||
|
745 | savePlplot(filename,width,hei) | |||
744 |
|
746 | |||
745 |
|
747 | |||
746 |
|
748 |
@@ -148,7 +148,7 class Noise: | |||||
148 | """ |
|
148 | """ | |
149 |
|
149 | |||
150 | if data == None: |
|
150 | if data == None: | |
151 | return 0 |
|
151 | raise ValueError, "The data value is not defined" | |
152 |
|
152 | |||
153 | shape = data.shape |
|
153 | shape = data.shape | |
154 | self.dim = len(shape) |
|
154 | self.dim = len(shape) |
@@ -239,7 +239,8 class SpectraProcessor: | |||||
239 | self.dataOutObj.data_dc = dc |
|
239 | self.dataOutObj.data_dc = dc | |
240 | self.dataOutObj.m_ProcessingHeader.blockSize = blocksize |
|
240 | self.dataOutObj.m_ProcessingHeader.blockSize = blocksize | |
241 | self.dataOutObj.m_BasicHeader.utc = self.dataInObj.m_BasicHeader.utc |
|
241 | self.dataOutObj.m_BasicHeader.utc = self.dataInObj.m_BasicHeader.utc | |
242 |
|
242 | |||
|
243 | self.getNoise() | |||
243 |
|
244 | |||
244 | def addWriter(self,wrpath): |
|
245 | def addWriter(self,wrpath): | |
245 | objWriter = SpectraWriter(self.dataOutObj) |
|
246 | objWriter = SpectraWriter(self.dataOutObj) | |
@@ -329,7 +330,7 class SpectraProcessor: | |||||
329 | #print "myIncohIntObj.navg: ",myIncohIntObj.navg |
|
330 | #print "myIncohIntObj.navg: ",myIncohIntObj.navg | |
330 | self.dataOutObj.flagNoData = False |
|
331 | self.dataOutObj.flagNoData = False | |
331 |
|
332 | |||
332 |
self.getNoise(type="hildebrand" |
|
333 | self.getNoise(type="hildebrand") | |
333 | # self.getNoise(type="sort", parm=16) |
|
334 | # self.getNoise(type="sort", parm=16) | |
334 |
|
335 | |||
335 | else: |
|
336 | else: | |
@@ -357,6 +358,9 class SpectraProcessor: | |||||
357 |
|
358 | |||
358 | def getNoise(self, type="hildebrand", parm=None): |
|
359 | def getNoise(self, type="hildebrand", parm=None): | |
359 |
|
360 | |||
|
361 | if parm == None: | |||
|
362 | parm =self.dataOutObj.m_ProcessingHeader.incoherentInt | |||
|
363 | ||||
360 | self.noiseObj.setNoise(self.dataOutObj.data_spc) |
|
364 | self.noiseObj.setNoise(self.dataOutObj.data_spc) | |
361 |
|
365 | |||
362 | if type == "hildebrand": |
|
366 | if type == "hildebrand": |
General Comments 0
You need to be logged in to leave comments.
Login now