Skip to contents

A gaussian filter is fit to the surface measurements and residuals are calculated. The most extreme 0.25\ The result is called the raw signature of the bullet land.

Usage

cc_fit_gaussian(ccdata, span = 600)

Arguments

ccdata

The crosscut as returned from x3p_to_df

span

The size, in microns, of the smoothing window. Defaults to 600, which is 24\ 9mm land.

Value

a list of a data frame of the original bullet measurements extended by gaussian filtration, residuals, and two plots: a plot of the fit, and a plot of the bullet's land signature.

Examples

library(dplyr)
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union
ccdata <- data_frame(
  x = seq(0, 6000, 1),
  value = 10 - (3 - x / 1000)^2 + rnorm(length(x), sd = .25)
)
#> Warning: `data_frame()` was deprecated in tibble 1.1.0.
#>  Please use `tibble()` instead.
cc_fit_gaussian(ccdata = ccdata)
#> # A tibble: 6,001 × 7
#>        x value fitted raw_sig se    abs_resid chop 
#>    <dbl> <dbl>  <dbl>   <dbl> <lgl>     <dbl> <lgl>
#>  1     0 0.650   1.55  -0.901 NA        0.901 TRUE 
#>  2     1 1.07    1.55  -0.483 NA        0.483 FALSE
#>  3     2 0.403   1.56  -1.15  NA        1.15  TRUE 
#>  4     3 1.02    1.56  -0.541 NA        0.541 FALSE
#>  5     4 1.18    1.56  -0.381 NA        0.381 FALSE
#>  6     5 1.32    1.56  -0.245 NA        0.245 FALSE
#>  7     6 0.581   1.56  -0.984 NA        0.984 TRUE 
#>  8     7 0.980   1.57  -0.587 NA        0.587 FALSE
#>  9     8 0.987   1.57  -0.583 NA        0.583 FALSE
#> 10     9 0.983   1.57  -0.589 NA        0.589 FALSE
#> # ℹ 5,991 more rows