Changeset 4865 for trunk/Ohana/src/addstar
- Timestamp:
- Aug 24, 2005, 8:51:56 AM (21 years ago)
- Location:
- trunk/Ohana/src/addstar/src
- Files:
-
- 5 edited
-
calibrate.c (modified) (5 diffs)
-
find_matches.c (modified) (5 diffs)
-
find_matches_refstars.c (modified) (5 diffs)
-
gcatalog.c (modified) (1 diff)
-
replace_match.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/calibrate.c
r3361 r4865 60 60 if (measure[0].source == CalC0) { 61 61 found0 = TRUE; 62 CalM0 = measure[i].M ;63 dCalM = measure[i].dM ;62 CalM0 = measure[i].M_PS; 63 dCalM = measure[i].dM_PS; 64 64 } 65 65 if (measure[i].source == CalC1) { 66 66 found1 = TRUE; 67 CalM1 = measure[i].M ;67 CalM1 = measure[i].M_PS; 68 68 } 69 69 if (measure[i].source == CalC2) { 70 70 found2 = TRUE; 71 CalM2 = measure[i].M ;71 CalM2 = measure[i].M_PS; 72 72 } 73 73 if (found0 && found1 && found2) { 74 SaveCalibration (new[0].M , new[0].dM, CalM0, dCalM, CalM1-CalM2, new[0].airmass, Nstar);74 SaveCalibration (new[0].M_PS, new[0].dM_PS, CalM0, dCalM, CalM1-CalM2, new[0].airmass_PS, Nstar); 75 75 return; 76 76 } … … 83 83 84 84 int i, MaxN, *Nlist, Nkeep; 85 short int Mint;85 float Mint; 86 86 float N, M1, M2, Klam, Clam, Xlam, Mabs, *Dmag, *dDmag; 87 87 float dMo, dMr, Mw, Dmed, W1, W2, NSigma; … … 110 110 ALLOCATE (dDmag, float, Ncal); 111 111 Nkeep = 0; 112 Clam = thiscode[0].C*0.001; 112 113 Klam = thiscode[0].K; 113 Clam = thiscode[0].C;114 114 Xlam = thiscode[0].X[0]; 115 115 for (i = 0; i < Ncal; i++) { 116 116 /* if this entry has too many (or two few?) matches, skip it */ 117 117 if (Nlist[Nstar[i]] != 1) continue; 118 Mint = Clam + Mobs[i] + Xlam*Cref[i] + Klam*(Airm[i] - 1 000);119 Mabs = 0.001*Mint - ZeroPt;118 Mint = Clam + Mobs[i] + Xlam*Cref[i] + Klam*(Airm[i] - 1.000); 119 Mabs = Mint - ZeroPt; 120 120 /* note: subpix correction is applied in gstars */ 121 121 … … 126 126 } 127 127 128 dMr = MAX (0.005, 0.001*dMref[i]); 129 dMo = MAX (0.005, 0.001*dMobs[i]); 128 /* XXX EAM: note the artificial 0.005 dmag here */ 129 dMr = MAX (0.005, dMref[i]); 130 dMo = MAX (0.005, dMobs[i]); 130 131 131 Dmag[Nkeep] = (Mabs - 0.001*Mref[i]);132 Dmag[Nkeep] = (Mabs - Mref[i]); 132 133 dDmag[Nkeep] = (dMr*dMr + dMo*dMo); 133 134 Nkeep ++; … … 178 179 } 179 180 } 181 182 /*** image.Mcal is still in millimags ***/ -
trunk/Ohana/src/addstar/src/find_matches.c
r4825 r4865 13 13 Coords tcoords; 14 14 int Nsecfilt, Nsec, MTIME; 15 short int Mcat, *Mval;15 float Mcat, *Mval; 16 16 17 17 /* photcode data - must by of type DEP, (PRI, SEC) - probably should restrict to DEP */ … … 103 103 /* correct instrumental mags for exposure time */ 104 104 if (image[0].exptime > 0) { 105 MTIME = 2 500*log10(image[0].exptime);105 MTIME = 2.500*log10(image[0].exptime); 106 106 } else { 107 107 MTIME = 0; … … 149 149 catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R_PS - stars[N].R); 150 150 catalog[0].measure[Nmeas].dD_PS = 3600.0*(catalog[0].average[n].D_PS - stars[N].D); 151 catalog[0].measure[Nmeas].M = MIN (1000*stars[N].M + MTIME, NO_MAG);152 catalog[0].measure[Nmeas].dM = MIN (1000*stars[N].dM, NO_ERR); /* error in input files stored in thousandths of mag */153 catalog[0].measure[Nmeas].Mcal = image[0].Mcal;154 catalog[0].measure[Nmeas].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */155 catalog[0].measure[Nmeas].averef = n;156 catalog[0].measure[Nmeas].source = stars[N].code; /* photcode */157 catalog[0].measure[Nmeas].dophot = stars[N].dophot;158 catalog[0].measure[Nmeas].flags = 0;159 catalog[0].measure[Nmeas].dt = MTIME;160 catalog[0].measure[Nmeas].airmass = secz;161 162 catalog[0].measure[Nmeas].Mgal = MIN (1000*stars[N].Mgal + MTIME, NO_MAG);163 catalog[0].measure[Nmeas].FWx = MIN (100*stars[N].fx, NO_MAG);164 catalog[0].measure[Nmeas]. fwy = MIN (100*(stars[N].fy / stars[N].fx), NO_ERR);165 catalog[0].measure[Nmeas].theta = MIN ((255/360)*stars[N].df, NO_ERR);151 catalog[0].measure[Nmeas].M_PS = MIN (stars[N].M + MTIME, NO_MAG); 152 catalog[0].measure[Nmeas].dM_PS = MIN (stars[N].dM, NO_ERR); /* error in input files stored in thousandths of mag */ 153 catalog[0].measure[Nmeas].Mcal_PS = 0.001*image[0].Mcal; /* XXX image.Mcal still millimags */ 154 catalog[0].measure[Nmeas].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */ 155 catalog[0].measure[Nmeas].averef = n; 156 catalog[0].measure[Nmeas].source = stars[N].code; /* photcode */ 157 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 158 catalog[0].measure[Nmeas].flags = 0; 159 catalog[0].measure[Nmeas].dt_PS = MTIME; 160 catalog[0].measure[Nmeas].airmass_PS = secz; 161 162 catalog[0].measure[Nmeas].Mgal_PS = MIN (stars[N].Mgal + MTIME, NO_MAG); 163 catalog[0].measure[Nmeas].FWx = MIN (100*stars[N].fx, NO_MAG); 164 catalog[0].measure[Nmeas].FWy = MIN (100*stars[N].fy, NO_MAG); 165 catalog[0].measure[Nmeas].theta = MIN ((255/360)*stars[N].df, NO_ERR); 166 166 167 167 /* it is not valid to pass PRI/SEC/REF photcodes to this routine */ 168 168 /* check for entries in the secfilt lists */ 169 Mcat = iPhotCat (&catalog[0].measure[Nmeas]);170 Mval = (Nsec == -1) ? &catalog[0].average[n].M : &catalog[0].secfilt[n*Nsecfilt+Nsec].M;169 Mcat = PhotCat (&catalog[0].measure[Nmeas]); 170 Mval = (Nsec == -1) ? &catalog[0].average[n].M_PS : &catalog[0].secfilt[n*Nsecfilt+Nsec].M_PS; 171 171 if (*Mval == NO_MAG) *Mval = Mcat; 172 172 … … 254 254 secz = airmass (image[0].secz, stars[N].R, stars[N].D, SiderealTime, Latitude); 255 255 256 catalog[0].average[Nave].R_PS = stars[N].R;257 catalog[0].average[Nave].D_PS = stars[N].D;258 catalog[0].average[Nave].M = NO_MAG;259 catalog[0].average[Nave].dM = NO_MAG;256 catalog[0].average[Nave].R_PS = stars[N].R; 257 catalog[0].average[Nave].D_PS = stars[N].D; 258 catalog[0].average[Nave].M_PS = NO_MAG; 259 catalog[0].average[Nave].dM_PS = NO_MAG; 260 260 catalog[0].average[Nave].Nm = 1; 261 261 catalog[0].average[Nave].Nn = 0; … … 268 268 269 269 for (j = 0; j < Nsecfilt; j++) { 270 catalog[0].secfilt[Nave*Nsecfilt+j].M = NO_MAG;271 catalog[0].secfilt[Nave*Nsecfilt+j]. Xm= NO_MAG;272 catalog[0].secfilt[Nave*Nsecfilt+j]. dM= NO_MAG;270 catalog[0].secfilt[Nave*Nsecfilt+j].M_PS = NO_MAG; 271 catalog[0].secfilt[Nave*Nsecfilt+j].dM_PS = NO_MAG; 272 catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NO_MAG; 273 273 } 274 274 275 275 catalog[0].measure[Nmeas].dR_PS = 0.0; 276 276 catalog[0].measure[Nmeas].dD_PS = 0.0; 277 catalog[0].measure[Nmeas].M = MIN (1000*stars[N].M + MTIME, NO_MAG);278 catalog[0].measure[Nmeas].dM = MIN (1000*stars[N].dM, NO_ERR);279 catalog[0].measure[Nmeas].Mcal =image[0].Mcal;280 catalog[0].measure[Nmeas].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */281 catalog[0].measure[Nmeas].averef = Nave;282 catalog[0].measure[Nmeas].source = stars[N].code; /* photcode */283 catalog[0].measure[Nmeas].dophot = stars[N].dophot;284 catalog[0].measure[Nmeas].flags = 0;285 catalog[0].measure[Nmeas].dt = MTIME;286 catalog[0].measure[Nmeas].airmass = secz;287 288 catalog[0].measure[Nmeas].Mgal = MIN (1000*stars[N].Mgal + MTIME, NO_MAG);289 catalog[0].measure[Nmeas].FWx = MIN (100*stars[N].fx, NO_MAG);290 catalog[0].measure[Nmeas]. fwy = MIN (100*(stars[N].fy / stars[N].fx), NO_ERR);291 catalog[0].measure[Nmeas].theta = MIN ((255/360)*stars[N].df, NO_ERR);292 293 Mcat = iPhotCat (&catalog[0].measure[Nmeas]);294 Mval = (Nsec == -1) ? &catalog[0].average[Nave].M : &catalog[0].secfilt[Nave*Nsecfilt+Nsec].M;277 catalog[0].measure[Nmeas].M_PS = MIN (stars[N].M + MTIME, NO_MAG); 278 catalog[0].measure[Nmeas].dM_PS = MIN (stars[N].dM, NO_ERR); 279 catalog[0].measure[Nmeas].Mcal_PS = 0.001*image[0].Mcal; 280 catalog[0].measure[Nmeas].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */ 281 catalog[0].measure[Nmeas].averef = Nave; 282 catalog[0].measure[Nmeas].source = stars[N].code; /* photcode */ 283 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 284 catalog[0].measure[Nmeas].flags = 0; 285 catalog[0].measure[Nmeas].dt_PS = MTIME; 286 catalog[0].measure[Nmeas].airmass_PS = secz; 287 288 catalog[0].measure[Nmeas].Mgal_PS = MIN (stars[N].Mgal + MTIME, NO_MAG); 289 catalog[0].measure[Nmeas].FWx = MIN (100*stars[N].fx, NO_MAG); 290 catalog[0].measure[Nmeas].FWy = MIN (100*stars[N].fy, NO_MAG); 291 catalog[0].measure[Nmeas].theta = MIN ((255/360)*stars[N].df, NO_ERR); 292 293 Mcat = PhotCat (&catalog[0].measure[Nmeas]); 294 Mval = (Nsec == -1) ? &catalog[0].average[Nave].M_PS : &catalog[0].secfilt[Nave*Nsecfilt+Nsec].M_PS; 295 295 if (*Mval == NO_MAG) *Mval = Mcat; 296 296 -
trunk/Ohana/src/addstar/src/find_matches_refstars.c
r4800 r4865 130 130 catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R_PS - stars[N][0].R); 131 131 catalog[0].measure[Nmeas].dD_PS = 3600.0*(catalog[0].average[n].D_PS - stars[N][0].D); 132 catalog[0].measure[Nmeas].M = MIN (1000*stars[N][0].M, NO_MAG);133 catalog[0].measure[Nmeas].dM = MIN (1000*stars[N][0].dM, NO_ERR);134 catalog[0].measure[Nmeas].Mcal = 0;132 catalog[0].measure[Nmeas].M_PS = MIN (stars[N][0].M, NO_MAG); 133 catalog[0].measure[Nmeas].dM_PS = MIN (stars[N][0].dM, NO_ERR); 134 catalog[0].measure[Nmeas].Mcal_PS = 0; 135 135 catalog[0].measure[Nmeas].t = (TIMEREF == 0) ? stars[N][0].t : TIMEREF; /** careful : time_t vs e_time **/ 136 136 catalog[0].measure[Nmeas].averef = n; … … 138 138 catalog[0].measure[Nmeas].dophot = 0; 139 139 catalog[0].measure[Nmeas].flags = 0; 140 catalog[0].measure[Nmeas].dt = 0xffff;141 142 catalog[0].measure[Nmeas].Mgal = NO_MAG;143 catalog[0].measure[Nmeas].airmass = 0;144 catalog[0].measure[Nmeas].FWx = NO_MAG;145 catalog[0].measure[Nmeas]. fwy = 0xff;146 catalog[0].measure[Nmeas].theta = 0xff;140 catalog[0].measure[Nmeas].dt_PS = 0xffff; 141 142 catalog[0].measure[Nmeas].Mgal_PS = NO_MAG; 143 catalog[0].measure[Nmeas].airmass_PS = 0; 144 catalog[0].measure[Nmeas].FWx = NO_MAG; 145 catalog[0].measure[Nmeas].FWy = NO_MAG; 146 catalog[0].measure[Nmeas].theta = NO_ERR; 147 147 148 148 /** don't update average / secfilt values for REF photcodes **/ … … 195 195 catalog[0].average[Nave].R_PS = stars[N][0].R; 196 196 catalog[0].average[Nave].D_PS = stars[N][0].D; 197 catalog[0].average[Nave].M = NO_MAG;198 catalog[0].average[Nave].dM = NO_MAG;197 catalog[0].average[Nave].M_PS = NO_MAG; 198 catalog[0].average[Nave].dM_PS = NO_MAG; 199 199 catalog[0].average[Nave].Nm = 1; 200 200 catalog[0].average[Nave].Nn = 0; … … 207 207 208 208 for (j = 0; j < Nsecfilt; j++) { 209 catalog[0].secfilt[Nave*Nsecfilt+j].M = NO_MAG;210 catalog[0].secfilt[Nave*Nsecfilt+j]. Xm= NO_MAG;211 catalog[0].secfilt[Nave*Nsecfilt+j]. dM= NO_MAG;209 catalog[0].secfilt[Nave*Nsecfilt+j].M_PS = NO_MAG; 210 catalog[0].secfilt[Nave*Nsecfilt+j].dM_PS = NO_MAG; 211 catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NO_MAG; 212 212 } 213 213 214 214 catalog[0].measure[Nmeas].dR_PS = 0.0; 215 215 catalog[0].measure[Nmeas].dD_PS = 0.0; 216 catalog[0].measure[Nmeas].M = MIN (1000*stars[N][0].M, NO_MAG);217 catalog[0].measure[Nmeas].dM = MIN (1000*stars[N][0].dM, NO_ERR);218 catalog[0].measure[Nmeas].Mcal = 0;216 catalog[0].measure[Nmeas].M_PS = MIN (stars[N][0].M, NO_MAG); 217 catalog[0].measure[Nmeas].dM_PS = MIN (stars[N][0].dM, NO_ERR); 218 catalog[0].measure[Nmeas].Mcal_PS = 0; 219 219 catalog[0].measure[Nmeas].t = (stars[N][0].t == 0) ? TIMEREF : stars[N][0].t; /** careful : time_t vs e_time **/ 220 220 catalog[0].measure[Nmeas].averef = Nave; … … 222 222 catalog[0].measure[Nmeas].dophot = 0; 223 223 catalog[0].measure[Nmeas].flags = 0; 224 catalog[0].measure[Nmeas].dt = 0xffff;225 226 catalog[0].measure[Nmeas].Mgal = NO_MAG;227 catalog[0].measure[Nmeas].airmass = 0;228 catalog[0].measure[Nmeas].FWx = NO_MAG;229 catalog[0].measure[Nmeas]. fwy = 0xff;230 catalog[0].measure[Nmeas].theta = 0xff;224 catalog[0].measure[Nmeas].dt_PS = 0xffff; 225 226 catalog[0].measure[Nmeas].Mgal_PS = NO_MAG; 227 catalog[0].measure[Nmeas].airmass_PS = 0; 228 catalog[0].measure[Nmeas].FWx = NO_MAG; 229 catalog[0].measure[Nmeas].FWy = NO_ERR; 230 catalog[0].measure[Nmeas].theta = NO_ERR; 231 231 232 232 stars[N][0].found = Nmeas; -
trunk/Ohana/src/addstar/src/gcatalog.c
r4826 r4865 28 28 for (in = out = i = 0; i < catalog[0].Naverage; i++) { 29 29 for (j = 0; j < catalog[0].Nsecfilt; j++, in++, out++) { 30 outsec[out].M = insec[in].M; 30 outsec[out].M_PS = insec[in].M_PS; 31 outsec[out].dM_PS = insec[in].dM_PS; 31 32 outsec[out].Xm = insec[in].Xm; 32 outsec[out].dM = insec[in].dM;33 33 } 34 34 for (j = 0; j < Nextra; j++, out++) { 35 outsec[out].M = NO_MAG;36 outsec[out]. Xm= NO_MAG;37 outsec[out]. dM= NO_MAG;35 outsec[out].M_PS = NO_MAG; 36 outsec[out].dM_PS = NO_MAG; 37 outsec[out].Xm = NO_MAG; 38 38 } 39 39 } -
trunk/Ohana/src/addstar/src/replace_match.c
r4800 r4865 12 12 measure[i].dR_PS = 3600.0*(average[0].R_PS - star[0].R); 13 13 measure[i].dD_PS = 3600.0*(average[0].D_PS - star[0].D); 14 measure[i].M = MIN (1000*star[0].M, NO_MAG);15 measure[i].dM = MIN (1000*star[0].dM, NO_ERR);14 measure[i].M_PS = MIN (star[0].M, NO_MAG); 15 measure[i].dM_PS = MIN (star[0].dM, NO_ERR); 16 16 star[0].found = average[0].offset + i; 17 17 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.
