{% from "_roughness_help.html" import roughness_help %} {% from "_afm_help.html" import afm_help %} {% extends "base.html" %} {% from "_geometry_view.html" import geometry_view %} {% block title %}New grating{% endblock %} {% block body %}

New grating

Etched grating profiles with optional coating layers

Import AFM profile

Upload a two-column x/z scan and preprocess one period before using it as a profile grating.

Accepted formats: .csv, .tsv, .txt, and .dat. Use a text file with two numeric columns (x and z), separated by commas, tabs, semicolons, or spaces. A header row is optional.

{% if existing_afm_source_url %}

Stored AFM scan: {{ defaults.afm_source_filename or 'Download scan' }}. Choose a new file to replace it.

{% endif %}
{% if existing_afm_source_url %}{% endif %}

The AFM analysis uses the period from the Profile section below.

{{ afm_help('process', 'process AFM profile') }}
{% if form_error %}{% endif %} {% for material in materials %} {% endfor %}
Profile
Laminar fields
Sinusoidal fields
Blazed fields
Roughness model

Each layer's parameters describe its upper interface. RMS σ controls height variation; correlation length ξ controls its lateral scale. Blank σ means 0 nm; blank ξ means period / 10.

Debye–Waller applies an effective damping correction to efficiencies; geometry remains smooth.

Interfaces have independent random shapes. More periods and realizations increase simulation cost. Preview shows realization 1.

{% include "_substrate_fields.html" %} {% set substrate_rendered = true %} {% include "_stack_fields.html" %}

Live preview

{% if preview and preview.ok %}Ready{% else %}{{ preview.error if preview else "Preview unavailable" }}{% endif %}

Idle
{{ geometry_view("grating", bind="[data-afm-process-form], [data-grating-preview-form]", nominal=defaults.grating_type) }} {% if preview and preview.preview_url %} Live grating preview {% else %} {% endif %}

{{ (preview.warnings|default([]))|join(' ') if preview else '' }}

Random roughness interfaces and material map
{% endblock %}