IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37575


Ignore:
Timestamp:
Nov 10, 2014, 11:14:57 AM (12 years ago)
Author:
eugene
Message:

fix AstromOffsetTableFree, use 1st order only for fakeastro fitting

Location:
branches/eam_branches/ipp-20140904/Ohana/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/fit_fake_stars.c

    r37531 r37575  
    3333    return FALSE;
    3434  }
     35  order_use = 1; // hard-wire linear solutions (nothing higher is needed for now)
    3536
    3637  // I have Nstars with "reference" positions stars[].Rref,Dref and
     
    4041
    4142  int CHIPMAP = (image[0].coords.Npolyterms == -1);
    42   image[0].coords.Npolyterms = CHIPMAP ? 1 : order_use;
    4343
    44   CoordFit *fit = fit_init (image[0].coords.Npolyterms);
     44  // XX1 image[0].coords.Npolyterms = CHIPMAP ? 1 : order_use;
     45  CoordFit *fit = CHIPMAP ? fit_init (1) : fit_init (order_use);
    4546
    4647  double *L, *M;
    4748  ALLOCATE (L, double, Nstars);
    4849  ALLOCATE (M, double, Nstars);
     50
     51  // static int Ntest = 0;
     52  // char name[64];
     53  // snprintf (name, 64, "test.%03d.dat", Ntest); Ntest ++;
     54  // FILE *f = fopen (name, "w");
    4955
    5056  // generate the fit matches
     
    5359    RD_to_XY (&L[i], &M[i], stars[i].Rref, stars[i].Dref, image[0].coords.mosaic);
    5460    fit_add (fit, stars[i].measure.Xccd, stars[i].measure.Yccd, L[i], M[i], 0.05);
     61
     62    // double Lo, Mo, Xo, Yo;
     63    // RD_to_XY (&Lo, &Mo, stars[i].average.R, stars[i].average.D, image[0].coords.mosaic);
     64    // RD_to_XY (&Xo, &Yo, stars[i].average.R, stars[i].average.D, &image[0].coords);
     65    // fprintf (f, "%d : %f %f : %f %f : %f %f : %f %f : %f %f : %f %f\n", i, stars[i].Rref, stars[i].Dref, stars[i].average.R, stars[i].average.D, stars[i].measure.Xccd, stars[i].measure.Yccd, L[i], M[i], Lo, Mo, Xo, Yo);
    5566  }
     67  // fclose (f);
    5668
    5769  // measure the fit, update the coords & object coordinates
     
    6678  }
    6779
     80  image[0].coords.Npolyterms = CHIPMAP ? 1 : order_use;
    6881  if (!fit_apply_coords (fit, &image[0].coords, FALSE)) {
    6982    fprintf (stderr, "failed to fit new model\n");
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/AstromOffsetMapIO.c

    r37445 r37575  
    4848  // Convert the disk array of maps to then internal format in a rich structure:
    4949  AstromOffsetTable *table = AstromOffsetMapToTable (map_disk, Nmap);
    50   free (map_disk);
    5150
    5251  gfits_free_header (&theader);
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/AstromOffsetMapUtils.c

    r37572 r37575  
    7676  for (i = 0; i < table->Nmap; i++) {
    7777    for (j = 0; j < table->map[i][0].Nx; j++) {
    78       free (table->map[i][0].dXv);
    79       free (table->map[i][0].dYv);
     78      free (table->map[i][0].dXv[j]);
     79      free (table->map[i][0].dYv[j]);
    8080    }
    81     free (table->map[i]);
    82     free (table->map[i][0].dXv[j]);
    83     free (table->map[i][0].dYv[j]);
     81    FREE (table->map[i]);
     82    FREE (table->map[i][0].dXv);
     83    FREE (table->map[i][0].dYv);
    8484  }
    85   free (table->IDtoSeq);
    86   free (table->map);
     85  FREE (table->IDtoSeq);
     86  FREE (table->map);
    8787}
    8888
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/coordops.c

    r37546 r37575  
    4747    float dX = AstromOffsetMapValue (coords->offsetMap, x, y, TRUE);
    4848    float dY = AstromOffsetMapValue (coords->offsetMap, x, y, FALSE);
     49    if (isnan(dX)) dX = 0.0;
     50    if (isnan(dY)) dY = 0.0;
    4951    x += dX;
    5052    y += dY;
     
    426428      double dY = AstromOffsetMapValue (coords->offsetMap, xraw, yraw, FALSE);
    427429
     430      if (isnan(dX)) dX = 0.0;
     431      if (isnan(dY)) dY = 0.0;
     432
    428433      dX -= dXo;
    429434      dY -= dYo;
Note: See TracChangeset for help on using the changeset viewer.