##// END OF EJS Templates
Add decimation to jsonify data to web & fix typo KM
jespinoza -
r1122:f7735fe71c79
parent child
Show More
@@ -451,7 +451,7 class PlotData(Operation, Process):
451 451 self.CODE,
452 452 label,
453 453 self.getDateTime(self.saveTime).strftime(
454 '%y%m%d_%H%M%S'),
454 '%Y%m%d_%H%M%S'),
455 455 )
456 456 )
457 457 log.log('Saving figure: {}'.format(figname), self.name)
@@ -528,7 +528,7 class PlotSpectraData(PlotData):
528 528 if self.showprofile:
529 529 self.width += 0.8 * self.ncols
530 530
531 self.ylabel = 'Range [Km]'
531 self.ylabel = 'Range [km]'
532 532
533 533 def plot(self):
534 534 if self.xaxis == "frequency":
@@ -600,7 +600,7 class PlotCrossSpectraData(PlotData):
600 600 self.nplots = self.nrows * 4
601 601 self.width = 3.4 * self.ncols
602 602 self.height = 3 * self.nrows
603 self.ylabel = 'Range [Km]'
603 self.ylabel = 'Range [km]'
604 604 self.showprofile = False
605 605
606 606 def plot(self):
@@ -703,7 +703,7 class PlotRTIData(PlotData):
703 703 self.ncols = 1
704 704 self.nrows = len(self.data.channels)
705 705 self.nplots = len(self.data.channels)
706 self.ylabel = 'Range [Km]'
706 self.ylabel = 'Range [km]'
707 707 self.cb_label = 'dB'
708 708 self.titles = ['{} Channel {}'.format(
709 709 self.CODE.upper(), x) for x in range(self.nrows)]
@@ -760,7 +760,7 class PlotCOHData(PlotRTIData):
760 760 self.ncols = 1
761 761 self.nrows = len(self.data.pairs)
762 762 self.nplots = len(self.data.pairs)
763 self.ylabel = 'Range [Km]'
763 self.ylabel = 'Range [km]'
764 764 if self.CODE == 'coh':
765 765 self.cb_label = ''
766 766 self.titles = [
@@ -902,7 +902,7 class PlotParamData(PlotRTIData):
902 902 self.nrows += 1
903 903 self.nplots += 1
904 904
905 self.ylabel = 'Height [Km]'
905 self.ylabel = 'Height [km]'
906 906 if not self.titles:
907 907 self.titles = self.data.parameters \
908 908 if self.data.parameters else ['Param {}'.format(x) for x in xrange(self.nrows)]
@@ -218,10 +218,12 class Data(object):
218 218
219 219 data = {}
220 220 tm = self.times[-1]
221
221
222 222 for key in self.data:
223 223 if key in ('spc', 'cspc'):
224 data[key] = roundFloats(self.data[key].tolist())
224 dx = int(self.data[key].shape[1]/MAXNUMX) + 1
225 dy = int(self.data[key].shape[2]/MAXNUMY) + 1
226 data[key] = roundFloats(self.data[key][::, ::dx, ::dy].tolist())
225 227 else:
226 228 data[key] = roundFloats(self.data[key][tm].tolist())
227 229
@@ -229,10 +231,12 class Data(object):
229 231 ret['exp_code'] = self.exp_code
230 232 ret['time'] = tm
231 233 ret['interval'] = self.interval
232 ret['ymin'] = self.heights[0]
233 ret['ymax'] = self.heights[-1]
234 ret['ystep'] = self.heights[1] - self.heights[0]
235
234 ret['localtime'] = self.localtime
235 ret['yrange'] = roundFloats(self.heights.tolist())
236 if key in ('spc', 'cspc'):
237 ret['xrange'] = roundFloats(self.xrange[2][::dx].tolist())
238 if hasattr(self, 'pairs'):
239 ret['pairs'] = self.pairs
236 240 return json.dumps(ret)
237 241
238 242 @property
General Comments 0
You need to be logged in to leave comments. Login now