niess
Table of Contents
Installation
pip install niess
License
niess is distributed under the terms of the BSD-3-Clause license.
Motivation
This package is intended to hold information about the Neutron Insruments of the European Spallation Source for use in defining Monte Carlo ray-tracing simulations, file-layout information for use by the ESS file-writers, and other yet-undefined uses; in a use-agnostic approach.
The information required about an instrument for McStas and NeXusStructure is
similar but not identical -- the latter attempts to hold all information needed to
produce a valid NeXus file, which requires geometry information inspired by the
McCode implementation used by McStas.
The two uses each have their own vocabulary, and the vocabulary used here is more
closely in line with that of McCode. The basic building block of the two uses
is the Comp in McCode and the NXclass in NeXus; here the term 'component' is
used to refer to such a building block.
Since there are sometimes slight differences between the 'same' Comp and NXclass
in how equivalent information is stored, niess is intended to be component-aware as
a single translation between the two is not possible globally.
Rather than attempting to store one implementation or the other, niess components
are an independent low-level representation of the properties of a component.
This representation can be written as a dictionary with pre-defined keys, and
it is intended that serializing to and deserializing from such a representation can be
used to provide calibrated instrument information to McStas and NeXusStructure.
Use
niess describes an instrument once, as calibration data, and emits it as a McStas
instrument, ESS NeXus Structure JSON, or CAD geometry:
from mccode_antlr import Flavor
from mccode_antlr.assembler import Assembler
from niess.bifrost import Primary, Tank
from niess.bifrost.parameters import primary_parameters, tank_parameters
from niess.nexus import to_nexus_structure
from niess.nexus.bifrost import BIFROST_REGISTRY
assembler = Assembler('bifrost', flavor=Flavor.MCSTAS)
Primary.from_calibration(primary_parameters()).to_mccode(assembler)
Tank.from_calibration(tank_parameters()).to_mccode(assembler, 'sample_origin')
structure = to_nexus_structure(
assembler.instrument, origin='sample_origin', registry=BIFROST_REGISTRY,
)
Full documentation, including how to translate an existing McStas .instr into a
niess submodule and how to write your own NeXus translators, is at
https://mcdotstar.github.io/niess/.
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 niess-0.5.0.tar.gz.
File metadata
- Download URL: niess-0.5.0.tar.gz
- Upload date:
- Size: 384.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f132bba22add9f05b819b055af7c9604d3eb4dd49e499e77fb85558f1caddd88
|
|
| MD5 |
c33f83e546eb435541e6d2c7de9dd517
|
|
| BLAKE2b-256 |
511b91c88329cf9181308a8ac38c9e94a451f5dcb4cef464e4e07124bd14a20f
|
Provenance
The following attestation bundles were made for niess-0.5.0.tar.gz:
Publisher:
build-and-publish.yml on mcdotstar/niess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
niess-0.5.0.tar.gz -
Subject digest:
f132bba22add9f05b819b055af7c9604d3eb4dd49e499e77fb85558f1caddd88 - Sigstore transparency entry: 2517688643
- Sigstore integration time:
-
Permalink:
mcdotstar/niess@0979a887e06012bcb718388e314a51314ff7ed28 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/mcdotstar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@0979a887e06012bcb718388e314a51314ff7ed28 -
Trigger Event:
release
-
Statement type:
File details
Details for the file niess-0.5.0-py3-none-any.whl.
File metadata
- Download URL: niess-0.5.0-py3-none-any.whl
- Upload date:
- Size: 128.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53db69f26ff37c155c08e47617b3b8d739d21b767d6babf6c21c29e052b248fe
|
|
| MD5 |
77ab39e76c7e1ecb96e572f4874d14b4
|
|
| BLAKE2b-256 |
db02a681e288686eca96bbbfd14e24183d10c72d16cd8221335dae5c77fd559c
|
Provenance
The following attestation bundles were made for niess-0.5.0-py3-none-any.whl:
Publisher:
build-and-publish.yml on mcdotstar/niess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
niess-0.5.0-py3-none-any.whl -
Subject digest:
53db69f26ff37c155c08e47617b3b8d739d21b767d6babf6c21c29e052b248fe - Sigstore transparency entry: 2517688974
- Sigstore integration time:
-
Permalink:
mcdotstar/niess@0979a887e06012bcb718388e314a51314ff7ed28 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/mcdotstar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@0979a887e06012bcb718388e314a51314ff7ed28 -
Trigger Event:
release
-
Statement type: