IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14163


Ignore:
Timestamp:
Jul 12, 2007, 9:42:47 AM (19 years ago)
Author:
eugene
Message:

adding peak data to lum functions

Location:
trunk/psastro/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastro.h

    r13832 r14163  
    1717// logN = offset + slope * logS
    1818typedef struct {
    19   double mMin;
    20   double mMax;
    21   double offset;
    22   double slope;
     19    double mMin;                        // minimum magnitude bin with data
     20    double mMax;                        // maximum magnitude bin with data
     21    double offset;                      // fitted line offset
     22    double slope;                       // fitted line slope
     23    double mPeak;                       // mag of peak bin
     24    int nPeak;                          // # of stars in peak bin
    2325} pmLumFunc;
    2426
  • trunk/psastro/src/psastroLuminosityFunction.c

    r12806 r14163  
    1010}
    1111
    12 pmLumFunc *pmLumFuncAlloc (double mMin, double mMax, double offset, double slope) {
     12pmLumFunc *pmLumFuncAlloc () {
    1313
    1414  pmLumFunc *func = (pmLumFunc *) psAlloc(sizeof(pmLumFunc));
    1515  psMemSetDeallocator(func, (psFreeFunc) pmLumFuncFree);
    1616
    17   func->mMin = mMin;
    18   func->mMax = mMax;
    19   func->slope = slope;
    20   func->offset = offset;
     17  func->mMin = 0.0;
     18  func->mMax = 0.0;
     19  func->slope = 0.0;
     20  func->offset = 0.0;
     21
     22  func->mPeak = 0.0;
     23  func->nPeak = 0;
    2124
    2225  return func;
     
    112115  psLogMsg ("psastro", 4, "logN vs mag residuals: %f +/- %f\n", stats->sampleMedian, stats->sampleStdev);
    113116
    114   pmLumFunc *lumFunc = pmLumFuncAlloc (mMinValid, mMaxValid, line->coeff[0], line->coeff[1]);
     117  pmLumFunc *lumFunc = pmLumFuncAlloc ();
     118  lumFunc->mMin = mMinValid;
     119  lumFunc->mMax = mMaxValid;
     120  lumFunc->offset = line->coeff[0];
     121  lumFunc->slope = line->coeff[1];
     122  lumFunc->mPeak = mMin + (iPeak + 0.5)*dMag;
     123  lumFunc->nPeak = nPeak;
    115124
    116125  psFree (lnMag);
Note: See TracChangeset for help on using the changeset viewer.