# Advanced scanning

MC Grating's advanced features since 2016: scanning any valid combination of structure parameters from a data table or equations, Advanced Output columns computed by formulas, and Interdependent Parameters such as the Littrow condition — what each does and where it is documented.

Canonical: https://mcgrating.com/features/advanced-scanning.html


The built-in scans cover wavelength, angle, period and thickness. Advanced scanning lets you scan anything else, from a table or from equations, and add computed columns to the output.

## Three features, one menu

Introduced in the [2016-05-06](https://mcgrating.com/changelog.html#v2016-05-06) release together with the x64 version, and refined through 2017, the Advanced Options menu adds a text section to the project structure that the user edits under rules given in its own comments. Formulas are interpreted with the muParser library.

- **[Advanced Scanning](https://mcgrating.com/docs/common/advanced-scanning.html)** — a one-dimensional scan driven by a data table, or a one- or two-dimensional scan driven by equations. Column names refer to structure parameters; a column whose name starts with an underscore is used but not written out. The [hexagonal-grating example](https://mcgrating.com/try-examples.html#hexagonal-filling-factor) scans a filling factor this way, a parameter no standard scan offers.
- **[Advanced Output](https://mcgrating.com/docs/common/advanced-output.html)** — extra output columns computed by equations from the diffraction-order values and the scanning argument; the shipped example adds a column with the difference between the power balance and unity.
- **[Interdependent Parameters](https://mcgrating.com/docs/common/interdependent-parameters.html)** — parameters defined by formulas of other parameters, with three Littrow samples built in, so that a scan can hold the Littrow condition or any other relation while one parameter varies.

## What it cannot do

In the words of the site's history: restrictions only apply to the parameters whose values alter the position of other parameters in the text structure (row and column indices). Everything else that has a value in the structure can be scanned.

## Later additions

The [2020-12-18](https://mcgrating.com/changelog.html#v2020-12-18) release let Modal Collinear and Modal Conical scan the thicknesses of two different layers in two dimensions directly, which earlier needed advanced scanning; the [2022-12-08](https://mcgrating.com/changelog.html#v2022-12-08) release fixed the order of formulas in Advanced Scanning, and [2026-05-25](https://mcgrating.com/changelog.html#v2026-05-25) a bug that stopped advanced output working after a structure file was reloaded. Results of advanced scans are written to the text table and, since 2021, to [JSON](https://mcgrating.com/features/json-output.html).

Advanced Options are a Full-edition feature: the Light edition computes diffraction efficiencies only.
