Index: trunk/psphot/src/psphotSourceStats.c
===================================================================
--- trunk/psphot/src/psphotSourceStats.c	(revision 33840)
+++ trunk/psphot/src/psphotSourceStats.c	(revision 34307)
@@ -521,16 +521,26 @@
     float PSF_SN_LIM = 2.0*psMetadataLookupF32(&status, recipe, "PSF_SN_LIM"); psAssert (status, "missing PSF_SN_LIM");
 
-    // XXX move this to a config file?
+
     # define NSIGMA 8
-    float sigma[NSIGMA] = {1.0, 2.0, 3.0, 4.5, 6.0, 9.0, 12.0, 18.0};
+    // moved to config file
+    // float sigma[NSIGMA]  = {1.0, 2.0, 3.0, 4.5, 6.0, 9.0, 12.0, 18.0};
+    psVector  *sigmavec = psMetadataLookupPtr (&status, recipe, "PSF.SIGMA.VALUES"); psAssert(status, "missing PSF.SIGMA.VALUES");
+    psAssert(sigmavec->n <= NSIGMA, "too many sigma values in recipe %ld maximum is %d", sigmavec->n, NSIGMA);
+
+    float sigma[NSIGMA];
     float Sout[NSIGMA];
     float Rmin[NSIGMA];
     int   Nout[NSIGMA]; // number of stars found in clump : use this to control the number of regions measured by psphotRoughClass
 
+    // copy the data from vector to local array to keep the code below easier to read
+    for (int i = 0 ; i < sigmavec->n; i++) {
+        sigma[i] = sigmavec->data.F32[i];
+    }
+
     // this sorts by peak->rawFlux
     sources = psArraySort (sources, pmSourceSortByFlux);
 
     // loop over radii:
-    for (int i = 0; i < NSIGMA; i++) {
+    for (int i = 0; i < sigmavec->n; i++) {
 
         // XXX move max source number to config
@@ -589,12 +599,12 @@
     float minS = Sout[0];
     float maxS = Sout[0];
-    for (int i = 0; i < NSIGMA; i++) {
+    for (int i = 0; i < sigmavec->n; i++) {
         minS = PS_MIN(Sout[i], minS);
         maxS = PS_MAX(Sout[i], maxS);
     }
-    if (minS > 0.65) Sigma = sigma[NSIGMA-1];
+    if (minS > 0.65) Sigma = sigma[sigmavec->n-1];
     if (maxS < 0.65) Sigma = sigma[0];
 
-    for (int i = 0; i < NSIGMA - 1 && isnan(Sigma); i++) {
+    for (int i = 0; i < sigmavec->n - 1 && isnan(Sigma); i++) {
         if (!isfinite(Sout[i]) || !isfinite(Sout[i+1])) continue;
         if ((Sout[i] > 0.65) && (Sout[i+1] > 0.65)) continue;
