Output files
outputs
RADDOSE-3D's output files, written as the Java writes them.
A script that reads RADDOSE-3D's output reads the port's unchanged: the same
files under the same names, the same columns in the same order, and numbers
printed by the same rules -- see :mod:pyraddose_3d._java_format for why
those are not Python's. With the default prefix the files are:
output-Summary.txt
The human-readable summary. RADDOSE-3D also prints it to the console.
output-Summary.csv
The same per-wedge numbers as a table.
output-DoseState.csv
x,y,z,dose,fluence,elastic for every voxel inside the crystal, at
the end of the run.
output-DoseState.R
An R script that draws dose contours of the final state.
output-RDE.csv, output-DWDs.csv
One row per image: relative diffraction efficiency, and the
diffraction-weighted dose with its resolution-dependent RDE.
output-VoxelDose.csv, output-VoxelFluences.csv
Every voxel's dose and fluence in every image of the last wedge. These
need per-image fields, so they are written only for a simulation run
with record_images=True.
A MicroED run writes two files of its own instead, under the fixed names
MicroED.java gives them: outputMicroED.CSV, one row of results, and
outputMicroED_slices.csv, the dose slice by slice.
Each file mirrors one Java class, Output<Name>, and the notes on each
function say where it copies a quirk rather than fixing it. Lines always end
in \n: the Java writes its platform separator in some places and \n
in others, so on Windows its files have mixed endings.
final_dose_state
final_dose_state(
simulation: Simulation,
) -> dict[str, np.ndarray]
The crystal at the end of the run, as DoseState.csv lists it.
Parameters:
-
simulation(Simulation) –From :func:
pyraddose_3d.solve.simulate.
Returns:
-
dict[str, ndarray]–coordinates(N, 3)in micrometres, anddose,fluenceandelastic(N,), for the N voxels inside the crystal in the Java'si, j, korder.
Notes
The Java accumulates fluence and elastic yield on the crystal across every wedge, as it does dose, whereas the port's exposure resets them per wedge -- so they are summed here.
voxel_images
voxel_images(
simulation: Simulation,
) -> dict[str, np.ndarray]
Per-image dose and fluence over the last wedge, as the Java lists them.
Parameters:
-
simulation(Simulation) –From :func:
pyraddose_3d.solve.simulatewithrecord_images=True.
Returns:
-
dict[str, ndarray]–coordinates(N, 3), anddoseandfluence(A, N)for the A images of the last wedge.
Notes
Only the last wedge, because OutputVoxelDose keeps the last wedge it
was shown. A voxel's dose in an image is zero unless it was exposed in
that image: the Java builds a fresh array per image and fills only the
voxels it observes, so an unexposed voxel reads zero, not its dose so far.
image_series
image_series(
simulation: Simulation,
) -> dict[str, np.ndarray]
One row per image of every wedge, as DWDs.csv and RDE.csv.
Parameters:
-
simulation(Simulation) –From :func:
pyraddose_3d.solve.simulatewithrecord_images=True.
Returns:
-
dict[str, ndarray]–wedgeandimage(both from 1),anglein degrees,dwdin MGy,volumeexposed in cubic micrometres,rde(A, 5)in the Java's order[max_res, 1A, 2A, 3A, 4A], and forRDE.csvrde_angle,weightedandminimum.
Notes
weighted is the fluence-weighted mean of the decay model's
efficiency over exposed voxels, and minimum its running minimum --
reset per wedge, not per image. RDE.csv writes an image with no
exposed voxels as zeros throughout, its angle included.
dose_state_csv
dose_state_csv(simulation: Simulation) -> str
OutputFinalDoseStateCSV: the final state of every crystal voxel.
No header. One line per voxel inside the crystal, x,y,z,dose,fluence,
elastic, each printed as a Java float.
dose_state_r
dose_state_r(
simulation: Simulation,
generated: datetime | None = None,
) -> str
OutputFinalDoseStateR: an R script drawing the final dose.
Parameters:
-
simulation(Simulation) –From :func:
pyraddose_3d.solve.simulate. -
generated(datetime, default:None) –Time stamped in the header. Defaults to now, as in the Java.
Returns:
-
str–The script. It needs R's
rglandmisc3dpackages, and holds the whole voxel grid -- voxels outside the crystal as0-- in R's column-major order.
voxel_dose_csv
voxel_dose_csv(simulation: Simulation) -> str
OutputVoxelDose: every voxel's dose in every image of the last wedge.
voxel_fluences_csv
voxel_fluences_csv(simulation: Simulation) -> str
OutputVoxelFluences: every voxel's fluence, likewise.
dwds_csv
dwds_csv(simulation: Simulation) -> str
OutputDWDs: the diffraction-weighted dose after each image.
The RDE columns are written 1, 2, 3 and 4 Angstrom first and the wedge's maximum resolution last, though the Java computes them the other way round.
rde_csv
rde_csv(simulation: Simulation) -> str
OutputRDECSV: the relative diffraction efficiency of each image.
summary_csv
summary_csv(simulation: Simulation) -> str
OutputSummaryCSV: the per-wedge summary as a table.
The header's missing space after "Last DWD," is the Java's.
crystal_description
crystal_description(simulation: Simulation) -> str
Crystal.crystalInfo: shape, size and voxel size.
The size is the bounding box of the crystal after its P and L rotations, so a 20 x 16 um cuboid rotated 45 degrees reports 25 x 25. A sphere's diameter is the extent of its polyhedral approximation, slightly under the diameter asked for.
decay_description
decay_description(crystal: Crystal) -> str
The decay model's toString.
beam_description
beam_description(beam: XrayBeam) -> str
The beam's getDescription, newline included.
The flux is the one asked for, before any container attenuates it.
BeamTophat concatenates raw doubles, so it reads 2.0E12 where
the Gaussian reads 2.0e+12.
wedge_description
wedge_description(wedge: Wedge) -> str
Wedge.wedgeProperties: exposure, angles and any translation.
Angles go through radians and back, and translations through degrees and back, because the Java stores them that way.
coefficients_description
coefficients_description(simulation: Simulation) -> str
The composition's toString: coefficients at the beam energy.
dose_histogram
dose_histogram(doses: ndarray) -> list[float]
Histogram's normalised counts of the doses above zero.
Eleven bins: below 0.1 MGy, nine equal bins up to 30, and 30 upwards.
The bin index is truncated toward zero, as the Java's (int) cast.
summary_text
summary_text(simulation: Simulation) -> str
OutputSummaryText: what RADDOSE-3D prints and saves as Summary.txt.
The 95% threshold label is longer than the 42-character column it is padded to, and the Java lets it overflow; so does this.
write_outputs
write_outputs(
simulation: Simulation, prefix: str = "output-"
) -> list[Path]
Write every file RADDOSE-3D writes by default.
Parameters:
-
simulation(Simulation) –From :func:
pyraddose_3d.solve.simulate. Run it withrecord_images=Truefor the per-image files; without, they are skipped. -
prefix(str, default:'output-') –Prepended to each file name, as RADDOSE-3D's
--prefix; it may include a directory, which must exist.
Returns:
-
list[Path]–The files written.
microed_csv
microed_csv(result: MicroEDResult) -> str
MicroED.WriterFile: outputMicroED.CSV, a header and one row.
microed_slices_csv
microed_slices_csv(result: MicroEDResult) -> str
outputMicroED_slices.csv: each slice's dose, by where it starts.
microed_report
microed_report(result: MicroEDResult) -> str
What MicroED.CalculateEM prints to the console.
write_microed_outputs
write_microed_outputs(
result: MicroEDResult, directory: str | Path = "."
) -> list[Path]
Write the two files a MicroED run writes.
Parameters:
-
result(MicroEDResult) –From :func:
pyraddose_3d.solve.microed. -
directory(str | Path, default:'.') –Where to write them, under the fixed names RADDOSE-3D uses. It must exist.
Returns:
-
list[Path]–The files written.
monte_carlo_csv
monte_carlo_csv(runs: Sequence[SimpleRun]) -> str
WriterFileMCsimple: outputMC.CSV, a row per run.
monte_carlo_xfel_csv
monte_carlo_xfel_csv(runs: Sequence[SimpleRun]) -> str
WriterFile: outputXFEL.CSV, which the Monte Carlo writes too.
monte_carlo_ions_csv
monte_carlo_ions_csv(run: SimpleRun) -> str
WriteElements: outputIonsPerAtom.CSV, for one run.
RADDOSE-3D rewrites it every run, so its file holds the last run's.
The elements come in atomic-number order, as since RADDOSE-3D #56: they
came in a HashMap's bucket order.
monte_carlo_report
monte_carlo_report(run: SimpleRun) -> str
What processDose prints for one run: its doses.
The simple Monte Carlo's own doses, or in GOS mode the GOS model's. The XFEL subprogram prints its doses, cut off in time, and more.
write_monte_carlo_outputs
write_monte_carlo_outputs(
runs: Sequence[SimpleRun], directory: str | Path = "."
) -> list[Path]
Write the files a Monte Carlo run writes.
The simple Monte Carlo writes three; GOS mode and the XFEL subprogram,
all but outputMC.CSV.
Parameters:
-
runs(Sequence[SimpleRun]) –From :func:
pyraddose_3d.solve.monte_carlo. -
directory(str | Path, default:'.') –Where to write them, under the fixed names RADDOSE-3D uses. It must exist.
Returns:
-
list[Path]–The files written.