diff --git a/lightcurve/static/lightcurve/js/lightcurve.js b/lightcurve/static/lightcurve/js/lightcurve.js index 833f510..657efa5 100644 --- a/lightcurve/static/lightcurve/js/lightcurve.js +++ b/lightcurve/static/lightcurve/js/lightcurve.js @@ -237,6 +237,9 @@ function setupImagePairs() { data.pairs = JSON.stringify(pairs); + // Manual color index + data.manual_color_index = $('#set-manual-ci').val(); + // TODO(ian): POST it all to some endpoint. $.post('/lightcurve/' + window.lightcurveId + '/save_image_pairs', data, function(result) { if (result.success) { diff --git a/lightcurve/templates/partials/image_pair_selector.html b/lightcurve/templates/partials/image_pair_selector.html index 999ab8d..b51b426 100644 --- a/lightcurve/templates/partials/image_pair_selector.html +++ b/lightcurve/templates/partials/image_pair_selector.html @@ -1,12 +1,19 @@
-
- - + +
+ + - this value overrides the computed color index from image pairs. + +
+
+ + +
diff --git a/lightcurve/views.py b/lightcurve/views.py index cf9f2bf..0a3c9b7 100644 --- a/lightcurve/views.py +++ b/lightcurve/views.py @@ -163,8 +163,15 @@ def apply_photometry_settings(request, lightcurve_id): def save_image_pairs(request, lightcurve_id): lc = get_object_or_404(LightCurve, id=lightcurve_id, user=request.user.id) - images = lc.imageanalysis_set.all() + reduction = lc.get_or_create_reduction() + color_index_manual = request.POST.get('manual_color_index') + if color_index_manual: + reduction.color_index_manual = float(color_index_manual) + else: + reduction.color_index_manual = None + reduction.save() + images = lc.imageanalysis_set.all() ciband = request.POST.get('ciband') pairs = json.loads(request.POST.get('pairs'))