Index: /trunk/doc/ipptools/dettool.txt
===================================================================
--- /trunk/doc/ipptools/dettool.txt	(revision 11862)
+++ /trunk/doc/ipptools/dettool.txt	(revision 11863)
@@ -371,2 +371,55 @@
 to detselect.
 
+
+--------------------------------------------------------------------------------
+
+Detrend Correction analysis (for flat-field corrections)
+
+To build a correction, we need to initial a p2/p3 analysis on a
+collection of images, supplying information so the analysis tools know
+to use the appropriate recipe (ie, which specifies that, for
+flat-field analysis, ppImage should use the 'RAW' version of a flat).  
+
+possible p2tool lines:
+
+  p2tool -queuerawexp [constraints] -set_label DVOCORR
+
+  p2tool -queuerawexp [constraints] -recipe DVOCORR -set_label DVOCORR.megacam.0001
+
+* should we tie the output DVO database to the recipe?
+* should we require the output DVO database as a db value?
+
+We need to wait until all of the selected images have been processed
+before we trigger the DVO analysis.  this could be done by blocking
+until all exposures with the specified label have successfully (or
+perhaps unsuccessfully) finished p3.
+
+* do we need to define a table which track these dvo_correction
+  'runs'?
+
+--------------------------------------------------------------------------------
+
+Detrend Correction application (for flat-field corrections)
+
+Assuming there is already a flat-field correction in the db for a
+given camera and filter, we need to (optionally) apply the correction
+to flat-field images as they are built by the detrend creation system.
+
+The first step is to select a flat-field image which requires a
+flat-field correction:
+
+  dettool -tocorrectrun -det_type skyflat.raw
+
+returns a list of detrun ids and iterations which have valid masters
+and for which there are no children.
+
+  detselect -select -det_id det_id -iteration iter 
+
+returns a list of imfiles to be corrected
+
+  dettool -register_detrend -parent det_id
+
+  dettool -register_detrend_imfile -parent det_id etc
+
+inserts the completed imfiles
+
