bkgCorrect

fiducia.rawProcess.bkgCorrect(df, timesFrame)[source]

Give a Dante data frame containing measurement data and background shot data, remove the background from the data and return the corrected data as a dataframe. Note that the returned dataframe is different in a few ways from the input dataframe. First, the returned dataframe is assumed to have strings as column headers, whereas the returned dataframe will have integers (corresponding to dante channel number) as the column headers. In addition, the input dataframe will start indexing at some number above 0 (usually 18, due to the header length), whereas the returned dataframe is re-indexed to begin at 0.

A dataframe with corresponding time scales to df is also passed to this function for reindexing from strings to integers. This also acts as a placeholder in case it is necessary to interpolate values if the background shot and measurement shot timescales are not the same. Though this type of interpolation is not currently implemented.

Parameters
  • df (pandas.core.frame.DataFrame) – Dataframe of raw dante data. This should contain both the shot measurement and the shot background as columns. See readDanteData(). The columns in this dataframe are assumed to be strings.

  • timesFrame (pandas.core.frame.DataFrame) – Dataframe containing time axis corresponding to dante signals in df dataframe. See timesScope().

Returns

  • timesBkg (pandas.core.frame.DataFrame) – Returns a dataframe of times corresponding to dfCorrected signals. The columns in this dataframe are integers corresponding to Dante channel number.

  • dfCorrected (pandas.core.frame.DataFrame) – Returns a dataframe of background subtracted dante signals. The columns in this dataframe are integers corresponding to Dante channel number.

Notes

Examples