Commit f6260cb7e75f76c66623d26313f88a659e98e21a

Authored by hitier
2 parents fd0f94e9 fd4c583f
Exists in rhitier-dev

Merge fixNovember

requirements.txt
... ... @@ -15,5 +15,5 @@ numpy==1.22.4
15 15 python-dateutil==2.8.2
16 16 Yaml8==0.1.2
17 17 netCDF4==1.5.8
18   -unicode-slugify==0.1.5
  18 +python-slugify==6.1.2
19 19 gunicorn==20.1.0
... ...
web/run.py
... ... @@ -328,6 +328,10 @@ def datetime_from_list(time_list):
328 328 with DayOfYear starting at 0. We want it starting at 1 because it's what
329 329 vendor parsers use, both in python and javascript.
330 330 """
  331 + try:
  332 + time_list = [str(i, 'UTF8') for i in time_list]
  333 + except Exception as e:
  334 + log.error(e)
331 335 # Day Of Year starts at 0, but for our datetime parser it starts at 1
332 336 doy = '{:03d}'.format(int(''.join(time_list[4:7])) + 1)
333 337 return datetime.datetime.strptime(
... ... @@ -711,10 +715,6 @@ def get_data_for_target(target_config, input_slug,
711 715 (target_config['name'], orbit_file))
712 716 for ltime, datum_hee in zip(times, data_hee):
713 717 try:
714   - try:
715   - ltime = [str(i, 'UTF8') for i in ltime]
716   - except Exception as e:
717   - print(e)
718 718 dtime = datetime_from_list(ltime)
719 719 except Exception:
720 720 log.error("Failed to parse time from get__data_for_target %s." % ltime)
... ... @@ -776,10 +776,6 @@ def get_data_for_target(target_config, input_slug,
776 776 in zip(times, data_v, data_b, data_t, data_n, data_p, data_a):
777 777  
778 778 try:
779   - try:
780   - ltime = [str(i, 'UTF8') for i in ltime]
781   - except Exception as e:
782   - print(e)
783 779 dtime = datetime_from_list(ltime)
784 780 except Exception:
785 781 log.error("Failed to parse time from %s." % ltime)
... ...
web/static/js/main.js
... ... @@ -419,6 +419,8 @@
419 419 }
420 420 console.log(target['name'], id, data[id]);
421 421 if (data[id].length) {
  422 + //console.log('-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+')
  423 + console.log(id, title, target, data[id], container)
422 424 return app.time_series.push(new TimeSeries(id, title, target, data[id], app.parameters[id].active, container, {
423 425 'started_at': app.started_at,
424 426 'stopped_at': app.stopped_at
... ... @@ -871,7 +873,10 @@
871 873 this.plotWrapper.append('g').classed('x axis', true);
872 874 this.plotWrapper.append('g').classed('y axis', true);
873 875 this.yAxisText = this.plotWrapper.append("text").attr("transform", "rotate(-90)").attr("dy", "1em").style("text-anchor", "middle").text(this.title);
874   - this.yAxisTextTarget = this.plotWrapper.append("text").attr("transform", "rotate(-90)").attr("dy", "1em").style("text-anchor", "middle").style("font-style", "oblique").text(this.target.name);
  876 + let y_title = this.target.name+" from "+$("input[name='input_slug']:checked").siblings(".mdl-radio__label").html();
  877 + this.yAxisTextTarget = this.plotWrapper.append("text").attr("transform", "rotate(-90)")
  878 + .attr("dy", "1em").style("text-anchor", "middle")
  879 + .style("font-style", "oblique").text(y_title);
875 880 this.focus = this.plotWrapper.append('g').style("display", "none");
876 881 this.cursorCircle = this.focus.append("circle").attr("class", "cursor-circle").attr("r", 3);
877 882 dx = 8;
... ...
web/view/home.html.jinja2
... ... @@ -182,12 +182,12 @@
182 182 title="Send the data to a connected SAMP hub, such as TOPCAT.">
183 183 SAMP
184 184 </button>
185   -#}
186 185 <button id="email_alert"
187 186 class="mdl-button mdl-button--raised mdl-button--primary"
188 187 title="Set an alert to receive an email when the data validates pre-defined conditions."
189 188 data-href="http://alerts-psws.irap.omp.eu/tao">
190 189 Alert
  190 +#}
191 191 </button>
192 192 {% endif %}
193 193  
... ...