{% extends "base.html" %} {% from "_multilayer_design_macros.html" import stage_monitor %} {% block title %}{{ study.display_name }}{% endblock %} {% block body %} {% set survey = stages[0] %} {% set energy_scan = stages[1] %} {% set artifact = url_for('data_file', filename='multilayer_designs/' ~ study.id ~ '/') %}

{{ study.display_name }}

{{ study.id }} · created {{ study.created_at }}

Edit parameters Download script All studies

Stored in multilayer_designs/{{ study.id }}/. {% if study.auto_energy_scan == "best" %} The energy scan on the best design starts automatically once the survey finishes. {% endif %}

{# ------------------------------------------------------------------ #} {# Stage 1 — survey #} {# ------------------------------------------------------------------ #}

{{ survey.label }}

{{ survey.status }} {% if survey.error_text %}

{{ survey.error_text }}

{% endif %}
{% if survey.status in ["queued", "running", "aborting"] %} {{ stage_monitor(study.id, "survey") }} {% else %}
{% if survey.status not in ["not_run"] %} {% endif %}
{% endif %} {% set survey_running = survey.status in ["queued", "running", "aborting"] %} {% if plotly_bundle and (survey.artifacts.heatmap_plot or (survey_running and design_options.best)) %} {# Interactive versions of the same three plots the library writes as PNGs. Clicking a heatmap cell feeds the stage-2 design picker below. While the survey runs, data-survey-live-url makes them follow the grid filling in. #}
{% if survey_running %}

Updating as cells are solved.

{% endif %}
{% endif %} {% if survey.artifacts.heatmap_plot %} {% if not plotly_bundle %}
Optimal blaze angle versus d-spacing
Optimal blaze angle vs d-spacing
Max efficiency versus d-spacing
Max efficiency vs d-spacing
Efficiency over the d-spacing and blaze-angle grid
Peak efficiency over (d, blaze), with the optimal-blaze ridge
{% endif %}
Per-cell table survey.csv
{% endif %}
{# ------------------------------------------------------------------ #} {# Stage 2 — energy scan #} {# ------------------------------------------------------------------ #}

{{ energy_scan.label }}

{{ energy_scan.status }} {% if energy_scan.status == "stale" %}

The survey was re-run since this scan — re-run recommended.

{% endif %} {% if energy_scan.error_text %}

{{ energy_scan.error_text }}

{% endif %}
{% if energy_scan.status in ["queued", "running", "aborting"] %} {{ stage_monitor(study.id, "energy_scan") }} {% if plotly_bundle %} {# Fed from each design's checkpoint, which gains a record per solved energy; the finished stage renders its saved plots instead. #}

Updating as energies are solved.

{% endif %} {% elif survey.status != "completed" %}

Run the survey first — its results decide which designs are worth scanning.

{% elif not design_options.best %}

The survey produced no usable cell, so there is nothing to scan.

{% else %}
Scan the best design only

d = {{ "%.3f"|format(design_options.best[0]) }} nm, blaze = {{ "%.3f"|format(design_options.best[1]) }} deg — the survey's highest efficiency.

Scan the optimal blaze at every d-spacing

{{ design_options.per_d|length }} designs, one per d-spacing.

Choose manually

Pick any (d, blaze) combinations from the survey grid.

{% endif %} {% if energy_scan.status not in ["queued", "running", "aborting"] and energy_scan.artifacts.designs %} {% if energy_scan.artifacts.overlay_plot %}
Efficiency versus energy for every scanned design
All scanned designs compared
{% endif %}
{% for design in energy_scan.artifacts.designs %}
Efficiency versus energy for one design
d = {{ "%.3f"|format(design.d_spacing_nm) }} nm, blaze = {{ "%.3f"|format(design.blaze_angle_deg) }} deg · summary.csv
{% endfor %}
{% endif %}
{% endblock %}