Index: /trunk/doc/ipptools/phase0.txt
===================================================================
--- /trunk/doc/ipptools/phase0.txt	(revision 8262)
+++ /trunk/doc/ipptools/phase0.txt	(revision 8262)
@@ -0,0 +1,52 @@
+Pan-Tasks regularly runs:
+
+	p0search -pendingimfile
+
+which returns a list of imfiles which are pending for phase 0 processing.
+Imfiles are characterised by: exp_id, class_id, uri
+
+For each imfile, we run:
+
+	phase0imfile.pl -exp_id $expId -classId $classId -uri $uri
+
+"phase0imfile.pl" is a helper script that runs ppStats on the imfile,
+pulling out interesting qualities:
+
+	ra, dec, exptime, background, stdev, image type, ...
+
+It then pushes these qualities into the database using:
+
+	p0search -updateimfile -ra $ra -dec $dec -exptime $expTime ... [etc]
+
+"p0search -updateimfile" ticks off the imfile as having been processed
+through phase 0.
+
+
+
+
+Pan-Tasks regularly runs:
+
+	p0search -pendingexp
+
+which returns a list of exposures which are pending for phase 0 processing,
+i.e., all imfiles within have been processed.  The exposures are characterised
+by an expid.
+
+For each exposure, we run:
+
+	phase0exp.pl $expId
+
+"phase0exp.pl" is a helper script that pulls out the qualities for each component
+imfile of that exposure (which are stored in the database) using: 
+
+	p0search -rawimfiles -expid $expId
+
+For those, it checks that the values are consistent across the
+components, and also decides if the exposure is a detrend or science
+exposure.  The results are uploaded to the database using:
+
+	p0search -updateexp -expid -ra $ra -dec $dec -exptime $expTime ... [-detrend]
+
+"p0search -updateexp" ticks off the exposure as having been processed
+through phase 0, and moves it over for phase 1 (or phase 2)
+processing.
