Changeset 25027 for branches/pap/Ohana/src/relastro/src/FitChip.c
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/Ohana
- Property svn:mergeinfo deleted
-
branches/pap/Ohana/src/relastro/src/FitChip.c
r17209 r25027 1 1 # include "relastro.h" 2 # include "relastroVisual.h" 2 3 3 4 // XXX make these user parameters … … 5 6 # define FIT_CHIP_NITER 3 6 7 # define FIT_CHIP_NSIGMA 3.0 8 7 9 8 10 // XXX we should test if the fit is sufficiently constrained across the chip, or if the … … 22 24 23 25 ALLOCATE (values, double, Nmatch); 24 25 26 for (Niter = 0; Niter < FIT_CHIP_NITER; Niter ++) { 26 27 … … 28 29 for (i = Nscatter = 0; i < Nmatch; i++) { 29 30 if (raw[i].mask) continue; 30 if ( raw[i].dMag > FIT_CHIP_MAX_ERROR) continue;31 if (isnan(raw[i].dMag) || raw[i].dMag > FIT_CHIP_MAX_ERROR) continue; 31 32 32 33 dL = raw[i].L - ref[i].L; 33 34 dM = raw[i].M - ref[i].M; 34 35 dR = hypot (dL, dM); 35 36 36 37 values[Nscatter] = dR; 37 38 Nscatter++; … … 41 42 dsort (values, Nscatter); 42 43 dRmax = FIT_CHIP_NSIGMA*values[(int)(0.40*Nscatter)]; 44 relastroVisualPlotScatter(values, dRmax, Nscatter); 45 relastroVisualPlotRawRef(raw, ref, dRmax, Nmatch); 43 46 44 47 // fit the requested order polynomial … … 50 53 // generate the fit matches 51 54 for (i = 0; i < Nmatch; i++) { 52 if (raw[i].mask) continue; 55 if (raw[i].mask) { 56 continue; 57 } 58 if (isnan(raw[i].dMag) || raw[i].dMag > FIT_CHIP_MAX_ERROR) { 59 continue; 60 } 53 61 54 62 // only keep objects within dRmax … … 57 65 dR = hypot (dL, dM); 58 66 if (dR > dRmax) continue; 59 67 60 68 fit_add (fit, raw[i].X, raw[i].Y, ref[i].L, ref[i].M, raw[i].dPos); 61 69 } … … 66 74 case 0: 67 75 case 1: 68 skip = (fit[0].Npts < 8);69 break;76 skip = (fit[0].Npts < 8); 77 break; 70 78 case 2: 71 skip = (fit[0].Npts < 11);72 break;79 skip = (fit[0].Npts < 11); 80 break; 73 81 case 3: 74 skip = (fit[0].Npts < 15);75 break;82 skip = (fit[0].Npts < 15); 83 break; 76 84 default: 77 fprintf (stderr, "invalid chip order %d\n", coords[0].Npolyterms);78 abort ();85 fprintf (stderr, "invalid chip order %d\n", coords[0].Npolyterms); 86 abort (); 79 87 } 80 88 if (skip) { … … 95 103 XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, coords); 96 104 } 105 97 106 } 98 107
Note:
See TracChangeset
for help on using the changeset viewer.
