IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37438


Ignore:
Timestamp:
Sep 26, 2014, 10:34:52 AM (12 years ago)
Author:
eugene
Message:

adding map fitting to relasro

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

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/astrom_maps.c

    r37389 r37438  
    2424}
    2525
     26int
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FitChip.c

    r37038 r37438  
    4949    // use that count to set order_use below
    5050
     51    // 20140925 : the same logic below is used to constrain the dimensions of the image map
     52
    5153    // figures to assess the fitting process:
    5254    // x vs dx, x vs dy, y vs dx, y vs dy :
     
    6567      return FALSE;
    6668    }
    67     image[0].coords.Npolyterms = order_use;
     69
     70    // when fitting the map, first fit a linear model (below? change Npolyterms to -1)
     71    if (MAP) {
     72      image[0].coords.Npolyterms = 1;
     73    } else {
     74      image[0].coords.Npolyterms = order_use;
     75    }
    6876
    6977    if (fit) fit_free (fit);
     
    92100
    93101    for (i = 0; i < Nmatch; i++) {
     102      // we have not yet fitted the map, so image[0].coords.Npolyterms needs to
     103      // be 1 here...
    94104      XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, &image[0].coords);
    95105    }
    96106
     107    // where do we apply the fit all the way b
     108
     109    if (MAP) {
     110      if (image[0].coords.offsetMap == NULL) {
     111        AstromOffsetMap *map = AstromOffsetTableNewMap(table, order);
     112        image[0].coords.offsetMap = map;
     113      }
     114      fit_map (image[0].coords.offsetMap, raw, ref);
     115      image[0].coords.Npolyterm = -1;
     116    }
    97117  }
    98118
     
    254274*/
    255275
     276int fit_map (AstromOffsetMap *map) {
     277
     278  // we are actually fitting the residual after the linear fit has been taken off
     279 
     280  // fit the linear terms as above
     281  // calculate dX (raw.X - ref.X) and dY
     282 
     283  AstromOffsetMapFit (map, x, y, dX, Npts, TRUE);
     284  AstromOffsetMapFit (map, x, y, dY, Npts, FALSE);
     285
     286  return TRUE;
     287}
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/fitpoly.c

    r33652 r37438  
    277277/* this should only apply to the polynomial, not the projection terms */
    278278/* compare with psastro supporting code */
     279// this code will work for linear (Npolyterm == 0 or 1) and linear + map fits
    279280int fit_apply_coords (CoordFit *fit, Coords *coords, int keepRef) {
    280281
Note: See TracChangeset for help on using the changeset viewer.