Index: /trunk/doc/ipptools/.cvsignore
===================================================================
--- /trunk/doc/ipptools/.cvsignore	(revision 6002)
+++ /trunk/doc/ipptools/.cvsignore	(revision 6003)
@@ -1,2 +1,1 @@
-*.log *.dvi *.aux *.toc *.log *.out *.lof *.tbr *.tbd
-pstask.pdf
+*.log *.dvi *.aux *.toc *.log *.out *.lof *.tbr *.tbd *.pdf
Index: /trunk/doc/ipptools/scripts/copy.pro
===================================================================
--- /trunk/doc/ipptools/scripts/copy.pro	(revision 6003)
+++ /trunk/doc/ipptools/scripts/copy.pro	(revision 6003)
@@ -0,0 +1,137 @@
+
+# identify the images ready for copy 
+task	       new.images
+  command      new.images
+  host         -
+  stderr       /data/logfiles/new.images.log
+
+  periods      -poll 1
+  periods      -exec 30
+  periods      -timeout 2
+
+  # success
+  task.exit    0
+    push new.images $stdout
+    $new.image.failure = 0
+  end
+
+  # locked list
+  task.exit    1
+    echo       "new.images: exec failure"
+    $new.image.failure ++
+  end
+
+  # default exit status
+  task.exit    -
+    echo       "new.images: unknown exit status: $EXIT"
+    $new.image.failure ++
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "new.images: timeout"
+    $new.image.failure ++
+  end
+end
+
+# copy specific images from the summit
+task           copy.images
+
+  # these define task properties which are fixed
+
+  period       -exec 2
+  period       -poll 1
+  period       -timeout 50
+
+  # these commands are executed at the start of a new task
+  task.exec
+    local        RemoteName
+    local        FileID
+    local        Host
+
+    queuesize  NewImages -var N
+    if ($N > 0) break
+    if ($network == 0) break
+    if ($filesystem == 1) break
+
+    pop NewImages -var line
+    list tmp -split $line
+    $RemoteName = $tmp:0
+    $FileID     = $tmp:1
+    $Host       = $tmp:2
+    $Ntry       = $tmp:3
+
+    stderr       /data/logfiles/copy/$FileID.log
+    stdout       -queue $FileIDlog
+
+    echo $TaskID
+    echo $TaskName
+    spawn copy.images $RemoteName $FileID $Host -host $Host
+  end
+
+  # success
+  task.exit      0
+    $new.image.failure --
+  end
+
+  # summmit connection failed
+  task.exit      1
+    echo         "copy.images: copy failed $RemoteName $FileID"
+    push         NewImages "$RemoteName $FileID $Host 0"
+    $copy.image.failure ++
+  end
+
+  # target disk full
+  task.exit      2
+    echo         "copy.images: disk full"
+    push         NewImages "$RemoteName $FileID $Host 0"
+    $copy.image.failure ++
+  end
+
+  # file not found
+  task.exit      3
+    echo         "copy.images: missing file"
+    # send a message to OTIS?
+  end
+
+  # task timed out
+  task.exit      timeout
+    echo        "copy.images: timeout"
+    push        NewImages "$RemoteName $FileID $Host 0"
+    $copy.image.failure ++
+  end
+end
+
+# identify the images ready for copy 
+TASK	       new.images
+  COMMAND      new.images
+  HOST         -
+  STDERR       /data/logfiles/new.images.log
+  STDOUT       $stdout
+  EXEC_PERIOD  30
+  POLL_PERIOD  1
+
+  # success
+  EXIT         0
+    STDOUT     @new.images
+    $new.image.failure = 0
+  END
+
+  # locked list
+  EXIT         1
+    MESSAGE    "new.images: exec failure"
+    $new.image.failure ++
+  END
+
+  # default exit status
+  EXIT         -
+    MESSAGE    "new.images: unknown exit status: $EXIT"
+    $new.image.failure ++
+  END
+
+  # operation times out?
+  TIMEOUT      2
+    MESSAGE    "new.images: timeout"
+    $new.image.failure ++
+  END
+END
Index: /trunk/doc/ipptools/scripts/notes.txt
===================================================================
--- /trunk/doc/ipptools/scripts/notes.txt	(revision 6003)
+++ /trunk/doc/ipptools/scripts/notes.txt	(revision 6003)
@@ -0,0 +1,181 @@
+
+data types:
+  @data : queue
+  $data : system variable
+  
+commands
+  MESSAGE : send message to system log
+  STDOUT  : push task stdout on queue or file
+  STDERR  : push task stderr on queue or file
+
+
+TASK properties:
+  EXEC_PERIOD : seconds between attempts
+  POLL_PERIOD : seconds between checks of task status
+  TIMEOUT     : seconds before task must complete
+  HOST        : machine for controller execution
+  
+  ARG.N       : command and arguments  
+
+  STDIN       : QUEUE source for stdin
+  STDOUT      : QUEUE sink for stdout
+
+  PRE_EXEC    : conditions for execution
+END  
+
+QUEUE 3 new.images
+
+TASK	       new.images
+  COMMAND      new.images
+  HOST         -
+  STDERR       /data/logfiles/new.images.log
+  EXEC_PERIOD  30
+  POLL_PERIOD  1
+
+  # success
+  EXIT         0
+    STDOUT     @new.images
+    ZERO       new.image.failure
+  END
+
+  # locked list
+  EXIT         1
+    MESSAGE    "new.images: exec failure"
+    INCR       new.image.failure
+  END
+
+  # default exit status
+  EXIT         -
+    MESSAGE    "new.images: unknown exit status: $EXIT"
+    INCR       new.image.failure
+  END
+
+  # operation times out?
+  TIMEOUT      2
+    MESSAGE    "new.images: timeout"
+    INCR       new.image.failure
+  END
+END
+
+TASK           copy.images
+  COMMAND      copy.images $RemoteName $FileID $Host
+  HOST         $Host
+  STDERR       /data/logfiles/copy/$file.ID.log
+  EXEC_PERIOD  2
+
+  # pre-exec condition
+  EXEC_TEST
+    REQUIRE @new.images > 0
+    REQUIRE $network    == 1
+    REQUIRE $filesystem == 1
+    PERFORM $RemoteName = @new.images[0]
+    PERFORM $FileID     = @new.images[1]
+    PERFORM $Host       = @new.images[2]
+  END
+
+  # success
+  EXIT         0
+    STDOUT     @new.images
+    $new.image.failure = 0
+  END
+
+  # locked list
+  EXIT         1
+    MESSAGE    "new.images: exec failure"
+    $new.image.failure ++
+  END
+
+  TIMEOUT      30
+    MESSAGE    "new.images: timeout"
+    $new.image.failure ++
+  END
+END
+
+TASK      phase1
+  INPUT   @science.mosaics  # (fileID)
+  ARG.0   phase1
+  ARG.1   INPUT[0]
+  STDIN   @NULL
+  STDOUT  @NULL
+  STDERR  $log/phase1/%s.log INPUT[0]
+  TIMEOUT 10
+  PERIOD  10
+  FAILURE @foo
+END
+
+TASK      test.phase2
+  ARG.0   test.phase2 
+  STDOUT  @science.chips # (hostname) (filename) (mosaicID)
+END
+
+TASK      run.phase2
+  INPUT   @science.chips
+  ARG.0   phase2
+  ARG.1   $INPUT[1]
+  ARG.2   $INPUT[2]
+  HOST    $INPUT[0]
+  TIMEOUT 40
+  PERIOD  20
+END
+
+TASK      test.phase3
+  ARG.0   test.phase3 
+  STDOUT  @phase3.mosaics # (mosaicID)
+END
+
+TASK      run.phase3
+  INPUT   @phase3.mosaics
+  ARG.0   phase3
+  ARG.1   $INPUT[1]
+  ARG.2   $INPUT[2]
+  HOST    $INPUT[0]
+  TIMEOUT 40
+  PERIOD  20
+END
+
+
+
+# example IPP functions
+
+# steps to find and copy a single image from the summit
+
+  - identify image to be copied
+    - local resource (table or file) contains a list of 
+      (remote.filename) (file.ID)
+    - local process generates list from OTIS sources   
+    - (remote.filename) : user@hostname:/full/path/filename.fits
+    - (file.ID) : GPC-01.34.20041112-200110o.raw
+    - (chip) : 34
+    * pop entry from list?
+    * read entry from list & flag?
+
+    - file.ID options:
+      - CAMERA.CHIP.SEQUENCE.TYPE.VERSION
+      * GPC-01.34.20041112-200110o.raw
+      * GPC-01.34.20041112-200110b.raw
+      * MC.13.670123o.raw
+      * MC.13.670123o.flt
+      * MC.MF.670123o.flt
+
+  - determine file.ID for remote file
+    - provided with input list
+
+  - determine primary host for image
+    - based on chip
+    - provided with input list
+
+  - create new storage object with instance on target host
+    - instance = new.object (file.ID) -host (host)
+  - on target host, copy remote.file to instance
+    @host: cp (remote.name) instance
+
+  - if copy fails:	    
+    - put back in queue?
+
+  - add new chip to metadata database raw chips
+  - add new mosaic to metadata database science frames
+
+
+
+exec @host copy.image (remote.name) (file.ID) (host)
+
Index: /trunk/doc/ipptools/scripts/science.notes.txt
===================================================================
--- /trunk/doc/ipptools/scripts/science.notes.txt	(revision 6003)
+++ /trunk/doc/ipptools/scripts/science.notes.txt	(revision 6003)
@@ -0,0 +1,68 @@
+
+TASK           test.phase1
+  COMMAND      test.phase1
+  HOST         -
+  STDERR       log
+  EXEC_PERIOD  30
+  POLL_PERIOD  1
+
+  # success
+  EXIT         0
+    STDOUT     @science.mosaics
+  END
+
+  # locked list
+  EXIT         1
+    MESSAGE    "new.images: exec failure"
+    $new.image.failure ++
+  END
+
+  # operation times out?
+  TIMEOUT      10
+    MESSAGE    "db search failed"
+  END
+END
+
+TASK           phase1
+  REQUIRE      @science.mosaics > 0
+  PERFORM      $line       = POP (@science.mosaics)
+  PERFORM      $ExposureID = $line[0]
+
+  COMMAND      phase1 $ExposureID
+  STDERR       $log/phase1/$ExposureID.log
+  EXEC_PERIOD  10
+
+  # success
+  EXIT         0
+    STDOUT     @science.chips
+  END
+
+  TIMEOUT      10
+    MESSAGE    "phase1: timeout $ExposureID"
+    $phase1.failure ++
+  END
+
+END
+
+TASK           test.phase2
+
+TASK           phase2
+  REQUIRE      @science.chips > 0
+  PERFORM      $line       = POP (@science.mosaics)
+  PERFORM      $ = $line[0]
+
+  COMMAND      phase1 $ExposureID
+  STDERR       $log/phase1/$ExposureID.log
+  EXEC_PERIOD  10
+
+  # success
+  EXIT         0
+    STDOUT     @science.chips
+  END
+
+  TIMEOUT      10
+    MESSAGE    "phase1: timeout $ExposureID"
+    $phase1.failure ++
+  END
+
+END
