#!/usr/bin/env python3
"""
Unpolarized GISAS of magnetic cylinders.

The same magnetic cylinder sample as MagneticCylinders.py (cylinders
with y-magnetisation 1e6 A/m, substrate 15e-6 refractive index) is
simulated without polariser or analyser. Tests the matrix computation
path for an unpolarized beam on a magnetic sample.
"""
import bornagain as ba
from bornagain import ba_plot as bp, deg, nm, R3


def get_sample():
    vacuum = ba.Vacuum()
    substrate_color = (0.28, 0.57, 0.82)
    substrate_mat = ba.RefractiveMaterial("Substrate", substrate_color, 15e-6, 0)
    particle_color = (0.25, 0.65, 0.35)
    particle_mat = ba.RefractiveMaterial(
        "MagParticle2", particle_color, 5e-6, 0, R3(0, 1e6, 0))

    ff = ba.Cylinder(5*nm, 5*nm)
    particle = ba.Particle(particle_mat, ff)

    vacuum_layer = ba.Layer(vacuum)
    vacuum_layer.deposit2D(ba.Dilute2D(0.001, particle))
    substrate_layer = ba.Layer(substrate_mat)

    sample = ba.Sample()
    sample.addLayer(vacuum_layer)
    sample.addLayer(substrate_layer)
    return sample


<%= include_partial("template/sim/gisas_standard_wide.py") -%>


<%= include_partial("template/main/runsim_unitaspect.py",
    "ba.showSample3D(sample, sample_size=120*nm, seed=0)") -%>
