@@ -2615,6 +2615,9 class SpectraWriter(JRODataWriter): | |||
|
2615 | 2615 | self.systemHeaderObj = self.dataOut.systemHeaderObj.copy() |
|
2616 | 2616 | self.systemHeaderObj.nChannels = self.dataOut.nChannels |
|
2617 | 2617 | self.radarControllerHeaderObj = self.dataOut.radarControllerHeaderObj.copy() |
|
2618 | old_code_size = self.dataOut.radarControllerHeaderObj.code_size | |
|
2619 | new_code_size = int(numpy.ceil(self.dataOut.nBaud/32.))*self.dataOut.nCode*4 | |
|
2620 | self.radarControllerHeaderObj.size = self.radarControllerHeaderObj.size - old_code_size + new_code_size | |
|
2618 | 2621 | |
|
2619 | 2622 | self.setBasicHeader() |
|
2620 | 2623 |
@@ -276,6 +276,7 class RadarControllerHeader(Header): | |||
|
276 | 276 | self.code[ic,ib] = temp[ib/32]%2 |
|
277 | 277 | temp[ib/32] = temp[ib/32]/2 |
|
278 | 278 | self.code = 2.0*self.code - 1.0 |
|
279 | self.code_size = int(numpy.ceil(self.nBaud/32.))*self.nCode*4 | |
|
279 | 280 | |
|
280 | 281 | if self.line5Function == RCfunction.FLIP: |
|
281 | 282 | self.flip1 = numpy.fromfile(fp,'<u4',1) |
@@ -316,8 +317,41 class RadarControllerHeader(Header): | |||
|
316 | 317 | header = numpy.array(headerTuple,self.struct) |
|
317 | 318 | header.tofile(fp) |
|
318 | 319 | |
|
319 | dynamic = self.dynamic | |
|
320 | dynamic.tofile(fp) | |
|
320 | #dynamic = self.dynamic | |
|
321 | #dynamic.tofile(fp) | |
|
322 | ||
|
323 | samplingWindow = self.samplingWindow | |
|
324 | samplingWindow.tofile(fp) | |
|
325 | ||
|
326 | if self.numTaus > 0: | |
|
327 | self.Taus.tofile(fp) | |
|
328 | ||
|
329 | nCode = numpy.array(self.nCode, '<u4') | |
|
330 | nCode.tofile(fp) | |
|
331 | nBaud = numpy.array(self.nBaud, '<u4') | |
|
332 | nBaud.tofile(fp) | |
|
333 | code1 = (self.code + 1.0)/2. | |
|
334 | ||
|
335 | for ic in range(self.nCode): | |
|
336 | tempx = numpy.zeros(numpy.ceil(self.nBaud/32.)) | |
|
337 | start = 0 | |
|
338 | end = 32 | |
|
339 | for i in range(len(tempx)): | |
|
340 | code_selected = code1[ic,start:end] | |
|
341 | for j in range(len(code_selected)-1,-1,-1): | |
|
342 | if code_selected[j] == 1: | |
|
343 | tempx[i] = tempx[i] + 2**(len(code_selected)-1-j) | |
|
344 | start = start + 32 | |
|
345 | end = end + 32 | |
|
346 | ||
|
347 | tempx = tempx.astype('u4') | |
|
348 | tempx.tofile(fp) | |
|
349 | ||
|
350 | if self.line5Function == RCfunction.FLIP: | |
|
351 | self.flip1.tofile(fp) | |
|
352 | ||
|
353 | if self.line6Function == RCfunction.FLIP: | |
|
354 | self.flip2.tofile(fp) | |
|
321 | 355 | |
|
322 | 356 | return 1 |
|
323 | 357 |
General Comments 0
You need to be logged in to leave comments.
Login now