Index: /trunk/doc/ipptools/pipeline.txt
===================================================================
--- /trunk/doc/ipptools/pipeline.txt	(revision 8625)
+++ /trunk/doc/ipptools/pipeline.txt	(revision 8626)
@@ -1,3 +1,6 @@
-Put Perl modules in ~/perl/
+### Put Perl modules in ~/perl/
+### Statistics::Descriptive (CPAN)
+### PS-IPP-Metadata (CVS)
+### PS-IPP-Metadata-Config (CVS)
 
 setenv PERL5LIB $HOME/perl/
@@ -172,5 +175,4 @@
 
 price@alala:/data/alala/price/megacam>dettool -raw -simple
- psMetadataRemove (psMetadata.c:713) : Failed to remove metadata item, position, from metadata table.
 1 bias 850131b fpa mc 850131b.fits BIAS r.MP9601 1.656000 5.496118 0.349071 0.000000 1155.934692 107.037283 46.214947 37.160000 105.480000 -133.067001 0.000000
 1 bias 850132b fpa mc 850132b.fits BIAS r.MP9601 1.656000 5.499327 0.349071 0.000000 1155.431957 107.464479 46.207451 37.160000 105.480000 -133.067001 0.000000
@@ -210,7 +212,10 @@
 ### Stack the imfiles:
 
-price@alala:/data/alala/price/megacam>~/ipp/helpers/detrend_stack.pl 1 0 mc bias                                                                                
-
-#### NB: dettool -addstacked wants statistics: need to add these into ppMerge, and parse with detrend_stack.pl
+price@alala:/data/alala/price/megacam>~/ipp/helpers/detrend_stack.pl 1 0 mc bias
+
+#### NB: dettool -addstacked wants statistics: need to add these into
+####     ppMerge, and parse with detrend_stack.pl; DONE
+
+### Create residuals from the stack
 
 price@alala:/data/alala/price/megacam>dettool -toresid -simple
@@ -223,5 +228,5 @@
 0 1 850541b mc o_850541b.mc.fit PPIMAGE_O 1.780084 1.854754 292.975948
 
-### Need det_type, stacked (actually normalised) URI  ---> JH to provide
+### Need det_type, stacked (actually normalised) URI  ---> JH to provide; DONE
 
 ~/ipp/helpers/detrend_create_resid.pl 1 0 850131b mc bias bias_mc_1_0.fit o_850131b.mc.fit 850131b
@@ -270,2 +275,96 @@
 
 ### And that's it.
+
+### Didn't try:
+### (1) Iterating
+### (2) Normalisation
+### (3) JPEG creation --- need to use chip-mosaicked camera
+
+
+
+###########################################################################################################
+
+### Trying some flats
+
+
+pxinject -newExp -exp_id 806237f -inst MegaCam -telescope CFHT -exp_type bias -imfiles 1
+pxinject -newExp -exp_id 806238f -inst MegaCam -telescope CFHT -exp_type bias -imfiles 1
+pxinject -newExp -exp_id 806239f -inst MegaCam -telescope CFHT -exp_type bias -imfiles 1
+pxinject -newExp -exp_id 806240f -inst MegaCam -telescope CFHT -exp_type bias -imfiles 1
+
+pxinject -newImfile -exp_id 806237f -class fpa -class_id mc -uri 806237f.fits
+pxinject -newImfile -exp_id 806238f -class fpa -class_id mc -uri 806238f.fits
+pxinject -newImfile -exp_id 806239f -class fpa -class_id mc -uri 806239f.fits
+pxinject -newImfile -exp_id 806240f -class fpa -class_id mc -uri 806240f.fits
+
+
+price@alala:/data/alala/price/megacam/flats>p0tool -pendingimfile -simple
+806237f fpa mc 806237f.fits
+806238f fpa mc 806238f.fits
+806239f fpa mc 806239f.fits
+806240f fpa mc 806240f.fits
+
+### ===>
+
+~/ipp/helpers/phase0imfile.pl 806237f mc 806237f.fits
+~/ipp/helpers/phase0imfile.pl 806238f mc 806238f.fits
+~/ipp/helpers/phase0imfile.pl 806239f mc 806239f.fits
+~/ipp/helpers/phase0imfile.pl 806240f mc 806240f.fits
+
+
+price@alala:/data/alala/price/megacam/flats>p0tool -pendingexp -simple
+806237f MegaCam CFHT bias 1
+806238f MegaCam CFHT bias 1
+806239f MegaCam CFHT bias 1
+806240f MegaCam CFHT bias 1
+
+### ===>
+
+~/ipp/helpers/phase0exp.pl 806237f
+~/ipp/helpers/phase0exp.pl 806238f
+~/ipp/helpers/phase0exp.pl 806239f
+~/ipp/helpers/phase0exp.pl 806240f
+
+
+### Changing camera configuration file to use the bias we got earlier:
+   PPIMAGE.BIAS       INPUT bias_mc_1_0.fit               {CHIP.NAME}   {CHIP.NAME}  NONE         CHIP       IMAGE   
+
+### Changing ppImage_obd recipe to turn off dark:
+DARK		BOOL	FALSE		# Dark subtraction
+
+
+### Start the detrend run:
+
+price@alala:/data/alala/price/megacam/flats>dettool -definebyquery -det_type flat -camera mc
+detRun MULTI #
+ 
+detRun  METADATA
+   det_id           S32       2
+   iteration        S32       0
+   det_type         STR       flat
+END
+ 
+
+price@alala:/data/alala/price/megacam/flats>dettool -raw -simple
+2 flat 806237f fpa mc 806237f.fits FLAT g.MP9401 1.001000 0.341503 0.348775 99.112000 3687.433111 146.522771 74.441912 88.160000 275.250000 -133.033005 0.000000
+2 flat 806238f fpa mc 806238f.fits FLAT g.MP9401 1.000000 0.383900 0.348775 99.121002 5208.304792 212.152572 89.617438 89.760000 310.990000 -133.033005 0.000000
+2 flat 806239f fpa mc 806239f.fits FLAT g.MP9401 1.000000 0.395099 0.348775 80.097000 6311.806444 265.238880 100.970683 89.750000 310.150000 -133.033005 0.000000
+2 flat 806240f fpa mc 806240f.fits FLAT g.MP9401 1.000000 0.405135 0.348775 60.098999 6957.866556 293.657405 108.000238 89.750000 309.930000 -133.033005 0.000000
+
+### ===>
+
+
+~/ipp/helpers/detrend_process.pl 2 806237f mc flat 806237f.fits 806237f
+~/ipp/helpers/detrend_process.pl 2 806238f mc flat 806238f.fits 806238f
+~/ipp/helpers/detrend_process.pl 2 806239f mc flat 806239f.fits 806239f
+~/ipp/helpers/detrend_process.pl 2 806240f mc flat 806240f.fits 806240f
+
+### Note: couple hundred psString leaks in ppImage here.
+
+
+price@alala:/data/alala/price/megacam/flats>dettool -tostack -simple
+2 0 flat mc
+
+### ===>
+
+price@alala:/data/alala/price/megacam>~/ipp/helpers/detrend_stack.pl 2 0 mc flat
