Index: trunk/psastro/src/psastroLuminosityFunction.c
===================================================================
--- trunk/psastro/src/psastroLuminosityFunction.c	(revision 12806)
+++ trunk/psastro/src/psastroLuminosityFunction.c	(revision 14163)
@@ -10,13 +10,16 @@
 }
 
-pmLumFunc *pmLumFuncAlloc (double mMin, double mMax, double offset, double slope) {
+pmLumFunc *pmLumFuncAlloc () {
 
   pmLumFunc *func = (pmLumFunc *) psAlloc(sizeof(pmLumFunc));
   psMemSetDeallocator(func, (psFreeFunc) pmLumFuncFree);
 
-  func->mMin = mMin;
-  func->mMax = mMax;
-  func->slope = slope;
-  func->offset = offset;
+  func->mMin = 0.0;
+  func->mMax = 0.0;
+  func->slope = 0.0;
+  func->offset = 0.0;
+
+  func->mPeak = 0.0;
+  func->nPeak = 0;
 
   return func;
@@ -112,5 +115,11 @@
   psLogMsg ("psastro", 4, "logN vs mag residuals: %f +/- %f\n", stats->sampleMedian, stats->sampleStdev);
 
-  pmLumFunc *lumFunc = pmLumFuncAlloc (mMinValid, mMaxValid, line->coeff[0], line->coeff[1]);
+  pmLumFunc *lumFunc = pmLumFuncAlloc ();
+  lumFunc->mMin = mMinValid;
+  lumFunc->mMax = mMaxValid;
+  lumFunc->offset = line->coeff[0];
+  lumFunc->slope = line->coeff[1];
+  lumFunc->mPeak = mMin + (iPeak + 0.5)*dMag;
+  lumFunc->nPeak = nPeak;
 
   psFree (lnMag);
