3.12 Reversing Data
Sometimes a core section goes in the scanner backwards! If this has happened, the functions below simply re-map the position
and depth
data for the radiograph, the optical image and the xrf data. These functions can either be called at the same time as the data itself (for example in a plot), or used to over-write the original data itself.
# for xrf data
<- function(xrf = itrax_import()){
reverse_xrf %>%
xrf mutate(depth = rev(depth),
position = rev(position)) %>%
arrange(position) %>%
return()
}
# for images
<- function(image = itrax_image()){
reverse_image <- image[dim(image)[1]:1, , ]
image row.names(image) <- rev(row.names(image))
return(image)
}
# for radiographs
<- function(image = itrax_radiograph()){
reverse_radio <- image[dim(image)[1]:1, ]
image row.names(image) <- rev(row.names(image))
return(image)
}