pyextal.jaxGeo.io¶
Finding and loading a dataset: the .h5, the .dat it was built against.
Functions¶
|
Accepts a Windows path as well as a WSL one. |
|
The dataset file, given the file itself or the folder holding it. |
|
Number of output reflections in a |
|
Finds the |
Raises if the file lacks the |
|
|
The refinement inputs from a dataset file, spatially subsampled. |
Module Contents¶
- pyextal.jaxGeo.io.to_wsl_path(path)¶
Accepts a Windows path as well as a WSL one.
C:\Users\<user>\Box\...maps to/mnt/box/...(where Box is mounted under WSL) and any otherX:\...to/mnt/x/.... POSIX paths pass through unchanged.- Parameters:
path (str | Path) – The path as typed.
- Returns:
A path usable from WSL.
- Return type:
Path
- pyextal.jaxGeo.io.resolve_h5(path)¶
The dataset file, given the file itself or the folder holding it.
- Parameters:
path (Path) – A
.h5file, or a folder containing exactly one.- Returns:
The
.h5file.- Return type:
Path
- Raises:
SetupError – If
pathdoes not exist, or a folder holds no.h5or several.
- pyextal.jaxGeo.io._out_count(dat)¶
Number of output reflections in a
.dat’soutblock, or None.
- pyextal.jaxGeo.io.resolve_dat(h5, n_beams)¶
Finds the
.data dataset file was built against.In order: the
datrecorded in the file’s/pathsgroup (relative to the file’s folder, or to the recordedbase); otherwise the one.datbeside the file whoseoutblock lists exactlyn_beamsreflections – the experimental beam axis must match it one to one.- Parameters:
h5 (Path) – The dataset file.
n_beams (int) – Reflections on its experimental beam axis.
- Returns:
(Path, str)– the.datand how it was chosen.- Return type:
tuple
- Raises:
SetupError – If no single
.datqualifies.
- pyextal.jaxGeo.io.check_pre_refinement(h5)¶
Raises if the file lacks the
/pre_refinementgroup this needs.- Parameters:
h5 (Path) – The dataset file.
- Raises:
SetupError – With a message naming what the file holds instead.
- pyextal.jaxGeo.io.load_dataset(h5, subsample=1)¶
The refinement inputs from a dataset file, spatially subsampled.
- Parameters:
h5 (Path) – The dataset file.
subsample (int) – Take every Nth scan point in each direction.
- Returns:
(data, g_include).dataholdstilts(rows, cols, 3),experimental_dataandvariance(rows, cols, n_beams) and the pre-refinedgeometrydict;g_include(n_beams, 3) labels the experimental beam axis.- Return type:
tuple