pyextal.hdf5io.crystal¶
The crystal .dat a dataset was built against, embedded in the file.
The Fortran engine reads a .dat from disk, and the right one is not always
beside the .h5: pre-refinement and refinement often use different beam
sets of the same crystal. So each stage stores the text of the .dat it
used, as a string dataset crystal_dat (attrs name, sha1):
/crystal_datwritten by save_raw/pre_refinement/crystal_datwritten by save_pre_refinement/refinement/run_NNN/crystal_datwritten by save_refinement
locate_dat finds one, writing embedded text to a short temporary path (the Fortran reader takes paths under ~120 characters).
Attributes¶
Functions¶
|
Embeds a |
|
|
|
Writes embedded |
|
Number of output reflections in a |
|
Experimental beam count recorded in an open file, or None. |
|
|
|
The embedded |
|
Finds the |
|
The path of locate_dat's choice. |
Module Contents¶
- pyextal.hdf5io.crystal.DATASET = 'crystal_dat'¶
- pyextal.hdf5io.crystal.store_dat(group, dat_path)¶
Embeds a
.datfile’s text in an open HDF5 group, replacing any copy.- Parameters:
group (h5py.Group) – Open, writable group (or the file itself).
dat_path (path-like) – The
.dat.
- pyextal.hdf5io.crystal.read_dat(group)¶
(name, text)of the.datembedded in an open group, or None.
- pyextal.hdf5io.crystal.materialize_dat(name, text)¶
Writes embedded
.dattext to a short temporary path and returns it.
- pyextal.hdf5io.crystal.out_count(text)¶
Number of output reflections in a
.dat’soutblock, or None.
- pyextal.hdf5io.crystal._n_beams(f)¶
Experimental beam count recorded in an open file, or None.
- pyextal.hdf5io.crystal._run_key(run)¶
- pyextal.hdf5io.crystal.embedded_dat(h5, run=None, n_beams=None, stage=None)¶
The embedded
.datlocate_dat would pick, or None.Args and order as in locate_dat, without its on-disk fallbacks.
- Returns:
(Path, str).- Return type:
tuple or None
- pyextal.hdf5io.crystal.locate_dat(h5, run=None, n_beams=None, stage=None)¶
Finds the
.datfor a dataset file, and says how it was chosen.In order: the copy embedded in refinement
run; the one embedded forstage(‘pre_refinement’); the root copy; thedatnamed in a legacy/pathsgroup; the one.datbeside the file whoseoutblock listsn_beamsreflections. File-level candidates (all but the run’s own copy) must listn_beamsreflections when that is known, since pre-refinement and refinement can use different beam sets.n_beamsdefaults to the file’s experimental beam count.- Parameters:
h5 (path-like) – The dataset file.
run (str or int, optional) – Refinement run key (‘run_003’) or number.
n_beams (int, optional) – Reflections the
.datmust output.stage (str, optional) – Also look in this group’s embedded copy.
- Returns:
(Path, str).- Return type:
tuple
- Raises:
FileNotFoundError – If nothing qualifies.
- pyextal.hdf5io.crystal.dat_for(h5, run=None, n_beams=None, stage=None)¶
The path of locate_dat’s choice.