IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38489


Ignore:
Timestamp:
Jun 18, 2015, 3:32:08 PM (11 years ago)
Author:
eugene
Message:

adding verbosity

Location:
branches/eam_branches/ipp-20150616/Ohana/src/addstar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150616/Ohana/src/addstar/include/loadgalphot.h

    r38486 r38489  
    44  double **b;
    55  double **c;
     6  double **C;
     7  double  *B;
    68  double *Cii;
    79  int order;
  • branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/loadgalphot_fit2d.c

    r38488 r38489  
    11# include "addstar.h"
    22# include "loadgalphot.h"
     3# define VERY_VERBOSE 1
    34
    45Fit2D *fit2d_init (int order) {
     
    1819  ALLOCATE (fit->s, double *, fit->mterm);
    1920  ALLOCATE (fit->b, double *, fit->wterm);
     21  ALLOCATE (fit->B, double,   fit->wterm);
    2022  ALLOCATE (fit->c, double *, fit->wterm);
     23  ALLOCATE (fit->C, double *, fit->wterm);
    2124  for (i = 0; i < fit->wterm; i++) {
    2225    ALLOCATE_ZERO (fit->c[i], double, fit->wterm);
     26    ALLOCATE_ZERO (fit->C[i], double, fit->wterm);
    2327    ALLOCATE_ZERO (fit->b[i], double, 1);
    2428  }
     
    5862
    5963  for (i = 0; i < fit->wterm; i++) {
     64    free (fit->C[i]);
    6065    free (fit->c[i]);
    6166    free (fit->b[i]);
    6267  }
    6368  free (fit->b);
     69  free (fit->B);
    6470  free (fit->c);
     71  free (fit->C);
    6572
    6673  for (i = 0; i < fit->mterm; i++) {
     
    137144    }
    138145
     146# if (VERY_VERBOSE)
     147    for (i = 0; i < fit->wterm; i++) {
     148      for (j = 0; j < fit->wterm; j++) {
     149        fit->C[i][j] = fit->c[i][j];
     150      }
     151      fit->B[i] = fit->b[i][0];
     152    }
     153# endif
     154
    139155    // invert the c,b matrix equation
    140156    status = dgaussjordan (fit->c, fit->b, fit->wterm, 1);
    141     if (!status) return FALSE;
     157    if (!status) {
     158# if (VERY_VERBOSE)
     159      for (i = 0; i < fit->wterm; i++) {
     160        for (j = 0; j < fit->wterm; j++) {
     161          fprintf (stderr, "%10.3e ", fit->C[i][j]);
     162        }
     163        fprintf (stderr, " : %10.3e\n", fit->B[i]);
     164      }
     165# endif
     166      return FALSE;
     167    }
    142168
    143169    /* the b[][0] terms are in the following order:
Note: See TracChangeset for help on using the changeset viewer.