Changeset 12047
- Timestamp:
- Feb 25, 2007, 4:22:22 PM (19 years ago)
- Location:
- branches/dvo-mods-2007-02/Ohana/src/relastro/src
- Files:
-
- 2 added
- 1 edited
-
FitPM.c (added)
-
UpdateObjects.c (modified) (6 diffs)
-
dvo_astrom_ops.c (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/dvo-mods-2007-02/Ohana/src/relastro/src/UpdateObjects.c
r12008 r12047 2 2 3 3 static int Nmax; 4 static double *listR, *listD; 5 static double *dlistR, *dlistD; 4 static double *listX, *dlistX; 5 static double *listY, *dlistY; 6 static double *listR, *dlistR; 7 static double *listD, *dlistD; 8 static double *listT, *dlistT; 6 9 7 10 void initObjectData (Catalog *catalog, int Ncatalog) { … … 25 28 float chisq; 26 29 StatType statsR, statsD; 30 Coords coords; 31 32 coords.crval1 = 0; 33 coords.crval2 = 0; 34 coords.crpix1 = 0; 35 coords.crpix2 = 0; 36 coords.cdelt1 = coords.cdelt2 = 1.0 / 3600.0; 37 coords.pc1_1 = coords.pc2_2 = 1.0; 38 coords.pc1_2 = coords.pc2_1 = 0.0; 39 coords.Npolyterms = 1; 40 strcpy (coords.ctype, "RA---SIN"); 27 41 28 42 for (i = 0; i < Ncatalog; i++) { … … 39 53 listR[N] = getMeanR (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 40 54 listD[N] = getMeanD (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 55 listT[N] = catalog[i].measure[m].t; 41 56 42 57 /* the astrometric errors are not being carried yet (but should be!) */ … … 44 59 dlistR[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR); 45 60 dlistD[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR); 61 dlistT[N] = 1.0; /* XXX hard-wire this for now */ 62 46 63 N++; 47 64 } … … 52 69 } 53 70 71 /* we need to do the fit in a locally linear space; choose a ref coordinate */ 72 coords.crval1 = listR[0]; 73 coords.crval2 = listD[0]; 74 75 /* project all of the R,D coordinates to a plane centered on this coordinate */ 76 /* calculate pR[i], pD[i] for each point */ 77 for (k = 0; k < N; k++) { 78 RD_to_XY (&listX[k], &listY[k], listR[k], listD[k], &coords); 79 ParFactor (&pX[k], &pY[k], listR[k], listD[k]); 80 } 81 54 82 /* in here, we should be fitting the parallax and proper-motion components */ 83 /* XXX if I fit R,D,T as above, I will be getting the wrong answers near the pole */ 84 if (FitProperMotion) { 85 fit = FitPM (listX, dlistX, listY, dlistY, listT, pR, pD, N); 86 } 55 87 56 liststats (listR, dlistR, N, &statsR); 57 liststats (listR, dlistR, N, &statsD); 88 if (AverageCoords) { 89 liststats (listR, dlistR, N, &statsR); 90 liststats (listD, dlistD, N, &statsD); 58 91 59 catalog[i].average[j].R = statsR.mean;60 catalog[i].average[j].dR = statsR.sigma;92 catalog[i].average[j].R = statsR.mean; 93 catalog[i].average[j].dR = statsR.sigma; 61 94 62 catalog[i].average[j].D = statsD.mean;63 catalog[i].average[j].dD = statsD.sigma;95 catalog[i].average[j].D = statsD.mean; 96 catalog[i].average[j].dD = statsD.sigma; 64 97 65 chisq = 0.5*(statsR.chisq + statsD.chisq); 98 chisq = 0.5*(statsR.chisq + statsD.chisq); 99 } 100 66 101 catalog[i].average[j].Xp = (statsR.Nmeas > 1) ? 100.0*log10(chisq) : NO_MAG; 67 68 102 } 69 103 } … … 71 105 } 72 106 107 /* fitting proper-motion and parallax: 108 109 given a source at position r,d, at a time t, we need to calculate a vector (pr,pd) 110 111 let x,y be the coordinate in the linearized frame with y parallel to DEC lines 112 113 L,B are the ecliptic longitude and latitude of the object, 114 dL and dB are the offsets in the L and B directions 115 116 dL = sin(t - topp) 117 dB = cos(t - topp)*sin(B) 118 119 these need to be rotated to the R,D frame to yield pR,pD. Then, the equation of motion 120 for the source in the x,y frame is: 121 122 x = Ro + uR * (t - to) + p * pR 123 y = Do + uD * (t - to) + p * pD 124 125 the unknowns in these equations are Ro, uR, Do, uD, and p 126 127 XXX think through the concepts for the pole a bit better. all objects near the pole 128 move the same way with the same phase. choose a projection center and define dL,dB relative 129 to that center point coordinate system? 130 131 */
Note:
See TracChangeset
for help on using the changeset viewer.
