##// 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 self.CODE,
451 self.CODE,
452 label,
452 label,
453 self.getDateTime(self.saveTime).strftime(
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 log.log('Saving figure: {}'.format(figname), self.name)
457 log.log('Saving figure: {}'.format(figname), self.name)
@@ -528,7 +528,7 class PlotSpectraData(PlotData):
528 if self.showprofile:
528 if self.showprofile:
529 self.width += 0.8 * self.ncols
529 self.width += 0.8 * self.ncols
530
530
531 self.ylabel = 'Range [Km]'
531 self.ylabel = 'Range [km]'
532
532
533 def plot(self):
533 def plot(self):
534 if self.xaxis == "frequency":
534 if self.xaxis == "frequency":
@@ -600,7 +600,7 class PlotCrossSpectraData(PlotData):
600 self.nplots = self.nrows * 4
600 self.nplots = self.nrows * 4
601 self.width = 3.4 * self.ncols
601 self.width = 3.4 * self.ncols
602 self.height = 3 * self.nrows
602 self.height = 3 * self.nrows
603 self.ylabel = 'Range [Km]'
603 self.ylabel = 'Range [km]'
604 self.showprofile = False
604 self.showprofile = False
605
605
606 def plot(self):
606 def plot(self):
@@ -703,7 +703,7 class PlotRTIData(PlotData):
703 self.ncols = 1
703 self.ncols = 1
704 self.nrows = len(self.data.channels)
704 self.nrows = len(self.data.channels)
705 self.nplots = len(self.data.channels)
705 self.nplots = len(self.data.channels)
706 self.ylabel = 'Range [Km]'
706 self.ylabel = 'Range [km]'
707 self.cb_label = 'dB'
707 self.cb_label = 'dB'
708 self.titles = ['{} Channel {}'.format(
708 self.titles = ['{} Channel {}'.format(
709 self.CODE.upper(), x) for x in range(self.nrows)]
709 self.CODE.upper(), x) for x in range(self.nrows)]
@@ -760,7 +760,7 class PlotCOHData(PlotRTIData):
760 self.ncols = 1
760 self.ncols = 1
761 self.nrows = len(self.data.pairs)
761 self.nrows = len(self.data.pairs)
762 self.nplots = len(self.data.pairs)
762 self.nplots = len(self.data.pairs)
763 self.ylabel = 'Range [Km]'
763 self.ylabel = 'Range [km]'
764 if self.CODE == 'coh':
764 if self.CODE == 'coh':
765 self.cb_label = ''
765 self.cb_label = ''
766 self.titles = [
766 self.titles = [
@@ -902,7 +902,7 class PlotParamData(PlotRTIData):
902 self.nrows += 1
902 self.nrows += 1
903 self.nplots += 1
903 self.nplots += 1
904
904
905 self.ylabel = 'Height [Km]'
905 self.ylabel = 'Height [km]'
906 if not self.titles:
906 if not self.titles:
907 self.titles = self.data.parameters \
907 self.titles = self.data.parameters \
908 if self.data.parameters else ['Param {}'.format(x) for x in xrange(self.nrows)]
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 data = {}
219 data = {}
220 tm = self.times[-1]
220 tm = self.times[-1]
221
221
222 for key in self.data:
222 for key in self.data:
223 if key in ('spc', 'cspc'):
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 else:
227 else:
226 data[key] = roundFloats(self.data[key][tm].tolist())
228 data[key] = roundFloats(self.data[key][tm].tolist())
227
229
@@ -229,10 +231,12 class Data(object):
229 ret['exp_code'] = self.exp_code
231 ret['exp_code'] = self.exp_code
230 ret['time'] = tm
232 ret['time'] = tm
231 ret['interval'] = self.interval
233 ret['interval'] = self.interval
232 ret['ymin'] = self.heights[0]
234 ret['localtime'] = self.localtime
233 ret['ymax'] = self.heights[-1]
235 ret['yrange'] = roundFloats(self.heights.tolist())
234 ret['ystep'] = self.heights[1] - self.heights[0]
236 if key in ('spc', 'cspc'):
235
237 ret['xrange'] = roundFloats(self.xrange[2][::dx].tolist())
238 if hasattr(self, 'pairs'):
239 ret['pairs'] = self.pairs
236 return json.dumps(ret)
240 return json.dumps(ret)
237
241
238 @property
242 @property
General Comments 0
You need to be logged in to leave comments. Login now