Index: /trunk/Ohana/etc/distributions.txt
===================================================================
--- /trunk/Ohana/etc/distributions.txt	(revision 3391)
+++ /trunk/Ohana/etc/distributions.txt	(revision 3392)
@@ -3,4 +3,8 @@
 DISTRIBUTION elixir-config 1.1
  USE config-1-1    config
+END
+
+DISTRIBUTION elixir-config 1.2
+ USE config-1-2    config
 END
 
@@ -33,4 +37,34 @@
  USE libohana-1-1    libohana
  USE libfits-1-1     libfits
+END
+
+# complete elixir distribution
+DISTRIBUTION elixir-ohana 1.2
+
+ USE base
+
+ USE addrefs-1-0     addrefs
+ USE addspphot-1-0   addspphot
+ USE addstar-1-0     addstar
+ USE delstar-1-0     delstar
+ USE elixir-1-1	     elixir
+ USE gastro-1-0	     gastro
+ USE gcompare-1-0    gcompare
+ USE gophot-1-0	     gophot
+ USE imclean-1-0     imclean
+ USE imregister-1-1  imregister
+ USE kapa-1-0	     kapa
+ USE kii-1-1	     kii
+ USE misc-1-0	     misc
+ USE nightd-1-0	     nightd
+ USE opihi-2-1	     opihi.v2
+ USE perl-1-0	     perl
+ USE relphot-1-0     relphot
+ USE shell-1-0	     shell
+ USE tcl-1-0	     tcl
+
+ USE libdummy-1-0    libdummy
+ USE libohana-1-2    libohana
+ USE libfits-1-2     libfits
 END
 
Index: /trunk/Ohana/etc/mkdist
===================================================================
--- /trunk/Ohana/etc/mkdist	(revision 3391)
+++ /trunk/Ohana/etc/mkdist	(revision 3392)
@@ -56,5 +56,9 @@
 }
 
-&vsystem ("mv ohana $group-$version");
+if ($group eq "elixir-config") {
+    &vsystem ("mv config $group-$version");
+} else {
+    &vsystem ("mv ohana $group-$version");
+}
 &vsystem ("rm -r `find $group-$version -name CVS`");
 &vsystem ("tar cvzf $group-$version.tgz  $group-$version");
