cut out first order
begin implementing a window function that smoothly goes to zero
i can't get planck taper window to work
implement tukey-window
subtract background and multiply with tukey window
apparently i can't just start a thread to process the image from each camera
i can't run parallel pylon acquisition

Unhandled memory fault at #x0.
   [Condition of type SB-SYS:MEMORY-FAULT-ERROR]

Restarts:
 0: [ABORT] Abort thread (#<THREAD RUNNING {1004BCC553}>)

Backtrace:
  0: (SB-SYS:MEMORY-FAULT-ERROR)
  1: ("foreign function: call_into_lisp")
  2: ("foreign function: post_signal_tramp")
  3: ("foreign function: #x7FFFEF86F111")
  4: ("foreign function: _ZN5Pylon19CInstantCameraArray14RetrieveResultEjRNS_14CGrabResultPtrENS_16ETimeoutHandlingE")
  5: ("foreign function: pylon_wrapper_grab_cdf")
  6: (PYLON::%GRAB-CDF #.(SB-SYS:INT-SAP #X7FFFF00380D0) 580 580 #.(SB-SYS:INT-SAP #X1011348010) #.(SB-SYS:INT-SAP #X7FFFD4DCFFF0) #.(SB-SYS:INT-SAP #X7FFFD4DCFFE8) #.(SB-SYS:INT-SAP #X7FFFD4DCFFE0) #.(SB-..
  7: (PYLON:GRAB-CDF #.(SB-SYS:INT-SAP #X7FFFF00380D0) #2A((#C(5.0d0 0.0d0) #C(28.0d0 0.0d0) #C(71.0d0 0.0d0) #C(18.0d0 0.0d0) #C(18.0d0 0.0d0) #C(37.0d0 0.0d0) ...) (#C(16.0d0 0.0d0) #C(20.0d0 0.0d0) #C(3..
  8: ((LAMBDA NIL :IN PYLON-TEST::CAPTURE-DARK-IMAGES))
  9: ((FLET #:WITHOUT-INTERRUPTS-BODY-1210 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
 10: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
 11: ((FLET #:WITHOUT-INTERRUPTS-BODY-645 :IN SB-THREAD::CALL-WITH-MUTEX))
 12: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {7FFFD4BCEC9B}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THR..
 13: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD RUNNING {1004BCC553}> #S(SB-THREAD:SEMAPHORE :NAME "Thread setup semaphore" :%COUNT 0 :WAITCOUNT 0 :MUTEX #<SB-THREAD:MUTEX (free) {10..
 14: ("foreign function: call_into_lisp")
 15: ("foreign function: new_thread_trampoline")
scan with step 100

(29 59 7 13 7 2014 6 NIL 0)

Number of samples:   175
Sample interval:     0.01 seconds
Total sampling time: 1.75 seconds
Number of cycles:    0
Sampled threads:
 #<SB-THREAD:THREAD "worker" RUNNING {101ADAD063}>

           Self        Total        Cumul
  Nr  Count     %  Count     %  Count     %    Calls  Function
------------------------------------------------------------------------
   1    151  86.3    151  86.3    151  86.3        -  "foreign function syscall"
   2      9   5.1      9   5.1    160  91.4        -  (FLET #:CLEANUP-FUN-586 :IN SB-THREAD::CALL-WITH-SYSTEM-MUTEX)
   3      6   3.4      6   3.4    166  94.9        -  "foreign function __nanosleep"
   4      1   0.6      3   1.7    167  95.4        -  ARDUINO-SERIAL-SBCL:SERIAL-RECV-LENGTH
   5      1   0.6      2   1.1    168  96.0        -  SB-IMPL::INPUT-CHAR/ASCII
   6      1   0.6      1   0.6    169  96.6        -  SB-IMPL::OUTPUT-BYTES/ASCII
   7      1   0.6      1   0.6    170  97.1        -  "foreign function ioctl"
   8      1   0.6      1   0.6    171  97.7        -  SB-IMPL::SPLIT-SECONDS-FOR-SLEEP
   9      1   0.6      1   0.6    172  98.3        -  SB-ALIEN-INTERNALS:MAKE-ALIEN-VALUE
  10      1   0.6      1   0.6    173  98.9        -  SB-ALIEN::ALIEN-TYPE-CLASS-OR-LOSE
  11      1   0.6      1   0.6    174  99.4        -  SB-KERNEL:TWO-ARG-<
  12      1   0.6      1   0.6    175 100.0        -  "foreign function __poll"
  13      0   0.0    175 100.0    175 100.0        -  RUN
  14      0   0.0    175 100.0    175 100.0        -  "Unknown component: #x101AECDF20"
  15      0   0.0    175 100.0    175 100.0        -  SB-EXT:CALL-WITH-TIMING
  16      0   0.0    175 100.0    175 100.0        -  SB-INT:SIMPLE-EVAL-IN-LEXENV
  17      0   0.0    175 100.0    175 100.0        -  EVAL
  18      0   0.0    175 100.0    175 100.0        -  (LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL)
  19      0   0.0    175 100.0    175 100.0        -  SWANK::CALL-WITH-RETRY-RESTART
  20      0   0.0    175 100.0    175 100.0        -  SWANK::CALL-WITH-BUFFER-SYNTAX
  21      0   0.0    175 100.0    175 100.0        -  SWANK:EVAL-FOR-EMACS
  22      0   0.0    175 100.0    175 100.0        -  (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD)
  23      0   0.0    175 100.0    175 100.0        -  SWANK-BACKEND::CALL-WITH-BREAK-HOOK
  24      0   0.0    175 100.0    175 100.0        -  (FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/martin/quicklisp/dists/quicklisp/software/slime-2.7/swank-sbcl.lisp")
  25      0   0.0    175 100.0    175 100.0        -  SWANK::CALL-WITH-BINDINGS
  26      0   0.0    175 100.0    175 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-1210 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  27      0   0.0    175 100.0    175 100.0        -  (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  28      0   0.0    175 100.0    175 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-645 :IN SB-THREAD::CALL-WITH-MUTEX)
  29      0   0.0    175 100.0    175 100.0        -  SB-THREAD::CALL-WITH-MUTEX
  30      0   0.0    175 100.0    175 100.0        -  SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE
  31      0   0.0    175 100.0    175 100.0        -  "foreign function call_into_lisp"
  32      0   0.0    175 100.0    175 100.0        -  "foreign function new_thread_trampoline"
  33      0   0.0    151  86.3    175 100.0        -  SB-THREAD::%%WAIT-FOR-MUTEX
  34      0   0.0    151  86.3    175 100.0        -  SB-THREAD::%WAIT-FOR-MUTEX
  35      0   0.0    151  86.3    175 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-1286 :IN SB-THREAD:JOIN-THREAD)
  36      0   0.0    151  86.3    175 100.0        -  SB-THREAD:JOIN-THREAD
  37      0   0.0     11   6.3    175 100.0        -  ARDUINO-SERIAL-SBCL:TALK-ARDUINO
  38      0   0.0      9   5.1    175 100.0        -  SB-THREAD::CALL-WITH-SYSTEM-MUTEX
  39      0   0.0      9   5.1    175 100.0        -  SB-THREAD:MAKE-THREAD
  40      0   0.0      4   2.3    175 100.0        -  SLEEP
  41      0   0.0      2   1.1    175 100.0        -  READ-CHAR
  42      0   0.0      2   1.1    175 100.0        -  ARDUINO-SERIAL-SBCL:READ-RESPONSE
  43      0   0.0      1   0.6    175 100.0        -  SB-IMPL::FD-SOUT
  44      0   0.0      1   0.6    175 100.0        -  SB-IMPL::%WRITE-STRING
  45      0   0.0      1   0.6    175 100.0        -  (LABELS SB-IMPL::HANDLE-IT :IN SB-KERNEL:OUTPUT-OBJECT)
  46      0   0.0      1   0.6    175 100.0        -  PRINC
  47      0   0.0      1   0.6    175 100.0        -  ARDUINO-SERIAL-SBCL::WRITE-ARDUINO
  48      0   0.0      1   0.6    175 100.0        -  SB-ALIEN-INTERNALS:ALIEN-SUBTYPE-P
  49      0   0.0      1   0.6    175 100.0        -  SB-POSIX::ALIEN-POINTER-TO-ANYTHING-OR-NIL
  50      0   0.0      1   0.6    175 100.0        -  SB-VM::GENERIC-+
  51      0   0.0      1   0.6    175 100.0        -  SB-IMPL::SYSREAD-MAY-BLOCK-P
  52      0   0.0      1   0.6    175 100.0        -  SB-IMPL::REFILL-INPUT-BUFFER
------------------------------------------------------------------------
          0   0.0                                     elsewhere
(4 2 8 13 7 2014 6 NIL 0)
Evaluation took:
  154.203 seconds of real time
  147.182000 seconds of total run time (142.802000 user, 4.380000 system)
  [ Run times consist of 2.421 seconds GC time, and 144.761 seconds non-GC time. ]
  95.45% CPU
  433,739,266,775 processor cycles
  104,967,253,856 bytes consed
second scan
(50 44 17 13 7 2014 6 NIL 0)

Number of samples:   187
Sample interval:     0.01 seconds
Total sampling time: 1.87 seconds
Number of cycles:    0
Sampled threads:
 #<SB-THREAD:THREAD "worker" RUNNING {1029CDCF53}>

           Self        Total        Cumul
  Nr  Count     %  Count     %  Count     %    Calls  Function
------------------------------------------------------------------------
   1    162  86.6    162  86.6    162  86.6        -  "foreign function syscall"
   2      9   4.8      9   4.8    171  91.4        -  "foreign function __nanosleep"
   3      7   3.7      7   3.7    178  95.2        -  (FLET #:CLEANUP-FUN-586 :IN SB-THREAD::CALL-WITH-SYSTEM-MUTEX)
   4      1   0.5      4   2.1    179  95.7        -  SLEEP
   5      1   0.5      1   0.5    180  96.3        -  (FLET #:CLEANUP-FUN-2067 :IN SB-IMPL::REFILL-INPUT-BUFFER)
   6      1   0.5      1   0.5    181  96.8        -  SB-IMPL::FD-SOUT
   7      1   0.5      1   0.5    182  97.3        -  SB-ALIEN-INTERNALS:MAKE-ALIEN-VALUE
   8      1   0.5      1   0.5    183  97.9        -  SB-UNIX:UNIX-SIMPLE-POLL
   9      1   0.5      1   0.5    184  98.4        -  "foreign function ioctl"
  10      1   0.5      1   0.5    185  98.9        -  (FLET #:CLEANUP-FUN-1300 :IN SB-THREAD:JOIN-THREAD)
  11      1   0.5      1   0.5    186  99.5        -  "foreign function __poll"
  12      1   0.5      1   0.5    187 100.0        -  "foreign function write"
  13      0   0.0    187 100.0    187 100.0        -  RUN
  14      0   0.0    187 100.0    187 100.0        -  "Unknown component: #x1029E1AE90"
  15      0   0.0    187 100.0    187 100.0        -  SB-EXT:CALL-WITH-TIMING
  16      0   0.0    187 100.0    187 100.0        -  SB-INT:SIMPLE-EVAL-IN-LEXENV
  17      0   0.0    187 100.0    187 100.0        -  EVAL
  18      0   0.0    187 100.0    187 100.0        -  (LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL)
  19      0   0.0    187 100.0    187 100.0        -  SWANK::CALL-WITH-RETRY-RESTART
  20      0   0.0    187 100.0    187 100.0        -  SWANK::CALL-WITH-BUFFER-SYNTAX
  21      0   0.0    187 100.0    187 100.0        -  SWANK:EVAL-FOR-EMACS
  22      0   0.0    187 100.0    187 100.0        -  (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD)
  23      0   0.0    187 100.0    187 100.0        -  SWANK-BACKEND::CALL-WITH-BREAK-HOOK
  24      0   0.0    187 100.0    187 100.0        -  (FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/martin/quicklisp/dists/quicklisp/software/slime-2.7/swank-sbcl.lisp")
  25      0   0.0    187 100.0    187 100.0        -  SWANK::CALL-WITH-BINDINGS
  26      0   0.0    187 100.0    187 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-1210 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  27      0   0.0    187 100.0    187 100.0        -  (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  28      0   0.0    187 100.0    187 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-645 :IN SB-THREAD::CALL-WITH-MUTEX)
  29      0   0.0    187 100.0    187 100.0        -  SB-THREAD::CALL-WITH-MUTEX
  30      0   0.0    187 100.0    187 100.0        -  SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE
  31      0   0.0    187 100.0    187 100.0        -  "foreign function call_into_lisp"
  32      0   0.0    187 100.0    187 100.0        -  "foreign function new_thread_trampoline"
  33      0   0.0    163  87.2    187 100.0        -  SB-THREAD:JOIN-THREAD
  34      0   0.0    162  86.6    187 100.0        -  SB-THREAD::%%WAIT-FOR-MUTEX
  35      0   0.0    162  86.6    187 100.0        -  SB-THREAD::%WAIT-FOR-MUTEX
  36      0   0.0    162  86.6    187 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-1286 :IN SB-THREAD:JOIN-THREAD)
  37      0   0.0     11   5.9    187 100.0        -  ARDUINO-SERIAL-SBCL:TALK-ARDUINO
  38      0   0.0      7   3.7    187 100.0        -  SB-THREAD::CALL-WITH-SYSTEM-MUTEX
  39      0   0.0      7   3.7    187 100.0        -  SB-THREAD:MAKE-THREAD
  40      0   0.0      3   1.6    187 100.0        -  SB-IMPL::REFILL-INPUT-BUFFER
  41      0   0.0      3   1.6    187 100.0        -  SB-IMPL::INPUT-CHAR/ASCII
  42      0   0.0      3   1.6    187 100.0        -  READ-CHAR
  43      0   0.0      3   1.6    187 100.0        -  ARDUINO-SERIAL-SBCL:READ-RESPONSE
  44      0   0.0      2   1.1    187 100.0        -  ARDUINO-SERIAL-SBCL::ENSURE-RESPONSE-BUFFER-CLEAR
  45      0   0.0      2   1.1    187 100.0        -  SB-IMPL::SYSREAD-MAY-BLOCK-P
  46      0   0.0      1   0.5    187 100.0        -  SB-IMPL::%WRITE-STRING
  47      0   0.0      1   0.5    187 100.0        -  (LABELS SB-IMPL::HANDLE-IT :IN SB-KERNEL:OUTPUT-OBJECT)
  48      0   0.0      1   0.5    187 100.0        -  PRINC
  49      0   0.0      1   0.5    187 100.0        -  ARDUINO-SERIAL-SBCL::WRITE-ARDUINO
  50      0   0.0      1   0.5    187 100.0        -  ARDUINO-SERIAL-SBCL:SERIAL-RECV-LENGTH
  51      0   0.0      1   0.5    187 100.0        -  SB-UNIX:UNIX-WRITE
  52      0   0.0      1   0.5    187 100.0        -  SB-IMPL::FLUSH-OUTPUT-BUFFER
  53      0   0.0      1   0.5    187 100.0        -  SB-IMPL::FINISH-FD-STREAM-OUTPUT
  54      0   0.0      1   0.5    187 100.0        -  FINISH-OUTPUT
------------------------------------------------------------------------
          0   0.0                                     elsewhere
(23 47 17 13 7 2014 6 NIL 0)
Evaluation took:
  152.947 seconds of real time
  145.713000 seconds of total run time (141.426000 user, 4.287000 system)
  [ Run times consist of 2.345 seconds GC time, and 143.368 seconds non-GC time. ]
  95.27% CPU
  430,209,088,260 processor cycles
  104,967,800,656 bytes consed
third scan

(12 3 18 13 7 2014
                                                        6 NIL 0)

Number of samples:   146
Sample interval:     0.01 seconds
Total sampling time: 1.4599999 seconds
Number of cycles:    0
Sampled threads:
 #<SB-THREAD:THREAD "worker" RUNNING {1059744333}>

           Self        Total        Cumul
  Nr  Count     %  Count     %  Count     %    Calls  Function
------------------------------------------------------------------------
   1    130  89.0    130  89.0    130  89.0        -  "foreign function syscall"
   2     11   7.5     11   7.5    141  96.6        -  "foreign function __nanosleep"
   3      2   1.4      2   1.4    143  97.9        -  "foreign function ioctl"
   4      1   0.7      1   0.7    144  98.6        -  SB-KERNEL:TWO-ARG-<
   5      1   0.7      1   0.7    145  99.3        -  ARDUINO-SERIAL-SBCL::WRITE-ARDUINO
   6      1   0.7      1   0.7    146 100.0        -  READ-CHAR
   7      0   0.0    146 100.0    146 100.0        -  RUN
   8      0   0.0    146 100.0    146 100.0        -  "Unknown component: #x1059891FD0"
   9      0   0.0    146 100.0    146 100.0        -  SB-EXT:CALL-WITH-TIMING
  10      0   0.0    146 100.0    146 100.0        -  SB-INT:SIMPLE-EVAL-IN-LEXENV
  11      0   0.0    146 100.0    146 100.0        -  EVAL
  12      0   0.0    146 100.0    146 100.0        -  (LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL)
  13      0   0.0    146 100.0    146 100.0        -  SWANK::CALL-WITH-RETRY-RESTART
  14      0   0.0    146 100.0    146 100.0        -  SWANK::CALL-WITH-BUFFER-SYNTAX
  15      0   0.0    146 100.0    146 100.0        -  SWANK:EVAL-FOR-EMACS
  16      0   0.0    146 100.0    146 100.0        -  (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD)
  17      0   0.0    146 100.0    146 100.0        -  SWANK-BACKEND::CALL-WITH-BREAK-HOOK
  18      0   0.0    146 100.0    146 100.0        -  (FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/martin/quicklisp/dists/quicklisp/software/slime-2.7/swank-sbcl.lisp")
  19      0   0.0    146 100.0    146 100.0        -  SWANK::CALL-WITH-BINDINGS
  20      0   0.0    146 100.0    146 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-1210 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  21      0   0.0    146 100.0    146 100.0        -  (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)
  22      0   0.0    146 100.0    146 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-645 :IN SB-THREAD::CALL-WITH-MUTEX)
  23      0   0.0    146 100.0    146 100.0        -  SB-THREAD::CALL-WITH-MUTEX
  24      0   0.0    146 100.0    146 100.0        -  SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE
  25      0   0.0    146 100.0    146 100.0        -  "foreign function call_into_lisp"
  26      0   0.0    146 100.0    146 100.0        -  "foreign function new_thread_trampoline"
  27      0   0.0    130  89.0    146 100.0        -  SB-THREAD::%%WAIT-FOR-MUTEX
  28      0   0.0    130  89.0    146 100.0        -  SB-THREAD::%WAIT-FOR-MUTEX
  29      0   0.0    130  89.0    146 100.0        -  (FLET #:WITHOUT-INTERRUPTS-BODY-1286 :IN SB-THREAD:JOIN-THREAD)
  30      0   0.0    130  89.0    146 100.0        -  SB-THREAD:JOIN-THREAD
  31      0   0.0      8   5.5    146 100.0        -  ARDUINO-SERIAL-SBCL:TALK-ARDUINO
  32      0   0.0      4   2.7    146 100.0        -  SLEEP
  33      0   0.0      1   0.7    146 100.0        -  ARDUINO-SERIAL-SBCL:READ-RESPONSE
------------------------------------------------------------------------
          0   0.0                                     elsewhere
(11 4 18 13 7 2014 6 NIL 0)
Evaluation took:
  59.124 seconds of real time
  49.065000 seconds of total run time (45.793000 user, 3.272000 system)
  [ Run times consist of 0.173 seconds GC time, and 48.892 seconds non-GC time. ]
  82.99% CPU
  166,303,597,053 processor cycles
  316,369,712 bytes consed