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

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% of 2500 microns; approximately the same size as a 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.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
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.931   1.53  -0.595 NA        0.595 FALSE
#>  2     1 0.777   1.53  -0.751 NA        0.751 FALSE
#>  3     2 0.568   1.53  -0.962 NA        0.962 TRUE 
#>  4     3 0.961   1.53  -0.572 NA        0.572 FALSE
#>  5     4 1.07    1.53  -0.462 NA        0.462 FALSE
#>  6     5 0.740   1.54  -0.797 NA        0.797 FALSE
#>  7     6 0.939   1.54  -0.600 NA        0.600 FALSE
#>  8     7 0.739   1.54  -0.803 NA        0.803 TRUE 
#>  9     8 1.05    1.54  -0.491 NA        0.491 FALSE
#> 10     9 0.946   1.55  -0.600 NA        0.600 FALSE
#> # … with 5,991 more rows