R/AT.SPC.spectrum.at.depth.step.R

Defines functions AT.SPC.spectrum.at.depth.step

Documented in AT.SPC.spectrum.at.depth.step

AT.SPC.spectrum.at.depth.step <- function(spc, depth.step)
{
    if(depth.step %in% unique(spc$depth.step)){
        ii     <- spc$depth.step == depth.step
        df     <- data.frame( E.MeV.u     = spc$E.MeV.u[ii],
                              particle.no = spc$particle.no[ii],
                              fluence.cm2 = spc$fluence[ii])
        #cat(paste("Returning", sum(ii), "entries in data frame.\n"))
        return(df)
    }else{
        cat("Depth step not found in data. Skipping.")
        return(NULL)
    }
}

Try the libamtrack package in your browser

Any scripts or data that you put into this service are public.

libamtrack documentation built on May 2, 2019, 4:55 p.m.