Changeset 12332 for trunk/Ohana/src/relphot
- Timestamp:
- Mar 8, 2007, 12:21:18 PM (19 years ago)
- Location:
- trunk/Ohana/src/relphot
- Files:
-
- 13 edited
-
include/relphot.h (modified) (1 diff)
-
src/ConfigInit.c (modified) (4 diffs)
-
src/GridOps.c (modified) (2 diffs)
-
src/ImageOps.c (modified) (15 diffs)
-
src/MosaicOps.c (modified) (8 diffs)
-
src/StarOps.c (modified) (14 diffs)
-
src/bcatalog.c (modified) (4 diffs)
-
src/initialize.c (modified) (1 diff)
-
src/plot_scatter.c (modified) (1 diff)
-
src/relphot.c (modified) (1 diff)
-
src/select_images.c (modified) (2 diffs)
-
src/setExclusions.c (modified) (5 diffs)
-
src/setMrelFinal.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/include/relphot.h
r10506 r12332 84 84 85 85 PhotCode *photcode; 86 int PhotPrimary;87 86 int PhotNsec; 88 87 int PhotSec; -
trunk/Ohana/src/relphot/src/ConfigInit.c
r7080 r12332 5 5 double ZERO_POINT; 6 6 char *config, *file; 7 char PhotCodeFile[256]; 7 char CatdirPhotcodeFile[256]; 8 char MasterPhotcodeFile[256]; 8 9 9 10 /*** load configuration info ***/ … … 32 33 ScanConfig (config, "CATMODE", "%s", 0, CATMODE); 33 34 ScanConfig (config, "CATFORMAT", "%s", 0, CATFORMAT); 35 ScanConfig (config, "PHOTCODE_FILE", "%s", 0, MasterPhotcodeFile); 36 34 37 sprintf (ImageCat, "%s/Images.dat", CATDIR); 35 38 … … 41 44 } 42 45 43 GetConfig (config, "PHOTCODE_FILE", "%s", 0, PhotCodeFile);44 46 GetConfig (config, "ZERO_PT", "%lf", 0, &ZERO_POINT); 45 47 … … 52 54 if (*CATFORMAT == 0) strcpy (CATFORMAT, "ELIXIR"); 53 55 54 if (!LoadPhotcodes (PhotCodeFile)) { 55 fprintf (stderr, "error loading photcodes\n"); 56 /* XXX this does not yet write out the master photcode table */ 57 sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR); 58 if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile)) { 59 fprintf (stderr, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile); 56 60 exit (1); 57 61 } -
trunk/Ohana/src/relphot/src/GridOps.c
r9633 r12332 282 282 Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]); 283 283 list[N] = Msys - Mrel - Mcal - Mmos; 284 dlist[N] = MAX (catalog[c].measure[m].dM _PS, MIN_ERROR);284 dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR); 285 285 N++; 286 286 } … … 447 447 for (i = 0; i < Nimage; i++) { 448 448 image = getimage (imlist[i]); 449 pname = GetPhotcodeNamebyCode (image[0]. source);449 pname = GetPhotcodeNamebyCode (image[0].photcode); 450 450 451 451 /* this is kind of bogus... */ -
trunk/Ohana/src/relphot/src/ImageOps.c
r9633 r12332 75 75 for (i = 0; i < Ncatalog; i++) { 76 76 for (j = 0; j < catalog[i].Nmeasure; j++) { 77 ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j]. source);77 ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j].photcode); 78 78 if (photcode[0].code != ecode) continue; 79 79 matchImage (catalog, j, i); … … 82 82 } 83 83 84 /* XXX convert this to use the values of measure->Xccd,Yccd */ 85 /* XXX need to apply the conversion for ELIXIR and LONEOS formats */ 84 86 void matchImage (Catalog *catalog, int meas, int cat) { 85 87 … … 91 93 measure = &catalog[cat].measure[meas]; 92 94 for (i = 0; i < Nimage; i++) { 93 if (image[0]. source == -1) continue;94 if (measure[0]. source != image[i].source) continue;95 if (image[0].photcode == -1) continue; 96 if (measure[0].photcode != image[i].photcode) continue; 95 97 if (measure[0].t < start[i]) continue; 96 98 if (measure[0].t > stop[i]) continue; … … 100 102 101 103 /* identify the ccd on the basis of the photcode name */ 102 pname = GetPhotcodeNamebyCode (image[i]. source);104 pname = GetPhotcodeNamebyCode (image[i].photcode); 103 105 filter = photcode[0].name; 104 106 sprintf (base, "%s.%s.", MOSAICNAME, filter); … … 111 113 /* add this measurement to the grid cell for this chip */ 112 114 ave = measure[0].averef; 113 ra = catalog[cat].average[ave].R - measure[0].dR _PS/ 3600.0;114 dec = catalog[cat].average[ave].D - measure[0].dD _PS/ 3600.0;115 ra = catalog[cat].average[ave].R - measure[0].dR / 3600.0; 116 dec = catalog[cat].average[ave].D - measure[0].dD / 3600.0; 115 117 116 118 /* X,Y always positive-definite in range 0,0 - dX, dY */ … … 133 135 return; 134 136 } 135 /* fprintf (stderr, "can't find source image for this measurement: %d (%d)\n", measure[0].t, measure[0]. source); */137 /* fprintf (stderr, "can't find source image for this measurement: %d (%d)\n", measure[0].t, measure[0].photcode); */ 136 138 } 137 139 … … 145 147 146 148 if (image[i].code & IMAGE_BAD) return (NO_MAG); 147 value = image[i].Mcal _PS;149 value = image[i].Mcal; 148 150 return (value); 149 151 } … … 203 205 Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]); 204 206 list[N] = Msys - Mrel - Mmos - Mgrid; 205 dlist[N] = MAX (catalog[c].measure[m].dM _PS, MIN_ERROR);207 dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR); 206 208 N++; 207 209 } … … 219 221 220 222 liststats (list, dlist, N, &stats); 221 image[i].Mcal _PS= stats.mean;222 image[i].dMcal _PS= stats.sigma;223 image[i].Mcal = stats.mean; 224 image[i].dMcal = stats.sigma; 223 225 image[i].Xm = 100.0*log10(stats.chisq); 224 226 } … … 251 253 for (i = N = 0; i < Nimage; i++) { 252 254 if (image[i].code & IMAGE_BAD) continue; 253 mlist[N] = fabs (image[i].Mcal _PS);254 slist[N] = image[i].dMcal _PS;255 mlist[N] = fabs (image[i].Mcal); 256 slist[N] = image[i].dMcal; 255 257 dlist[N] = 1; 256 258 N++; … … 268 270 mark = FALSE; 269 271 image[i].code &= ~ID_IMAGE_POOR; 270 mark = (image[i].dMcal _PS > MaxScatter) || (fabs(image[i].Mcal_PS- MedOffset) > MaxOffset);272 mark = (image[i].dMcal > MaxScatter) || (fabs(image[i].Mcal - MedOffset) > MaxOffset); 271 273 if (mark) { 272 274 Nmark ++; … … 298 300 /**** dMcal vs airmass ****/ 299 301 for (i = 0; i < Nimage; i++) { 300 Mlist[i] = image[i].Mcal _PS;301 dlist[i] = image[i].dMcal _PS;302 xlist[i] = image[i].secz _PS;302 Mlist[i] = image[i].Mcal; 303 dlist[i] = image[i].dMcal; 304 xlist[i] = image[i].secz; 303 305 } 304 306 … … 318 320 bzero (Mlist, NBIN*sizeof(double)); 319 321 for (i = 0; i < Nimage; i++) { 320 bin = image[i].dMcal _PS/ 0.00025;322 bin = image[i].dMcal / 0.00025; 321 323 bin = MAX (0, MIN (NBIN - 1, bin)); 322 324 Mlist[bin] += 1.0; … … 420 422 if (image[i].code & IMAGE_BAD) continue; 421 423 422 list[n] = image[i].Mcal _PS;424 list[n] = image[i].Mcal; 423 425 dlist[n] = 1; 424 426 n++; … … 448 450 if (image[i].code & IMAGE_BAD) continue; 449 451 450 list[n] = image[i].dMcal _PS;452 list[n] = image[i].dMcal; 451 453 dlist[n] = 1; 452 454 n++; -
trunk/Ohana/src/relphot/src/MosaicOps.c
r9633 r12332 36 36 37 37 /* select valid mosaic images by photcode */ 38 pname = GetPhotcodeNamebyCode (image[i]. source);38 pname = GetPhotcodeNamebyCode (image[i].photcode); 39 39 status = strncmp (pname, MOSAICNAME, strlen (MOSAICNAME)); 40 40 if (status) continue; … … 69 69 mosaic[Nmosaic].Xm = 0.0; 70 70 mosaic[Nmosaic].code = image[i].code; 71 mosaic[Nmosaic].secz = image[i].secz _PS;71 mosaic[Nmosaic].secz = image[i].secz; 72 72 73 73 /* add image to mosaic image list */ … … 134 134 Dmin = MIN (Dmin, D); 135 135 Dmax = MAX (Dmax, D); 136 Mcal += image[m].Mcal _PS;137 dMcal += image[m].dMcal _PS;136 Mcal += image[m].Mcal; 137 dMcal += image[m].dMcal; 138 138 Xm += image[m].Xm; 139 139 /* we are using mosaic.Mcal, not image.Mcal. reset image.Mcal */ 140 image[m].Mcal _PS= 0.0;141 image[m].dMcal _PS= image[m].Xm = NO_MAG;140 image[m].Mcal = 0.0; 141 image[m].dMcal = image[m].Xm = NO_MAG; 142 142 } 143 143 dS /= Nimlist[i]; … … 179 179 for (j = 0; j < Nimlist[i]; j++) { 180 180 im = imlist[i][j]; 181 image[im].Mcal _PS= mosaic[i].Mcal;182 image[im].dMcal _PS= mosaic[i].dMcal;181 image[im].Mcal = mosaic[i].Mcal; 182 image[im].dMcal = mosaic[i].dMcal; 183 183 image[im].Xm = mosaic[i].Xm; 184 184 image[im].code |= (mosaic[i].code & ID_IMAGE_FEW); … … 247 247 if (catalog[i].measure[j].t > TSTOP) continue; 248 248 } 249 ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j]. source);249 ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[j].photcode); 250 250 if (photcode[0].code != ecode) continue; 251 251 matchMosaics (catalog, j, i); … … 266 266 if (USE_GRID) { 267 267 ave = catalog[cat].measure[meas].averef; 268 ra = catalog[cat].average[ave].R _PS - catalog[cat].measure[meas].dR_PS/ 3600.0;269 dec = catalog[cat].average[ave].D _PS - catalog[cat].measure[meas].dD_PS/ 3600.0;268 ra = catalog[cat].average[ave].R - catalog[cat].measure[meas].dR / 3600.0; 269 dec = catalog[cat].average[ave].D - catalog[cat].measure[meas].dD / 3600.0; 270 270 271 271 /* X,Y always positive-definite in range 0,0 - dX, dY */ … … 355 355 Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]); 356 356 list[N] = Msys - Mrel - Mcal - Mgrid; 357 dlist[N] = MAX (catalog[c].measure[m].dM _PS, MIN_ERROR);357 dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR); 358 358 Mlist[N] = Msys; 359 359 dMlist[N] = list[N]; … … 596 596 597 597 ave = catalog[c].measure[m].averef; 598 xlist[N] = catalog[c].average[ave].R - catalog[c].measure[m].dR _PS/ 3600.0;599 ylist[N] = catalog[c].average[ave].D - catalog[c].measure[m].dD _PS/ 3600.0;598 xlist[N] = catalog[c].average[ave].R - catalog[c].measure[m].dR / 3600.0; 599 ylist[N] = catalog[c].average[ave].D - catalog[c].measure[m].dD / 3600.0; 600 600 N++; 601 601 } -
trunk/Ohana/src/relphot/src/StarOps.c
r10506 r12332 28 28 if (catalog[cat].average[ave].code & STAR_BAD) return (NO_MAG); 29 29 30 value = PhotPrimary ? catalog[cat].average[ave].M : catalog[cat].secfilt[PhotNsec*ave+PhotSec].M_PS;30 value = catalog[cat].secfilt[PhotNsec*ave+PhotSec].M; 31 31 return (value); 32 32 } … … 65 65 Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 66 66 list[N] = Msys - Mcal - Mmos - Mgrid; 67 dlist[N] = MAX (catalog[i].measure[m].dM _PS, MIN_ERROR);67 dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR); 68 68 N++; 69 69 } … … 76 76 liststats (list, dlist, N, &stats); 77 77 78 if (PhotPrimary) { 79 catalog[i].average[j].M = stats.mean; 80 catalog[i].average[j].dM = stats.sigma; 81 catalog[i].average[j].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG; 82 } else { 83 catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS = stats.mean; 84 catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS = stats.sigma; 85 catalog[i].secfilt[PhotNsec*j+PhotSec].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG; 86 } 78 catalog[i].secfilt[PhotNsec*j+PhotSec].M = stats.mean; 79 catalog[i].secfilt[PhotNsec*j+PhotSec].dM = stats.sigma; 80 catalog[i].secfilt[PhotNsec*j+PhotSec].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG; 87 81 } 88 82 } … … 130 124 Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 131 125 list[N] = Msys - Mcal - Mmos - Mgrid; 132 dlist[N] = MAX (catalog[i].measure[m].dM _PS, MIN_ERROR);126 dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR); 133 127 N++; 134 128 } … … 139 133 140 134 /* use sigma or error in dM for output? */ 141 if (PhotPrimary) { 142 catalog[i].average[j].M = stats.mean; 143 catalog[i].average[j].dM = MAX (stats.sigma, stats.error); 144 catalog[i].average[j].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG; 145 } else { 146 catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS = stats.mean; 147 catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS = MAX (stats.error, stats.sigma); 148 catalog[i].secfilt[PhotNsec*j+PhotSec].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG; 149 } 135 catalog[i].secfilt[PhotNsec*j+PhotSec].M = stats.mean; 136 catalog[i].secfilt[PhotNsec*j+PhotSec].dM = MAX (stats.error, stats.sigma); 137 catalog[i].secfilt[PhotNsec*j+PhotSec].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG; 150 138 } 151 139 } … … 178 166 if (Mmos == NO_IMAGE) continue; 179 167 if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue; 180 catalog[i].measure[m].Mcal _PS= Mcal + Mmos + Mgrid;168 catalog[i].measure[m].Mcal = Mcal + Mmos + Mgrid; 181 169 } 182 170 } … … 205 193 for (j = 0; j < catalog[i].Naverage; j++) { 206 194 if (catalog[i].average[j].code & STAR_BAD) continue; 207 Xm = PhotPrimary ? catalog[i].average[j].Xm :catalog[i].secfilt[PhotNsec*j+PhotSec].Xm;195 Xm = catalog[i].secfilt[PhotNsec*j+PhotSec].Xm; 208 196 if (Xm == -1) continue; 209 197 Chisq = pow (10.0, 0.01*Xm); 210 198 xlist[Ntot] = Chisq; 211 slist[Ntot] = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;199 slist[Ntot] = catalog[i].secfilt[PhotNsec*j+PhotSec].dM; 212 200 dlist[Ntot] = 1; 213 201 Ntot ++; … … 225 213 for (i = 0; i < Ncatalog; i++) { 226 214 for (j = 0; j < catalog[i].Naverage; j++) { 227 dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;228 Xm = PhotPrimary ? catalog[i].average[j].Xm :catalog[i].secfilt[PhotNsec*j+PhotSec].Xm;215 dM = catalog[i].secfilt[PhotNsec*j+PhotSec].dM; 216 Xm = catalog[i].secfilt[PhotNsec*j+PhotSec].Xm; 229 217 Chisq = pow (10.0, 0.01*Xm); 230 218 mark = (dM > MaxScatter) || (Xm == NO_MAG) || (Chisq > MaxChisq); … … 295 283 Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 296 284 list[N] = Msys - Mcal - Mmos - Mgrid; 297 dlist[N] = MAX (catalog[i].measure[m].dM _PS, MIN_ERROR);285 dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR); 298 286 N++; 299 287 } … … 331 319 Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 332 320 list[N] = Msys - Mcal - Mmos - Mgrid; 333 dlist[N] = MAX (catalog[i].measure[m].dM _PS, MIN_ERROR);321 dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR); 334 322 ilist[N] = m; 335 323 N++; … … 422 410 if (catalog[i].average[j].code & STAR_BAD) continue; 423 411 424 Xm = PhotPrimary ? catalog[i].average[j].Xm :catalog[i].secfilt[PhotNsec*j+PhotSec].Xm;412 Xm = catalog[i].secfilt[PhotNsec*j+PhotSec].Xm; 425 413 if (Xm == NO_MAG) continue; 426 414 list[n] = pow (10.0, 0.01*Xm); … … 458 446 if (catalog[i].average[j].code & STAR_BAD) continue; 459 447 460 dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;448 dM = catalog[i].secfilt[PhotNsec*j+PhotSec].dM; 461 449 list[n] = dM; 462 450 dlist[n] = 1; … … 487 475 for (j = 0; j < catalog[i].Naverage; j++) { 488 476 if (catalog[i].average[j].code & STAR_BAD) continue; 489 dMrel = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS;477 dMrel = catalog[i].secfilt[PhotNsec*j+PhotSec].dM; 490 478 bin = dMrel / 0.00025; 491 479 bin = MAX (0, MIN (NBIN-1, bin)); … … 518 506 for (j = 0; j < catalog[i].Naverage; j++) { 519 507 if (catalog[i].average[j].code & STAR_BAD) continue; 520 xlist[N] = PhotPrimary ? catalog[i].average[j].M : catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS;521 value = PhotPrimary ? catalog[i].average[j].Xm :catalog[i].secfilt[PhotNsec*j+PhotSec].Xm;508 xlist[N] = catalog[i].secfilt[PhotNsec*j+PhotSec].M; 509 value = catalog[i].secfilt[PhotNsec*j+PhotSec].Xm; 522 510 if (value == NO_MAG) continue; 523 511 ylist[N] = 0.01*value; -
trunk/Ohana/src/relphot/src/bcatalog.c
r11062 r12332 27 27 28 28 if (RESET) { 29 float *p; 30 p = (PhotPrimary) ? &subcatalog[0].average[Naverage].M : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].M_PS; 31 *p = NO_MAG; 32 p = (PhotPrimary) ? &subcatalog[0].average[Naverage].dM : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].dM_PS; 33 *p = NO_MAG; 29 subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].M = NO_MAG; 30 subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].dM = NO_MAG; 34 31 subcatalog[0].average[Naverage].code &= ~ID_STAR_FEW; 35 32 subcatalog[0].average[Naverage].code &= ~ID_STAR_POOR; … … 42 39 43 40 /* select measurements by photcode */ 44 ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[offset]. source);41 ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[offset].photcode); 45 42 if (ecode != photcode[0].code) continue; 46 43 … … 60 57 61 58 /* select measurements by measurement error */ 62 if ((SIGMA_LIM > 0) && (catalog[0].measure[offset].dM _PS> SIGMA_LIM)) continue;59 if ((SIGMA_LIM > 0) && (catalog[0].measure[offset].dM > SIGMA_LIM)) continue; 63 60 64 61 /* select measurements by mag limit */ … … 73 70 subcatalog[0].measure[Nmeasure].averef = Naverage; 74 71 if (RESET) { 75 subcatalog[0].measure[Nmeasure].Mcal _PS= 0;72 subcatalog[0].measure[Nmeasure].Mcal = 0; 76 73 subcatalog[0].measure[Nmeasure].flags &= 0xff00; 77 74 subcatalog[0].measure[Nmeasure].flags &= ~ID_MEAS_POOR; -
trunk/Ohana/src/relphot/src/initialize.c
r7080 r12332 13 13 exit (1); 14 14 } 15 if ( (photcode[0].type != PHOT_PRI) && (photcode[0].type != PHOT_SEC)) {15 if (photcode[0].type != PHOT_SEC) { 16 16 fprintf (stderr, "photcode %s is not a primary or secondary filter\n", argv[N]); 17 17 exit (1); 18 18 } 19 19 20 PhotPrimary = (photcode[0].type == PHOT_PRI);21 20 PhotNsec = GetPhotcodeNsecfilt (); 22 21 PhotSec = GetPhotcodeNsec (photcode[0].code); -
trunk/Ohana/src/relphot/src/plot_scatter.c
r9633 r12332 36 36 if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue; 37 37 38 Mrel = PhotPrimary ? catalog[i].average[j].M : catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS;38 Mrel = catalog[i].secfilt[PhotNsec*j+PhotSec].M; 39 39 xlist[N] = Mrel; 40 40 ylist[N] = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]) - Mcal - Mmos - Mgrid - Mrel; -
trunk/Ohana/src/relphot/src/relphot.c
r10506 r12332 44 44 /* load catalog data from region files */ 45 45 catalog = load_catalogs (skylist, &Ncatalog); 46 47 /* add in a loop over the catalogs calling dvo_catalog_chipcoords */ 46 48 47 49 /* match measurements with images, mosaics */ -
trunk/Ohana/src/relphot/src/select_images.c
r7082 r12332 76 76 77 77 /* exclude images by photcode */ 78 ecode = GetPhotcodeEquivCodebyCode (timage[i]. source);78 ecode = GetPhotcodeEquivCodebyCode (timage[i].photcode); 79 79 if (ecode != photcode[0].code) continue; 80 80 … … 135 135 if (RESET) { 136 136 assignMcal (&image[nimage], (double *) NULL, -1); 137 image[nimage].dMcal _PS= NO_MAG;137 image[nimage].dMcal = NO_MAG; 138 138 image[nimage].code &= ~ID_IMAGE_POOR; 139 139 } -
trunk/Ohana/src/relphot/src/setExclusions.c
r6683 r12332 3 3 int setExclusions (Catalog *catalog, int Ncatalog) { 4 4 5 int i, j, k, m, Narea, Nnocal, ecode;5 int i, j, k, m, Narea, Nnocal, Ngood, ecode; 6 6 Coords *coords; 7 7 double r, d, x, y; 8 8 9 N nocal = Narea = 0;9 Ngood = Nnocal = Narea = 0; 10 10 for (i = 0; i < Ncatalog; i++) { 11 11 for (j = 0; j < catalog[i].Naverage; j++) { … … 14 14 15 15 /* select measurements by photcode */ 16 ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[m]. source);16 ecode = GetPhotcodeEquivCodebyCode (catalog[i].measure[m].photcode); 17 17 if (ecode != photcode[0].code) goto mark_nocal; 18 18 … … 25 25 /* select measurements by mag limit */ 26 26 if (AreaSelect) { 27 r = catalog[i].average[j].R + catalog[i].measure[m].dR _PS/ 3600.0;28 d = catalog[i].average[j].D + catalog[i].measure[m].dD _PS/ 3600.0;27 r = catalog[i].average[j].R + catalog[i].measure[m].dR / 3600.0; 28 d = catalog[i].average[j].D + catalog[i].measure[m].dD / 3600.0; 29 29 if ((coords = getCoords (m, i)) == NULL) goto markbad; 30 30 RD_to_XY (&x, &y, r, d, coords); … … 34 34 if (y > AreaYmax) goto markbad; 35 35 } 36 Ngood ++; 36 37 continue; 37 38 … … 50 51 if (VERBOSE) fprintf (stderr, "%d measurements marked by area\n", Narea); 51 52 if (VERBOSE) fprintf (stderr, "%d measurements marked nocal\n", Nnocal); 53 if (VERBOSE) fprintf (stderr, "%d measurements kept for analysis\n", Ngood); 52 54 return (TRUE); 53 55 } -
trunk/Ohana/src/relphot/src/setMrelFinal.c
r10506 r12332 4 4 5 5 int i, j, m, ecode; 6 float *p;7 short *q;8 6 9 7 /* if we reset the catalog, reset all the current measurements */ … … 11 9 12 10 for (i = 0; i < catalog[0].Naverage; i++) { 13 p = (PhotPrimary) ? &catalog[0].average[i].M : &catalog[0].secfilt[PhotNsec*i+PhotSec].M_PS; 14 *p = NO_MAG; 15 p = (PhotPrimary) ? &catalog[0].average[i].dM : &catalog[0].secfilt[PhotNsec*i+PhotSec].dM_PS; 16 *p = NO_MAG; 17 q = (PhotPrimary) ? &catalog[0].average[i].Xm : &catalog[0].secfilt[PhotNsec*i+PhotSec].Xm; 18 *q = NO_MAG; 11 catalog[0].secfilt[PhotNsec*i+PhotSec].M = NO_MAG; 12 catalog[0].secfilt[PhotNsec*i+PhotSec].dM = NO_MAG; 13 catalog[0].secfilt[PhotNsec*i+PhotSec].Xm = NO_MAG; 19 14 20 15 m = catalog[0].average[i].offset; … … 22 17 23 18 /* select measurements by photcode */ 24 ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m]. source);19 ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m].photcode); 25 20 if (ecode != photcode[0].code) continue; 26 21 … … 31 26 } 32 27 33 catalog[0].measure[m].Mcal _PS= 0;28 catalog[0].measure[m].Mcal = 0; 34 29 catalog[0].measure[m].flags &= 0xff00; 35 30 catalog[0].measure[m].flags &= ~ID_MEAS_POOR; … … 97 92 /** never use these measurements (wrong photcode, bad time range) */ 98 93 /* skipped via NOCAL, don't mark as skipped */ 99 ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m]. source);94 ecode = GetPhotcodeEquivCodebyCode (catalog[0].measure[m].photcode); 100 95 if (ecode != photcode[0].code) continue; 101 96
Note:
See TracChangeset
for help on using the changeset viewer.
