File: layer.md

package info (click to toggle)
bornagain 23.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 103,956 kB
  • sloc: cpp: 423,131; python: 40,997; javascript: 11,167; awk: 630; sh: 356; ruby: 173; xml: 130; makefile: 45; ansic: 24
file content (38 lines) | stat: -rw-r--r-- 1,110 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
+++
title = "Layer"
weight = 36
+++

## Class Layer

A [Sample](/ref/sample/multilayer) and [LayerStack](/ref/sample/multilayer/stack) contain one or several instances
of class `Layer`.

##### Create an instance

Each instance is created using the constructor call
```python
layer_i = ba.Layer(material, thickness=0, roughness=nullptr)
```
Typically, the variable name will contain an index `i`.
By convention, the numbering starts with the top layer, typically `layer_1`.

For the first argument, see [Material](/ref/sample/material).

The optional second argument is the layer thickness in nm.
If it is omitted, then the default value of 0 indicates an infinite thickness;
this is to be used for the bottom or top layer,
or for the sole component of a single-layer sample.

##### Set properties

To add a [ParticleLayout](/ref/sample/multilayer/layout), use
```python
layer_i.addLayout(layout)
```
If there are several layouts, then their scattering intensities will be added incoherently.

To divide the layer into `n` slices for the reflectivity computation, use
```python
layer_i.setNumberOfSlices(n)
```