The radsafer package was developed with these goals:
Provide functions that are commonly used in radiation safety
Provide easy access to data provided in the RadData package
Share some less commonly-used functions that may be of significant value to workers in instrumentation and modeling
Related functions are identified as members of these families:
A few functions stand alone.
This framework makes it a little easier to find the function you want - the help file for each function lists related functions.
Radsafer includes several functions to manage radioactive decay corrections:
dk_correct provides decay corrected activity or activity-dependent value, such as instrument response rate or dose rate. The computation is made either based on a single radionuclide, or based on user-provided half-life, with time unit. The differential time is either computed based on dates entered or time lapsed based on the time unit.
Obtain a correction factor for a source to be used today based on a
date2 to be the
default system date.
Use this function to correct for the value needed on dates it was
used. Let the function obtain the half-life from the ICRP Publication
107 decay data in the
RadData R package. In the example, we
have a disk source with an original count rate of 10000 cpm:
Reverse decay - find out what readings should have been in the past given today’s reading of 3000
Other decay functions answer the following questions:
How long does it take to decay something with a given activity, or how old is a sample if it has decayed from? dk_time
Given a percentage reduction in activity, how many half-lives have passed.dk_pct_to_num_half_life
Given two or more data points, estimate the half-life: half_life_2pt
Search by alpha, beta, photon or use the general screen option.
RN_search_phot_by_E allows screening based on energy,
half-life, and minimum probability. Also available are
limiting searches to radionuclides with emissions in an energy bin of
interest with additional filters for not having photons in other
specified energy bins. Results for all these search functions may be
Here’s a search for photon energy between 0.99 and 1.01 MeV, half-life between 13 and 15 minutes, and probability at least 1e-3
You can also plot a spectrum in one step, skipping the data save:
RN_index_screen function helps find a radionuclide
of interest based on decay mode, half-life, and total emission
In this example, we search for radionuclides decaying by spontaneous fission with half-lives between 6 months and 2 years.
Other radionuclides family functions:
Obtain a specific activity with RN_Spec_Act.
Find a potential radionuclide parent with RN_find_parent.
air_dens_cf Correct vented ion chamber readings based on difference in air pressure (readings in degrees Celsius and mm Hg):
Let’s try it out combined with the instrument reading:
Correct for geometry when reading a close neutron source. Example: neutron rem detector with a radius of 11 cm and source near surface:
Correct for a mismatch between the source calibration of a counting system and the item being measured. A significant factor in the counting efficiency is the solid angle from the source to the detector. You can also check for the impact of an item not being centered with the detector.
Example: You are counting an air sample with an active collection diameter of 45 mm, your detector has a radius of 25 mm and there is a gap between the two of 5 mm. (The function is based on radius, not diameter so be sure to divide the diameter by two.) The relative solid angle is:
An optional plot is available in 2D or 3D:
library(ggplot2) theme_update(# axis labels axis.title = element_text(size = 7), # tick labels axis.text = element_text(size = 5), # title title = element_text(size = 5)) (as_rel_solid_angle <- as.numeric(disk_to_disk_solid_angle(r.source = 45/2, gap = 20, r.detector = 12.5, runs = 1e4, plot.opt = "3d")))
#>  0.048591549 0.002156714
Continuing the example: the only calibration source you had available with the appropriate isotope has an active diameter of 20 mm. Is this a big deal? Let’s estimate the relative solid angle of the calibration, then take a ratio of the two.
Correct for the mismatch:
This makes sense - the air sample has particles originating outside the source radius, so more of them will be lost, thus an adjustment is needed for the activity measurement.
Scaler counts: obtain quick distributions for parameters of interest:
Rate meters: In the ratemeter simulation, readings are plotted once per second for a default time of 600 seconds. The meter starts with a reading of zero and builds up based on the time constant. Resolution uncertainty is established to express the uncertainty from reading an analog scale, including the instability of its readings. Many standard references identify the precision or resolution uncertainty of analog readings as half of the smallest increment. This should be considered the single coverage uncertainty for a very stable reading. When a reading is not very stable, evaluation of the reading fluctuation is evaluated in terms of numbers of scale increments covered by meter indication over a reasonable evaluation period. Example with default time constant:
To estimate time constant, use
Given a dose rate, dose allowed, and a safety margin (default = 20%),
calculate stay time with:
Given a set of radiation levels through varying thicknesses of material, compute the half-values, tenth-values, and homogeneity coefficients.
hvl(x = mm_Al, y = mR_h) #> thickness response mu hvl tvl hc #> 1 0 7.428 NA NA NA NA #> 2 1 6.272 0.1691614 4.097550 13.61177 0.9676121 #> 3 2 5.325 0.1636826 4.234704 14.06738 0.9810918 #> 4 3 4.535 0.1605876 4.316317 14.33850 0.9745802 #> 5 4 3.878 0.1565055 4.428899 14.71248 0.9984235 #> 6 5 3.317 0.1562588 4.435892 14.73571 NA
If you create MCNP inputs, these functions may be helpful:
mcnp_sdef_erg_line Obtain emission data from the
RadData package for use with the radiation transport code,
MCNP, when you want a “line” source from individual radionuclides. Use
mcnp_sdef_erg_hist when you have histogram data and
want to format it nicely for MCNP.
mcnp_mesh_bins This helps identify the x, y, or z parameter of a simple geometric mesh tally. Select a center of interest, the width of this center mesh, then minimum and maximum limits on the extent of the entire mesh. Repeat for the other dimensions.
mcnp_cone_angle This is just the square of the tangent of the angle in radians, but the argument used here is degree.
For MCNP outputs, plot the results of a tally with
energy bins. The fastest way to do this is with
Alternatively, if you want to get your data into R, first save it in
a text file and import it to R. (Base R provides methods with
read.table or you might prefer options from the
readxl packages.) Or you can copy and
paste your data using
mcnp_scan_save. You can then plot
mcnp_plot_out_spec (below) or design your own