pymchelper.writers package#

Submodules#

pymchelper.writers.common module#

class pymchelper.writers.common.Converters(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: IntEnum

Available converters

excel = 6#
classmethod fromname(name)[source]#
classmethod fromnumber(number)[source]#
hdf = 9#
image = 3#
inspect = 8#
json = 10#
mcpl = 11#
plotdata = 1#
sparse = 7#
tripcube = 4#
tripddd = 5#
txt = 0#

pymchelper.writers.excel module#

class pymchelper.writers.excel.ExcelWriter(filename, options)[source]#

Bases: object

Supports writing XLS files (MS Excel 2003 format)

write(estimator: Estimator)[source]#

pymchelper.writers.fortranformatter module#

pymchelper.writers.fortranformatter.format_d(w, d, val)[source]#

TODO :param w: :param d: :param val: :return:

pymchelper.writers.fortranformatter.format_e(w, d, val)[source]#

TODO :param w: :param d: :param val: :return:

pymchelper.writers.hdf module#

class pymchelper.writers.hdf.HdfWriter(filename, options)[source]#

Bases: object

Supports writing HDF file format. HDF is designed to store large amounts of data organized in convenient way. One HDF file can handle many single- or multi-dimensional tables.

write(estimator: Estimator)[source]#

pymchelper.writers.inspector module#

class pymchelper.writers.inspector.Inspector(filename, options)[source]#

Bases: object

write(estimator: Estimator)[source]#

Print all keys and values from estimator structure

they include also a metadata read from binary output file

pymchelper.writers.json module#

class pymchelper.writers.json.JsonWriter(filename, options)[source]#

Bases: object

Supports writing JSON format. JSON format is a format accepted by yaptide project.

write(estimator: Estimator)[source]#

Writes estimator object to json file

pymchelper.writers.mcpl module#

class pymchelper.writers.mcpl.MCPLWriter(output_path: str, _)[source]#

Bases: Writer

MCPL data writer

write_single_page(page: Page, output_path: Path)[source]#

TODO

pymchelper.writers.plots module#

class pymchelper.writers.plots.ImageWriter(filename, options)[source]#

Bases: object

Writer responsible for creating PNG images using matplotlib library

default_colormap = 'gnuplot2'#
get_page_figure(page)[source]#

Calculate matplotlib figure object for a single page in estimator

write(estimator)[source]#

Go through all pages in estimator and save corresponding figure to an output file

class pymchelper.writers.plots.PlotAxis(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: IntEnum

x = 1#
y = 2#
z = 3#
class pymchelper.writers.plots.PlotDataWriter(output_path: str, _)[source]#

Bases: Writer

plot data writer

write_single_page(page: Page, output_path: Path)[source]#

TODO

pymchelper.writers.shieldhit module#

class pymchelper.writers.shieldhit.SHBinaryWriter(filename, options)[source]#

Bases: object

write(estimator)[source]#
class pymchelper.writers.shieldhit.TxtWriter(filename, options)[source]#

Bases: object

write(estimator: Estimator)[source]#

TODO

write_single_page(page, filename)[source]#

TODO

pymchelper.writers.sparse module#

class pymchelper.writers.sparse.SparseWriter(filename, options)[source]#

Bases: object

Supports writing sparse matrix format

write(estimator)[source]#

pymchelper.writers.trip98cube module#

class pymchelper.writers.trip98cube.TRiP98CubeWriter(filename, options)[source]#

Bases: object

write(estimator)[source]#

pymchelper.writers.trip98ddd module#

class pymchelper.writers.trip98ddd.DebuggingPlots(base_data)[source]#

Bases: object

Debugging plots, mostly needed to inspect if Gaussian function fitting was successful

base_data(zmax_cm, threshold, logy=False)[source]#
static fit_summary(fit_results)[source]#
map2d(zlog=False)[source]#
class pymchelper.writers.trip98ddd.FitResultCollection(n)[source]#

Bases: object

Fit results collection (along Z axis)

class pymchelper.writers.trip98ddd.FittingMethods[source]#

Bases: object

Functions describing Gaussian functions modelling lateral dose distributions

classmethod gauss2_MeV_g(x_cm, amp_MeV_cm_g, sigma1_cm, weight, sigma2_add_cm)[source]#
classmethod gauss2_MeV_g_1st(x_cm, amp_MeV_cm_g, sigma1_cm, weight, sigma2_add_cm)[source]#
classmethod gauss2_MeV_g_2nd(x_cm, amp_MeV_cm_g, sigma1_cm, weight, sigma2_add_cm)[source]#
classmethod gauss2_r_MeV_cm_g(x_cm, amp_MeV_cm_g, sigma1_cm, weight, sigma2_add_cm)[source]#
classmethod gauss_MeV_g(x_cm, amp_MeV_cm_g, sigma_cm)[source]#
classmethod gauss_r_MeV_cm_g(x_cm, amp_MeV_cm_g, sigma_cm)[source]#
class pymchelper.writers.trip98ddd.LateralDepthDoseProfile(r_cm_1d, z_cm_1d, dose_MeV_g_2d, dose_error_MeV_g_2d, r_step_cm=None, z_step_cm=None)[source]#

Bases: object

Base data for fitting

static cumulative_dose(dose_1d)[source]#
static cumulative_dose_left(cumsum)[source]#
class pymchelper.writers.trip98ddd.TRiP98DDDWriter(filename, options)[source]#

Bases: object

Writer for TRiP98 DDD files. File format is described here: http://bio.gsi.de/DOCS/TRiP98/PRO/DOCS/trip98fmtddd.html

Only liquid water target is supported now.

write(estimator)[source]#
write_single_page(estimator, page, filename)[source]#

pymchelper.writers.writer module#

class pymchelper.writers.writer.Writer(output_path: str)[source]#

Bases: object

Base class for all writers.

write(estimator: Estimator) int[source]#

Write the estimator data to a file.

abstract write_single_page(page, output_path: Path)[source]#

Write a single page to a file.

Module contents#