Simulates x-ray magnetic scattering
Project description
This package can be used to simulate magnetic scattering and Fourier transform holography from a structure.
Installation
magneticScattering can be installed through pip:
(.venv)$ pip install magneticScattering
Documentation
Comprehensive documentation with examples is available online at readthedocs.
Quickstart
To calculate the observed magnetic scattering from a system, three classes describing the experimental setup must first be specified, namely the:
Sample
Beam
Geometry
These classes are then passed to the Scatter class in order to perform the calculation. In the following sections, these parameters are described in more detail and examples are provided.
Sample
The Sample is initialized with the following parameters:
Sample(sample_length, scattering_factors, magnetic_configuration)
sample_length: size of the sample in meters as a scalar or a two-component vector in meters
scattering_factors: scattering factors list [f0, f1, f2]. These are the complex pre-factors corresponding to the charge, magnetic circular and magnetic linear scattering. The real part is the refractive index (or phase) and the imaginary part is the dissipation (or absorption)
structure: the magnetic configuration of the sample as a numpy array with shape (3, nx, ny) (charge component will be inferred) or (4, nx, ny) with the charge component at index 0
Beam
The Beam is initialized with the following parameters:
Beam(wavelength, beam_fwhm, polarization)
wavelength: wavelength of incident radiation in meters.
beam_fwhm: full width at half maximum of the beam as a scalar or a two-component vector in meters.
polarization: four-component polarization in the form of a Stokes vector.
Geometry
The Geometry is initialized with the following parameters:
Geometry(angle, detector_distance)
angle: The angle of incidence between the beam and the sample in degrees.
detector_distance: The distance between the sample and the detector in meters.
The geometry use here is such that the beam travels in the positive z-directions when angle_d = 0 and along the negative y-direction when angle_d = 90.
The sample plane is the x-y plane, such that the \(m_x\) and \(m_y\) components are in-plane, and \(m_z\) is out of plane.
Scatter
To compute the scattering pattern, call the Scatter class with the three classes from before as arguments:
Scatter(Sample, Beam, Geometry)
The intensity of the scattering can be obtained from Scatter.intensity or plotted directly using functions in the plot submodule. For example, for a labyrinthine structure
the full-view scattering pattern (left) can be used to isolate a region of interest (left, red rectangle) to calculate a higher resolution scattering. The difference between the scattering obtained from the two circular polarizations is shown on the right
References
van der Laan, G., “Theory from Soft X-ray resonant magnetic scattering of magnetic nano structures,” https://doi.org/10.1016/j.crhy.2007.06.004
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file magneticscattering-0.2.1.tar.gz.
File metadata
- Download URL: magneticscattering-0.2.1.tar.gz
- Upload date:
- Size: 158.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a450aa1a4fe3976c32c9777e02859e8d464c0e5784cca24b979c665adca7c49
|
|
| MD5 |
d645bebfce0ee5177aaad182cad8837f
|
|
| BLAKE2b-256 |
c85066731e09bee2fca4aa4bbb9e0936f452f60028d975d55fde14bb67648dbe
|
Provenance
The following attestation bundles were made for magneticscattering-0.2.1.tar.gz:
Publisher:
release.yml on apseros/magneticScattering
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
magneticscattering-0.2.1.tar.gz -
Subject digest:
4a450aa1a4fe3976c32c9777e02859e8d464c0e5784cca24b979c665adca7c49 - Sigstore transparency entry: 192765214
- Sigstore integration time:
-
Permalink:
apseros/magneticScattering@70970ae400eb087c195df8f91ba990a5b5f02bf6 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/apseros
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@70970ae400eb087c195df8f91ba990a5b5f02bf6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file magneticscattering-0.2.1-py3-none-any.whl.
File metadata
- Download URL: magneticscattering-0.2.1-py3-none-any.whl
- Upload date:
- Size: 157.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
900c160800f1f6ebecbf070fe3b9047713727ffce7c6bd677901154822064ef8
|
|
| MD5 |
c8f7b887e231e58ee8f0a91a5601bb01
|
|
| BLAKE2b-256 |
49529659144ca3f91893296c55fc22a0751b4bddfcbe23c2ea5398238df2d97c
|
Provenance
The following attestation bundles were made for magneticscattering-0.2.1-py3-none-any.whl:
Publisher:
release.yml on apseros/magneticScattering
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
magneticscattering-0.2.1-py3-none-any.whl -
Subject digest:
900c160800f1f6ebecbf070fe3b9047713727ffce7c6bd677901154822064ef8 - Sigstore transparency entry: 192765217
- Sigstore integration time:
-
Permalink:
apseros/magneticScattering@70970ae400eb087c195df8f91ba990a5b5f02bf6 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/apseros
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@70970ae400eb087c195df8f91ba990a5b5f02bf6 -
Trigger Event:
push
-
Statement type: