diff --git a/Device/Beam/Beam.h b/Device/Beam/Beam.h index 0407e4ea581d209dd741b286550f52bb2240442a..f588984562128b24d9c12c8fb84b8e06a0716d02 100644 --- a/Device/Beam/Beam.h +++ b/Device/Beam/Beam.h @@ -41,10 +41,6 @@ public: static Beam horizontalBeam(); //... Setters: - void setIntensity(double intensity); - void setWavelength(double wavelength); - void setInclination(double alpha); - void setAzimuthalAngle(double value); void setFootprintFactor(const IFootprintFactor& shape_factor); void setPolarization(R3 polarization); @@ -56,6 +52,12 @@ public: return "Beam"; } + //... Setters: + void setIntensity(double intensity); + void setWavelength(double wavelength); + void setInclination(double alpha); + void setAzimuthalAngle(double value); + std::vector<const INode*> nodeChildren() const override; //... Getters diff --git a/devtools/code/hugo-shortcode-usage.py b/devtools/code/hugo-shortcode-usage.py new file mode 100755 index 0000000000000000000000000000000000000000..50aff8de6e0f7893e4e94b20f607969195bbc784 --- /dev/null +++ b/devtools/code/hugo-shortcode-usage.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +# run over `fmd` + +import edtools as et +import os, re, sys + +flist = os.listdir('/G/sw/ba/hugo/layouts/shortcodes') +smap = {} +for fname in flist: + smap[fname.split('.')[0]] = 0 + +def user_edit(fn, t): + + for sn in smap.keys(): + for m in re.finditer(r'\W'+sn+r'\W', t): + smap[sn] += 1 + + return t + +et.ed_argfiles(user_edit) + +for sn, count in sorted(smap.items()): + print(f'{sn} used {count} times') diff --git a/hugo/content/py/instr/beam/_index.md b/hugo/content/py/instr/beam/_index.md index 784870eb190e675fd1dbcfeb85ebe62f8a6078eb..0beb95d8b15775aea4bb70951d846841c0b4e47e 100644 --- a/hugo/content/py/instr/beam/_index.md +++ b/hugo/content/py/instr/beam/_index.md @@ -5,4 +5,26 @@ weight = 20 ## Beam model +The incident beam must be specified for scattering simulations with 2D detector +(SAS and GISAS). +For other simulations, the beam is set internally according to the +given [scan](../scan) model. + +To create a beam, use +```python +beam = ba.InBeam(intensity, wavelength, alpha, phi=0) +``` +For the wavelenth, use unit multiplier `*nm` or `*angstrom`. +For the glancing angle $\alpha\_\text{i}$, use unit multiplier `*deg`. +The azimuthal angle $\varphi\_\text{i}$ can be omitted, +as in most applications the default value 0 is pertinent. + +After creation of a beam, special properties can be set with +```python +beam.setFootprintFactor(footprint) +beam.setPolarization(polarization) +``` +For the arguments, see [footprint](footprint) and [polarization](../polarized). + + {{% children %}} diff --git a/hugo/content/py/sample/multilayer.md b/hugo/content/py/sample/multilayer.md index dfd6ba195527505081ca4f02eb5b2b20d3c1b18d..370f425c9e7238f289a2c2329dfaf81c4483cd19 100644 --- a/hugo/content/py/sample/multilayer.md +++ b/hugo/content/py/sample/multilayer.md @@ -9,8 +9,7 @@ weight = 35 The ***Define materials*** stance defines four materials in terms of their scattering length density (SLD). The arguments of the constructor-like global function -[MaterialBySLD]({{% ref-api "group__materials" %}}) -are `name`, `real_sld`, `imag_sld`. +MaterialBySLD are `name`, `real_sld`, `imag_sld`. Both `real_sld` and `imag_sld` are in units of inverse square angstroms. SLD values for a wide variety of materials can be found on https://sld-calculator.appspot.com diff --git a/hugo/layouts/shortcodes/collapse.html b/hugo/layouts/shortcodes/collapse.html deleted file mode 100644 index ef41f9a8775e58d2eae982c4d77641301c0ba61e..0000000000000000000000000000000000000000 --- a/hugo/layouts/shortcodes/collapse.html +++ /dev/null @@ -1,14 +0,0 @@ - -{{- $title := .Get "title" -}} -{{- $id := .Get "id" -}} - -<p> -<a class="btn btn-light" data-toggle="collapse" href="#{{ $id }}" role="button" aria-expanded="false" aria-controls="{{ $id }}"> -{{ $title }} -</a> -<div class="collapse" id="{{ $id }}"> - <div class="card card-body"> - {{.Inner}} - </div> -</div> -</p> diff --git a/hugo/layouts/shortcodes/readfile.html b/hugo/layouts/shortcodes/readfile.html deleted file mode 100644 index 6860b0f1115584776917124eda0539f412709881..0000000000000000000000000000000000000000 --- a/hugo/layouts/shortcodes/readfile.html +++ /dev/null @@ -1,6 +0,0 @@ -{{$file := .Get "file"}} -{{- if eq (.Get "markdown") "true" -}} -{{- $file | readFile | markdownify -}} -{{- else -}} -{{ $file | readFile | safeHTML }} -{{- end -}} diff --git a/hugo/layouts/shortcodes/ref-api.html b/hugo/layouts/shortcodes/ref-api.html deleted file mode 100644 index cfec9169fc4852fded2e7a74c761125c1988e40e..0000000000000000000000000000000000000000 --- a/hugo/layouts/shortcodes/ref-api.html +++ /dev/null @@ -1 +0,0 @@ -{{.Site.Params.url_userapi}}/{{ .Get 0}}.html diff --git a/hugo/layouts/shortcodes/ref-manual.html b/hugo/layouts/shortcodes/ref-manual.html deleted file mode 100644 index d4ae99a1ffe0bfa5ba476feb8222236761561a79..0000000000000000000000000000000000000000 --- a/hugo/layouts/shortcodes/ref-manual.html +++ /dev/null @@ -1 +0,0 @@ -{{.Site.Params.url_doc}}/PhysicsManual.pdf diff --git a/hugo/layouts/shortcodes/ref-tarball.html b/hugo/layouts/shortcodes/ref-tarball.html deleted file mode 100644 index cd2026cab7bc756160a399c8ca4a8f135422406c..0000000000000000000000000000000000000000 --- a/hugo/layouts/shortcodes/ref-tarball.html +++ /dev/null @@ -1 +0,0 @@ -{{.Site.Params.url_exe}}/BornAgain-{{.Site.Params.version_mmp}}.tar.gz diff --git a/hugo/layouts/shortcodes/toc.html b/hugo/layouts/shortcodes/toc.html deleted file mode 100644 index 3303672a5d1b90c46d08c6af2d5406dc9f74a66e..0000000000000000000000000000000000000000 --- a/hugo/layouts/shortcodes/toc.html +++ /dev/null @@ -1 +0,0 @@ -{{ .Page.TableOfContents}}