diff --git a/config.yml b/config.yml index 80b1df3..ab420af 100644 --- a/config.yml +++ b/config.yml @@ -35,6 +35,68 @@ authors: role: Project Coordinator mail: vincent.genot@irap.omp.eu +# `slug` used internally, and should match [a-z0-9]+ +# `name` is displayed +# `title` appears on mouse hover +# `locked` is for sources that are "coming soon" +# `default` sources are shown to incoming visitors, others need user activation +sources: + - type: 'planet' + slug: 'mercury' + name: 'Mercury' + title: 'Mercury (coming soon)' + locked: true + default: true + - type: 'planet' + slug: 'venus' + name: 'Venus' + title: 'Venus (coming soon)' + locked: true + default: true + - type: 'planet' + slug: 'earth' + name: 'Earth' + title: 'Earth (coming soon)' + locked: true + default: true + - type: 'planet' + slug: 'mars' + name: 'Mars' + title: 'Mars (coming soon)' + locked: true + default: true + - type: 'planet' + slug: 'jupiter' + name: 'Jupiter' + title: 'Jupiter' + locked: false + default: true + - type: 'planet' + slug: 'saturn' + name: 'Saturn' + title: 'Saturn (coming soon)' + locked: true + default: true + - type: 'probe' + slug: 'rosetta' + name: 'Rosetta' + title: 'Rosetta (coming soon)' + locked: true + default: false + - type: 'probe' + slug: 'juno' + name: 'Juno' + title: 'Juno (coming soon)' + locked: true + default: false + - type: 'comet' + slug: 'tchouri' + name: 'Tchouri' + title: 'Tchouri (coming soon)' + locked: true + default: false + + # Tao Model OMNI_input #Rosetta tao_ros_sw 2014-01-01T00:00 2017-01-21T00:00 #Juno cruise tao_juno_sw 2012-01-01T00:00 2016-11-02T22:00 diff --git a/web/run.py b/web/run.py index c19e396..2904f85 100755 --- a/web/run.py +++ b/web/run.py @@ -157,7 +157,12 @@ def favicon(): @app.route("/home.html") @app.route("/index.html") def home(): - return render_view('home.html.jinja2', {}) + return render_view('home.html.jinja2', { + 'sources': config['sources'], + 'planets': [s for s in config['sources'] if s['type'] == 'planet'], + 'probes': [s for s in config['sources'] if s['type'] == 'probe'], + 'comets': [s for s in config['sources'] if s['type'] == 'comet'], + }) @app.route("/inspect") @@ -194,19 +199,23 @@ def get_csv(): times = cdf_handle.variables['Time'] data_v = cdf_handle.variables['V'] data_b = cdf_handle.variables['B'] + data_t = cdf_handle.variables['T'] + data_n = cdf_handle.variables['N'] data_p = cdf_handle.variables['P_dyn'] + data_a = cdf_handle.variables['Delta_angle'] cw.writerow(( 'time', 'vrad', 'vtan', 'vlen', - 'magn', 'pdyn' + 'magn', 'temp', 'pdyn', 'dens', 'angl' )) - for time, datum_v, datum_b, datum_p in zip(times, data_v, data_b, data_p): + for time, datum_v, datum_b, datum_t, datum_p, datum_n, datum_a in \ + zip(times, data_v, data_b, data_t, data_n, data_p, data_a): vrad = datum_v[0] vtan = datum_v[1] cw.writerow(( datetime_from_list(time).strftime("%Y-%m-%dT%H:%M:%S+00:00"), vrad, vtan, sqrt(vrad * vrad + vtan * vtan), - datum_b, datum_p + datum_b, datum_t, datum_n, datum_p, datum_a )) cdf_handle.close() @@ -232,6 +241,7 @@ def get_orbiter_csv(orbiter): abort(400, "Invalid stopped_at parameter : '%s'." % stopped_at) # Grab the list of netCDF files from Myriam's API todo + # si = StringIO.StringIO() cw = csv_writer(si) diff --git a/web/view/home.html.jinja2 b/web/view/home.html.jinja2 index 4abe682..6c7beb8 100755 --- a/web/view/home.html.jinja2 +++ b/web/view/home.html.jinja2 @@ -11,10 +11,33 @@ Planets
- Jupiter - Earth (locked) - Mars (locked) +{% for planet in planets %} + {{ planet.name }} +{% endfor %}
+ +
+
+ + Probes + +
+{% for probe in probes %} + {{ probe.name }} +{% endfor %} +
+ +
+
+ + Comets + +
+{% for comet in comets %} + {{ comet.name }} +{% endfor %} +
+

@@ -22,16 +45,13 @@ - Options - -
@@ -99,6 +119,9 @@ stroke-width: 1px; stroke-dasharray: 5px; } + #orbiters_filters { + padding-left: 17px; + } #orbiters_filters img { float: left; } @@ -155,11 +178,14 @@ jQuery().ready(function($){ d3.csv('{{ url_for('get_csv') }}', function(csv){ var timeFormat = d3.timeParse('%Y-%m-%dT%H:%M:%S%Z'); - var data = {'pdyn': [], 'magn': [], 'vlen': []}; + var data = {'pdyn': [], 'magn': [], 'vlen': [], 'temp': [], 'dens': [], 'angl': []}; csv.forEach(function (d) { data['pdyn'].push({x: timeFormat(d['time']), y: parseFloat(d['pdyn'])}); data['magn'].push({x: timeFormat(d['time']), y: parseFloat(d['magn'])}); data['vlen'].push({x: timeFormat(d['time']), y: parseFloat(d['vlen'])}); + data['temp'].push({x: timeFormat(d['time']), y: parseFloat(d['temp'])}); + data['dens'].push({x: timeFormat(d['time']), y: parseFloat(d['dens'])}); + data['angl'].push({x: timeFormat(d['time']), y: parseFloat(d['angl'])}); }); var container = '#time_series'; @@ -172,7 +198,15 @@ jQuery().ready(function($){ timeSeries.push(new TimeSeries( 'vlen', 'Velocity (km/s)', data['vlen'], container )); - + timeSeries.push(new TimeSeries( + 'temp', 'Temperature (K)', data['temp'], container + )); + timeSeries.push(new TimeSeries( + 'dens', 'Density N (cm⁻³)', data['dens'], container + )); + timeSeries.push(new TimeSeries( + 'angl', 'Angle T-S-E (deg)', data['angl'], container + )); // move outside after promises timeSeries.forEach(function(ts){ ts.options['onMouseOver'] = function() { diff --git a/web/view/layout.html.jinja2 b/web/view/layout.html.jinja2 index 8a059b4..0c1f01d 100755 --- a/web/view/layout.html.jinja2 +++ b/web/view/layout.html.jinja2 @@ -32,7 +32,7 @@
- CDPP / Space Weather Online + CDPP / Solar Wind Prediction @ Planets
@@ -67,14 +67,27 @@ -- libgit2 0.21.2