anchor.diff:              |> List.map (fun x -> 
                   let corrcoeff = cwtDataOfCoor x yCoor xCoor paddedData
                   corrcoeff)
  -
           //searches for the index of the wavelet in marrList with the highest score (representing the best matching waveletfunction).
           let indexOfBestScale = 
               let foldedIntensities=
  
positive.code:             else arrayOfMaxima.[i] <- 0.
          arrayOfMaxima,cWTArray
      
      ///gives maximaarray (checked with x neigbours) * CWT trace of maximal correlation
      let collectMaxima rickerarray neighbourPoints (paddedTrace:float[]) = 
          let numberOfFrames = paddedTrace.Length - (2 * 3000)
          let arr = Array.zeroCreate numberOfFrames
          let arrCurve = Array.zeroCreate numberOfFrames
          let maximaArray =
              rickerarray
              |> Array.map (fun x ->  fst (findLocalMaxima2D paddedTrace x neighbourPoints))
              |> fun x -> x |> JaggedArray.transpose
              |> Array.map (fun x -> x |> Array.max)
          let curveArray =
              rickerarray
              |> Array.map (fun x ->  snd (findLocalMaxima2D paddedTrace x neighbourPoints))
              |> fun x -> x |> JaggedArray.transpose
              |> Array.map (fun x -> x |> Array.max)
  
  
negative.code:             for a = 0 to 2*offset do
                  for b = 0 to 2*offset do
                      acc <- ((marr.Values).[a,b] * ((paddedframe).[((x+offsetpadding)+(a-offset)),((y+offsetpadding)+(b-offset))] |> float) )::acc
              acc 
              |> List.sum 
              |> fun x -> x / (sqrt (Math.Abs marr.Scale)) //CONSTANT ENERGY times 1/(sqrt |scale|)
          let result =
              [|0..(Seq.length paddedData) - 1|]       
              |> Array.map (fun fr -> 
                  C3DWTatPositionAndFrame marr (paddedData |> Seq.item fr) y x)
          result
      
      ///calculates the correlations value at a specified coordinate
      let inline getCorrelationAtCoor borderpadding (marr: Marr.MarrWavelet) y x (paddedData:seq<'a[,]>)=
          ///calculates the wavelet transformation at position 'x,y' with MarrWavelet 'marr' 
          let C3DWTatPositionAndFrame (paddedframe:'a[,]) y x = 
              let offset = marr.PadAreaRadius
              Array2D.init (2*offset) (2*offset) (fun a b -> 
                  let waveletvalue = (marr.Values).[a,b] 
                  let datavalue = float paddedframe.[((x+borderpadding)+(a-offset)),((y+borderpadding)+(b-offset))]
                  waveletvalue * datavalue)
              |> Array2D.toLongColumnArray 
              |> Array.sum
              |> fun x -> x / (sqrt (Math.Abs marr.Scale))
             
          let result =
              Array.init (Seq.length paddedData) (fun fr -> C3DWTatPositionAndFrame (paddedData |> Seq.item fr) y x)
          result
  
      [<Obsolete("Do not use anymore. Switch to getTraceOfBestCorrelation instead.")>]
      let inline findTraceOfBestCoor marrList (paddedData:seq<'a[,]>) (coor:float*float) =
          let yCoor = (fst coor) |> Core.Operators.round |> int
          let xCoor = (snd coor) |> Core.Operators.round |> int 
  