This module defines all functions that write simulation data to the disk or pre-process data before writing. normalise_fluence. Normalises fluence by number of photons run and size of each voxel. !Does not normalise by power! write_fluence. Write out fluence in either raw or nrrd format. Default is nrrd. write_detected_photons. Write out photons detected by detectors.
Changes should only be made here if there is a bug or new data types need to be written to disk (phase information) or new file format is needed.
write 3D array of float64's to .nrrd fileformat
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | array(:,:,:) |
array to be written to disk |
||
character(len=*), | intent(in) | :: | filename |
filename |
||
logical, | intent(in) | :: | overwrite |
overwrite flag |
||
type(toml_table), | intent(inout), | optional | :: | dict |
dictionary of metadata |
write 3D array of float32's to .nrrd fileformat
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(in) | :: | array(:,:,:) |
array to be written to disk |
||
character(len=*), | intent(in) | :: | filename |
filename |
||
logical, | intent(in) | :: | overwrite |
overwrite flag |
||
type(toml_table), | intent(inout), | optional | :: | dict |
dictionary of metadata |
write 3D array of float64s to disk as raw binary data
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | array(:,:,:) |
array to write to disk |
||
character(len=*), | intent(in) | :: | filename |
filename to save array as |
||
logical, | intent(in) | :: | overwrite |
overwrite flag |
write 3D array of float32's to disk as raw binary data
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(in) | :: | array(:,:,:) |
array to write to disk |
||
character(len=*), | intent(in) | :: | filename |
filename to save array as |
||
logical, | intent(in) | :: | overwrite |
overwrite flag |
Functional wrapper around inquire to check if file exits
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | file |
file to be checked |
If file exits, get numeral to append to filename
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | file |
file to be checked |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | toml_filename |
filename of toml file used in simulation |
||
character(len=*), | intent(in) | :: | filename |
name of checkpoint file to be saved |
||
integer, | intent(in) | :: | nphotons_run |
number of photons run up to checkpoint |
||
logical, | intent(in) | :: | overwrite |
flag which determines if file is to be overwritten or adjusted |
normalise fluence in the Lucy 1999 way
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(cart_grid), | intent(in) | :: | grid |
grid class |
||
real(kind=sp), | intent(inout) | :: | array(:,:,:) |
array to normalise |
||
integer, | intent(in) | :: | nphotons |
number of photons run |
write 3D array of float32's to .nrrd fileformat
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(in) | :: | array(:,:,:) |
array to be written to disk |
||
character(len=*), | intent(in) | :: | filename |
filename |
||
logical, | intent(in) | :: | overwrite |
overwrite flag |
||
type(toml_table), | intent(inout), | optional | :: | dict |
dictionary of metadata |
write 3D array of float32's to disk as raw binary data
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(in) | :: | array(:,:,:) |
array to write to disk |
||
character(len=*), | intent(in) | :: | filename |
filename to save array as |
||
logical, | intent(in) | :: | overwrite |
overwrite flag |
write 3D array of float64's to .nrrd fileformat
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | array(:,:,:) |
array to be written to disk |
||
character(len=*), | intent(in) | :: | filename |
filename |
||
logical, | intent(in) | :: | overwrite |
overwrite flag |
||
type(toml_table), | intent(inout), | optional | :: | dict |
dictionary of metadata |
write 3D array of float64s to disk as raw binary data
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | array(:,:,:) |
array to write to disk |
||
character(len=*), | intent(in) | :: | filename |
filename to save array as |
||
logical, | intent(in) | :: | overwrite |
overwrite flag |
routine automatically selects which way to write out results based upon file extension
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(in) | :: | array(:,:,:) |
array to write out |
||
character(len=*), | intent(in) | :: | filename |
filename to save array as |
||
type(settings_t), | intent(in) | :: | state |
simulation state |
||
type(toml_table), | intent(inout), | optional | :: | dict |
dictionary of metadata |
|
logical, | intent(in), | optional | :: | overwrite |
overwrite flag |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dect_array), | intent(in) | :: | dects(:) |
write out header information for .nrrd file format
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | u |
file handle |
||
integer, | intent(in) | :: | sizes(:) |
dimensions of data |
||
character(len=*), | intent(in) | :: | type |
data dtype |