Index: /trunk/Ohana/src/addstar/doc/Changes.txt
===================================================================
--- /trunk/Ohana/src/addstar/doc/Changes.txt	(revision 3392)
+++ /trunk/Ohana/src/addstar/doc/Changes.txt	(revision 3392)
@@ -0,0 +1,3 @@
+
+2005.02.24 : I am adding the mosaic two-level astrometry information to the Image table.
+
Index: /trunk/Ohana/src/addstar/doc/notes.txt
===================================================================
--- /trunk/Ohana/src/addstar/doc/notes.txt	(revision 3392)
+++ /trunk/Ohana/src/addstar/doc/notes.txt	(revision 3392)
@@ -0,0 +1,41 @@
+
+2005.03.07 : notes related to new version of addstar
+
+- USNO seems to work fine now:
+
+  addstar -region 9.0 12.0 9.0 12.0 -cat usno -p USNO_RED
+  addstar -region 9.0 12.0 9.0 12.0 -cat usno -p USNO_BLUE
+
+- 2MASS seems to work as well:
+
+  addstar -region 3.0 12.0 12.0 14.0 -cat 2mass -p 2MASS_J
+  addstar -region 3.0 12.0 12.0 14.0 -cat 2mass -p 2MASS_H
+  addstar -region 3.0 12.0 12.0 14.0 -cat 2mass -p 2MASS_K
+
+- both of these are somewhat inefficient since they need to search
+  through the (larger) USNO/2MASS data files for each output ptolemy
+  region file.
+
+- GSC seems to work fine now:
+
+  addstar -region 3.0 12.0 12.0 14.0 -cat gsc 
+  (photcode is not needed here since there is only one)
+
+- images seems to work fine now
+
+- general concerns:
+
+  - RA 0,360 boundary is likely to have problems, especially with
+    region selection
+  - mosaic astrometry concepts still need to be added.
+
+  - average magnitudes are being set incorrectly in addstar (not
+    taking account of the zero-points).  I don't really want to apply
+    the colors here, but I need to do something, perhaps?
+
+    one option is to only apply the correction for the first
+    measurement of an object, unlike the way astrometry works
+    currently.  both of these should be updated based on
+    relphot/uniphot and eqiuvalent relastro/uniastro independently
+    from the addstar step.
+
Index: /trunk/Ohana/src/mosastro/doc/astrom.txt
===================================================================
--- /trunk/Ohana/src/mosastro/doc/astrom.txt	(revision 3392)
+++ /trunk/Ohana/src/mosastro/doc/astrom.txt	(revision 3392)
@@ -0,0 +1,99 @@
+mosaic astrometry keywords
+
+terms to model:
+
+boresite + projection
+Ro, Do, Theta, PS
+CTYPE, CRVAL, CRPIX, CD1_1
+
+distortion 
+A(i,j), D(i,j)
+WLi_j
+WMi_j
+
+chips
+WXi_j
+WYi_j
+
+-- these are not general since they don't allow for more than 2 dimensions
+-- these have the advantage of specifying which terms are available (WX0_2 is unambiguously X term for L^0M^2)
+
+- load the astrometry from a table (not very efficient unless all chip
+  terms are in the same table, which is an option)
+
+X = \Sum (WX_i_j) L^i M^j
+Y = \Sum (WY_i_j) L^i M^j
+
+L = \Sum (WL_i_j) P^i Q^j
+M = \Sum (WM_i_j) P^i Q^j
+
+P,Q = proj (R,D)[CTYPE, CRVAL, CRPIX, CDi_j]
+
+      
+Implementing the mosaic astrometry information in Elixir systems vs IPP.
+
+Elixir uses libohana/coordops to handle all coordinate
+transformations.  The coordinate structure (Coords) is part of the
+DVO/Images.h structure.  I cannot add an additional set of entries to
+that structure without breaking old DVO or other elixir code.  It is
+also not strictly relevant since the Coords structure is used to
+define the transformation of a single chip (and is sufficient to carry
+those terms up to 3rd order).  
+
+For elixir, we will need a two stage process, with one stage
+transforming the celestial coords to the focal plane, with PLY terms
+and a second to represent the chip to FP transform, with a varient on
+PLY terms.  (we can't use PLY since those use a projection, while we
+want a transform that only corrsponds to an Nth order polynomial onto
+a plane.  We should call this transform WRP, with ctype PLN-WRP and
+terms:
+
+crval1,2 = L,M coordinates for reference pixel
+crpix1,2 = X,Y coordinates for reference pixel
+cdelt1,2 = plate scale (should be  1,1 by default)
+etc.
+
+A third order warp couple to a third order distortion leads to 6th
+order terms in general.  
+
+--
+
+My plan is now to allow the dvo image table to represent chips in a mosaic
+with either the current (per-chip) entry or an entry per chip coupled
+to an entry per mosaic.  The chip image entries would have astrometric
+terms of up-to third order which transform from chip to focal plane,
+coupled in turn to a mosaic entry in the table giving astrometry from
+focal plane to the sky.  The chip-to-fp entries would be identified
+with astrometry CTYPE value of "-WRP" and the fp-to-sky would have
+entries with CTYPE value of "-MOS". 
+
+- does this information go in the header of each *.smp file?  
+- does this require us to package all chips in a single MEF smp
+- package?
+- mosastro would create the astrometry terms (per-chip and
+- per-mosaic), where does it store them?
+- minimal impact on addstar?
+
+- what are the implications for dvo?
+  - image I/O functions need to know about the mosaic
+
+- how do we match a chip to a mosaic?
+  chip is unique based on time and photcode.
+  - we could require the mosaic photcode entries to have values of
+  PRI/SEC
+
+: mosastro should construct a PHU element 654321oXX.smp which contains
+  the mosaic astrometry terms
+
+: alternatively: each .smp file could have a collection of header
+  keywords which specify the mosaic astrometry terms.
+
+: alternatively again, the 
+
+: photcode for the mosaic entry is CAMERA.FILTER.XX
+: addstar would have to have access to this file for each chip
+: addstar should not create a new mosaic entry
+
+: how do we handle GetCoords (which needs to construct TWO coords
+  structures for output in the case of a mosaic?)
+
Index: /trunk/Ohana/src/mosastro/doc/update.txt
===================================================================
--- /trunk/Ohana/src/mosastro/doc/update.txt	(revision 3392)
+++ /trunk/Ohana/src/mosastro/doc/update.txt	(revision 3392)
@@ -0,0 +1,8 @@
+
+mosastro USAGE:
+
+  - mosastro (inglob) (outext) [-dist (distort)] [-chips (chipset)]
+
+  * given a collection of chip data, measure the complete model
+    parameters relative to reference.  output is individual chip files
+    with a new extension (and updated header contents)
Index: /trunk/Ohana/src/opihi/cmd.data/rd.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.data/rd.c	(revision 3391)
+++ /trunk/Ohana/src/opihi/cmd.data/rd.c	(revision 3392)
@@ -121,6 +121,6 @@
     if (CCDKeyword == (char *) NULL) {
       fprintf (stderr, "CCDKEYWORD variable is not set; ");
-      fprintf (stderr, "using IMAGEID as default\n");
-      CCDKeyword = strcreate ("IMAGEID");
+      fprintf (stderr, "using EXTNAME as default\n");
+      CCDKeyword = strcreate ("EXTNAME");
     }
     done = FALSE;
Index: /trunk/Ohana/src/opihi/dvo/pmeasure.c
===================================================================
--- /trunk/Ohana/src/opihi/dvo/pmeasure.c	(revision 3391)
+++ /trunk/Ohana/src/opihi/dvo/pmeasure.c	(revision 3392)
@@ -11,4 +11,5 @@
   unsigned IDclip, IDchoice, LimExclude;
   unsigned FlagChoice, FlagClip, flags;
+  int PhotcodeClip;
 
   Catalog catalog;
@@ -29,4 +30,10 @@
   Rmax = graphmode.coords.crval1 + 182.0;
 
+  PhotcodeClip = -1;
+  if (N = get_argument (argc, argv, "-p")) {
+    remove_argument (N, &argc, argv);
+    PhotcodeClip = GetPhotcodeCodebyName (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
   IDclip = FALSE;
   if (N = get_argument (argc, argv, "-ID")) {
@@ -120,4 +127,5 @@
 	  if (!(flags & FlagChoice)) continue;
 	}
+	if ((PhotcodeClip != -1) && (catalog.measure[m+k].source != PhotcodeClip)) continue;
 	mag = PhotCat (&catalog.measure[m+k]);
 	Zvec.elements[N] = MIN (1.0, MAX (0.01, (mag - Mz) / Mr));
Index: /trunk/Ohana/src/opihi/pantasks/LocalJob.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/LocalJob.c	(revision 3392)
+++ /trunk/Ohana/src/opihi/pantasks/LocalJob.c	(revision 3392)
@@ -0,0 +1,17 @@
+
+/* local jobs are forked in the background */
+
+SubmitLocalJob (Job *job) {
+
+  /* 
+     construct the command line
+     fork the command, get back the PID
+     increment local job counter 
+  */
+
+}
+
+CheckLocalJob (Job *job) {
+
+  /* 
+     
Index: /trunk/Ohana/src/opihi/pclient/notes.txt
===================================================================
--- /trunk/Ohana/src/opihi/pclient/notes.txt	(revision 3392)
+++ /trunk/Ohana/src/opihi/pclient/notes.txt	(revision 3392)
@@ -0,0 +1,17 @@
+
+pclient special commands:
+
+ job 
+
+ reset
+
+ check
+
+ status
+
+ stdout
+
+ stderr
+
+- communication with pclient should search for the pclient prompt:
+  pclient:
Index: /trunk/Ohana/src/opihi/pclient/outline.txt
===================================================================
--- /trunk/Ohana/src/opihi/pclient/outline.txt	(revision 3392)
+++ /trunk/Ohana/src/opihi/pclient/outline.txt	(revision 3392)
@@ -0,0 +1,12 @@
+
+init stage:
+
+  - set child 
+
+readline loop:
+
+  - wait for commands
+
+
+
+  
Index: /trunk/Ohana/src/opihi/scripts/run.pclient
===================================================================
--- /trunk/Ohana/src/opihi/scripts/run.pclient	(revision 3392)
+++ /trunk/Ohana/src/opihi/scripts/run.pclient	(revision 3392)
@@ -0,0 +1,4 @@
+#!/bin/csh -f
+
+# pclient
+mana
Index: /trunk/Ohana/src/opihi/scripts/testscript
===================================================================
--- /trunk/Ohana/src/opihi/scripts/testscript	(revision 3392)
+++ /trunk/Ohana/src/opihi/scripts/testscript	(revision 3392)
@@ -0,0 +1,16 @@
+#!/bin/csh -f
+
+date
+
+ls -d *
+# sleep 3
+ls foo
+
+foreach f (*)
+  echo $f
+  ls $f/*
+#  sleep 1
+end
+
+date
+#exit 3
