Commit 866991ff5bbc93fcc55f4229f324da28568938af

Authored by Goutte
1 parent 9854610e

Add Jupiter's CME catalogs.

Also fix #10
CHANGELOG.md
... ... @@ -28,19 +28,25 @@ et prendre aussi
28 28  
29 29 ## Future ?
30 30  
31   -- [ ] Set the log level to _error_ in production (see `web/run.py`)
32 31 - [ ] Rework the images of Rosetta and Juno
33 32 - [ ] Optimize data aggregation (numpy vectorization?)
34   -- [ ] IE compat, if you can (I can't)
35 33 - [ ] Bump D3JS to v5 (and its promises)
36 34 - [ ] Enable p67
  35 +- [ ] IE compat, if you can (mouahahahahaha good luck)
37 36 - [ ] Fix the warmup on the prod server (I was kicked out, do it yourselves)
  37 +- [ ] Set the log level to _error_ in production (see `web/run.py` -- DIY)
38 38  
39 39  
40 40 ## 1.9
41 41  
42   -- [ ] Auroral Emissions (Jupiter)
43   -- [ ] Auroral Emissions Fixes
  42 +- [x] Auroral Emissions (Jupiter)
  43 +- [x] Auroral Emissions Fixes
  44 +- [x] Enable the Input selector
  45 +
  46 +
  47 +## 1.8.3
  48 +
  49 +- [x] Fix whitespaces
44 50  
45 51  
46 52 ## 1.8.2
... ...
VERSION
1   -v1.8.2
  1 +v1.9
... ...
config.yml
... ... @@ -59,7 +59,7 @@ layers:
59 59 - slug: "hstjupiterobservations"
60 60 name: "HST Jupiter"
61 61 desc: "Hubble Space Telescope Jupiter Observations"
62   - live: false
  62 + live: true
63 63 - slug: "hstsaturnobservations"
64 64 name: "HST Saturn"
65 65 desc: "Hubble Space Telescope Saturn Observations"
... ... @@ -240,6 +240,8 @@ targets:
240 240 - slug: 'tao_jup_sta'
241 241 sb:
242 242 - slug: 'tao_jup_stb'
  243 + tap:
  244 + target_name: 'Jupiter'
243 245 locked: false
244 246 default: false
245 247 - type: 'planet'
... ...
web/run.py
... ... @@ -1582,7 +1582,6 @@ def download_auroral_catalog_csv(target):
1582 1582 filename = "%s_auroral_catalog.csv" % (target)
1583 1583 local_csv_file = join(CACHE_DIR, filename)
1584 1584  
1585   -
1586 1585 target_name = tc['tap']['target_name']
1587 1586 emissions = retrieve_auroral_emissions(target_name)
1588 1587  
... ...
web/static/js/main.js
... ... @@ -386,7 +386,7 @@
386 386 targetButton.addClass('empty');
387 387 break;
388 388 }
389   - target.active = false
  389 + target.active = false;
390 390 targetButton.addClass('failed');
391 391 targetButton.removeClass('loading');
392 392 this$.hideLoader();
... ... @@ -531,7 +531,7 @@
531 531 if (h in this._image_preview_layers_data) {
532 532 resolve(app._image_preview_layers_data[h]);
533 533 } else {
534   - let url_route = "saturn_auroral_catalog.csv"; // FIXME
  534 + let url_route = target_slug + "_auroral_catalog.csv";
535 535 let url = app.configuration['api']['root'] + url_route;
536 536 //url += "/" + url_route; // Extra / yields havoc -- flask?
537 537 let d3csv = d3.csv(url, csv => {
... ...
web/view/home.html.jinja2
... ... @@ -145,7 +145,7 @@
145 145 <br />
146 146 {% endfor %}
147 147 <br />
148   - <input type="button" id="apply_new_input" value="Reload for input" title="[COMING SOON] Reloading may take a while." class="mdl-button mdl-js-button mdl-js-ripple-effect">
  148 + <input type="button" id="apply_new_input" value="Reload for input" title="Reloading may take a while." class="mdl-button mdl-js-button mdl-js-ripple-effect">
149 149 </section>
150 150 </details>
151 151  
... ... @@ -391,6 +391,7 @@ jQuery().ready(function($){
391 391 });
392 392 return s < 2;
393 393 };
  394 +
394 395 $(".targets-filters .target:not(.locked)").on("click", function(e){
395 396 if ($(this).hasClass('loading')) return false;
396 397 var switch_on = ! $(this).hasClass('active');
... ... @@ -404,6 +405,7 @@ jQuery().ready(function($){
404 405 }
405 406 return false;
406 407 });
  408 +
407 409 parameters.find(".parameter").click(function(e){
408 410 var switch_on = ! $(this).hasClass('active');
409 411 var parameter_slug = $(this).attr('data-ts-slug');
... ... @@ -416,15 +418,21 @@ jQuery().ready(function($){
416 418 }
417 419 return false;
418 420 });
  421 +
419 422 $('#apply_new_interval').on("click", function(e){
420 423 var started_at = moment($("#started_at").val());
421 424 var stopped_at = moment($("#stopped_at").val());
422 425 sw.resizeDomain(started_at, stopped_at);
423 426 return false;
424 427 });
  428 +
425 429 $('#apply_new_input').on("click", function(e){
426 430 var new_input_slug = $("input[name='input_slug']:checked").val();
427   - window.location = "?input_slug="+new_input_slug;
  431 + var started_at = $("#started_at").val();
  432 + var stopped_at = $("#stopped_at").val();
  433 + window.location = "?input_slug="+new_input_slug+
  434 + "&started_at="+started_at+
  435 + "&stopped_at="+stopped_at;
428 436 return false;
429 437 });
430 438  
... ... @@ -435,6 +443,20 @@ jQuery().ready(function($){
435 443 else { sw.hideCatalogLayer(catalog_slug); }
436 444 });
437 445  
  446 + $('#option-layer-hstjupiterobservations').on("click", function(e){
  447 + var that = $(this);
  448 + var catalog_slug = $(this).attr('value');
  449 + var checked = $(this).prop('checked');
  450 + if (checked) {
  451 + $(this).addClass('loading');
  452 + sw.showImagePreviewLayer("jupiter", catalog_slug).finally( function(){
  453 + that.removeClass('loading');
  454 + });
  455 + } else {
  456 + sw.hideImagePreviewLayer("jupiter", catalog_slug);
  457 + }
  458 + });
  459 +
438 460 $('#option-layer-hstsaturnobservations').on("click", function(e){
439 461 var that = $(this);
440 462 var catalog_slug = $(this).attr('value');
... ...