ETFScan
ETFScan is a Python package for handling and manipulating ETF files, including the ability to convert Nexus files into ETF format and to concatenate scans.
Features
- Convert Nexus files to ETF using the
create_etfscript. - Concatenate ETF scans or their subparts using the functionality in
etfscan.etf.
Installation
To create a virtual environment and install the package, follow these steps:
-
Create a virtual environment:
python3 -m venv venv source venv/bin/activate
-
To install the package, run:
pip install .
Usage
Convert Nexus to ETF
To produce an ETF directory, use the create_etf command. From bliss files:
create_etf --bliss_file /data/visitor/md1290/bm18/20231102/RAW_DATA/2.195um_SH1_ROIs/HA2000_2.195um_SH1_ROI-05_nose-turbin_0000/HA2000_2.195um_SH1_ROI-05_nose-turbin_0000_0001/HA2000_2.195um_SH1_ROI-05_nose-turbin_0000_0001.h5 --target_name test
or from nexus :
create_etf --nexus_file /some/directory/HA2000_2.195um_SH1_ROI-05_nose-turbin_0000_0001.nx --target_name test2
Example: Concatenating ETF scans
An example of how to concatenate ETF scans using the library can be found in the etf.py module. We use the class ETFFile which manipulate etf elements ( projections.h5, flats.h5`, .. etceter). Here's a simplified example:
from etfscan import ETFFile
# Load two ETF files
etf1 = ETFFile('test.etf/projections.h5')
etf2 = ETFFile('test2.etf/projections.h5')
# Concatenate them
combined_etf = ETFFile.join(etf1, etf2)
# Save the result
ETFFile.save(combined_etf, 'combined_output')
Script Options for create_etf.py
The following options are available for the nx2etf.py script:
--bliss_file (optional)
Description: A BLISS master file. One and only one of --bliss_file, --nexus_file, or --etf_projections_dir must be provided.
Type: String (str)
--nexus_file (optional)
Description: A Nexus file produced by NX Tomomill. One and only one of --bliss_file, --nexus_file, or --etf_projections_dir must be provided.
Type: String (str)
--etf_projections_dir (optional)
Description: The projections will be taken from the projections.h5 file inside this directory. Must be inside an ETF directory. One and only one of --bliss_file, --nexus_file, or --etf_projections_dir must be provided.
Type: String (str)
--darks_flats_dir (optional)
Description: A directory containing a Nexus file produced by NX Tomomill. This directory will be searched to associate darks/flats with the Nexus file if --nexus_file is provided.
Type: String (str)
--etf_dark_dir (optional)
Description: The darks will be taken from the dark.h5 file inside this directory. Must be inside an ETF directory.
Type: String (str)
--etf_flats_dir (optional)
Description: The flats will be taken from the flats.h5 file inside this directory. Must be inside an ETF directory.
Type: String (str)
--entry_name (optional)
Description: The entry name to use (default: entry0000).
Type: String (str)
--target_dir (optional)
Description: The path where the resulting ETF will be written. Defaults to the current working directory.
Type: String (str)
--target_name (optional, required if --etf_projections_dir is used)
Description: The name for the output ETF file. Defaults to the Nexus or BLISS filename if provided. Mandatory if --etf_projections_dir is used.
Type: String (str)
--median_dark (flag)
Description: Use the median instead of the average for darks. Only applies if the darks come from Nexus.
Type: Flag (no value required)
--median_flat (flag)
Description: Use the median instead of the average for flats. Only applies if the flats come from Nexus.
Type: Flag (no value required)
--double_flats_file (optional)
Description: The double flats file.
Type: String (str)
--diffusion_correction_file (optional)
Description: The diffusion correction file.
Type: String (str)
--distortion_correction_file (optional)
Description: The detector real positions map.
Type: String (str)
--weight_map_file (optional)
Description: The weight map file.
Type: String (str)
For further details, check the source code in module etfscan.
Metadata
Release files for etfscan 24.9.30
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| etfscan-24.9.30.tar.gz | 8.4 kB | Without provenance | Details for etfscan-24.9.30.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| etfscan-24.9.30-py3-none-any.whl | Python 3 | none | any | Details for etfscan-24.9.30-py3-none-any.whl |
Total release size: 18.1 kB
Release files / etfscan-24.9.30.tar.gz
| Download URL | etfscan-24.9.30.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36b0883c116ee3c56021014198f0c6a2627cc365523ded491c59cc679f6e1a2e
|
|
BLAKE2b-256 checksum How to use checksums |
0eb748926d66d41050fad196fd64b885659afa461baa766669636e9ad6757fd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9
|
Release files / etfscan-24.9.30-py3-none-any.whl
| Download URL | etfscan-24.9.30-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5413ab7b3932451755222063c5710ccdb18dc18c2f67c27c3a7c4c9259871ef7
|
|
BLAKE2b-256 checksum How to use checksums |
94e5c1d2d608679338e83fc4c8a9de1e6f2ccb63109dde1f16d61a2a5522dae5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9
|
Security for etfscan 24.9.30
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.