MATLAB code for geometric cosmic-ray shielding calculations

Accompanies the following paper:

Balco G., 2014. Simplified computer code for estimating cosmic-ray shielding due to oddly shaped objects. Quaternary Geochronology, available online 1 Jan 2014. PDF of paper

Questions on this page: Greg Balco, balcs@bgc.org


Documentation:
Instructions for graphical user interface and MATLAB function documentation: PDF HTML

List of MATLAB functions:
Primary calculation functions:
generate_cosmic_rays.m Generates a random sample of cosmic ray incidence directions for Monte Carlo integration.
readstl.m Reads in a .stl text file containing a triangular facet representation of an object and returns the facets defined in a compact matrix form.
shielding_loop.m Performs Monte Carlo integration to compute shielding of the cosmic ray flux by an obstruction.
Functions related to the graphical user interface and/or used for plotting results:
check_position.m Plots a horizontal slice through a volume to aid in determining whether a sample location is within an object.
loadSamples.m Loads a .csv file containing sample information and creates a new window with sample information.
plotFacets.m Plots facets derived from a .stl file into a 3-d plot window.
plotSamples.m Reads sample data out of the 'samples' window and plots into a 3-d plot window.
shielding_control_window.m When called with no argument, this function initializes the graphical user interface for Monte Carlo integration of cosmic-ray shielding calculations. When called with a string argument, implements callbacks for the various GUI objects.
unpackHorizonFile.m Reads in a text file containing horizon information and returns a variable structure containing the information in the text file.
waterline.m Generates a horizontal ring (i.e., a "waterline") around a faceted volume at a given elevation.
Functions from other sources necessary for the above to run:
intersectLinePlane.m author : David Legland
INRA - TPV URPOI - BIA IMASTE
created the 17/02/2005.
skyline.m Part of the online exposure age calculators at hess.ess.washington.edu
Example data files:
gv01_everything.stl .stl format shape file describing precariously balanced rock and pedestal from Balco, Purvance, and Rood (2012).
gv2_samples.csv .csv format text file describing sample locations in same coordinate system as the shape file above.
Additional scripts that use the above functions to generate the figures in the paper:
CopyLalChenFig4.m This script generates Figure 4 of the present paper. It uses the Monte Carlo integration code to duplicate the analytical solutions for spherical boulders in Lal and Chen (2005).
create_upper_hemisphere.m Required for CopyLalChenFig4.m. Generates a shape model of a hemispherical boulder.
LalChenSphereSide.m Required for CopyLalChenFig4.m. Used in numerical integration of the equations in Lal and Chen.
LalChenSphereVert.m Required for CopyLalChenFig4.m. Used in numerical integration of the equations in Lal and Chen.
CopyDunneAttenuation.m This script generates Figure 5 of the present paper. It uses the Monte Carlo integration code to duplicate an analytical solution for variation in the surface production rate and subsurface attenuation length for spallogenic production caused by far-field topographic obstructions.
MakeSoilCoverFigure.m This script generates Figure 7 of the present paper. It uses the Monte Carlo integration code to generate shielding factors for the precariously balanced rock described by Balco, Purvance, and Rood (2011) both in its current geometry and partially or fully buried by regolith. Requires the shape model for this PBR, which is in the file gv01_everything.stl