Changeset 41603 for branches/eam_branches/relphot.20210521/src/ImageOps.c
- Timestamp:
- May 21, 2021, 10:03:06 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/relphot.20210521/src/ImageOps.c
r41557 r41603 319 319 } 320 320 321 int findCCD (off_t idx, off_t meas, int cat, MeasureTiny *measure) {322 323 int ccdnum;324 double X, Y;325 char *pname, *filter, *p, base[256];326 327 /* identify the ccd on the basis of the photcode name */328 pname = GetPhotcodeNamebyCode (image[idx].photcode);329 330 // skip measurements which do not match one of the requested photcodes (331 // (do we not already exclude in bcatalog -- maybe needed for reload_objects?332 int Ns = GetActivePhotcodeIndex (measure[0].photcode);333 if (Ns < 0) return FALSE;334 335 filter = photcodes[Ns][0].name;336 sprintf (base, "%s.%s.", MOSAICNAME, filter);337 if (strncmp (pname, base, strlen (base))) return (FALSE);338 p = pname + strlen(base);339 340 /* p is pointing at the DETECTOR ID part of the photcode: CAMERA.FILTER.DETECTOR341 for now, we will let this be of the form SSSSnn where SSS is an arbitrary string342 and nn is an integer -> ccdnum */343 344 /// XXX we have an inconsistency here wrt dvo.layout and dvo.photcode345 346 while (!isdigit(*p) && *p) p++;347 if (*p == 0) return (FALSE);348 ccdnum = atoi (p);349 350 /* ccdnum is an integer, but not necessarily a sequence number. when the camera layout is351 constructed, there will be null values for undefined ccdnums */352 353 // old code to add this measurement to the grid cell for this chip354 // ave = measureT[0].averef;355 // ra = catalog[cat].averageT[ave].R - measureT[0].dR / 3600.0;356 // dec = catalog[cat].averageT[ave].D - measureT[0].dD / 3600.0;357 // RD_to_XY (&X, &Y, ra, dec, &image[i].coords);358 359 // XXX we can now use these values (but need to be careful about old formats)360 X = measure[0].Xccd;361 Y = measure[0].Yccd;362 setGridMeasure (meas, cat, X, Y, ccdnum);363 364 return (TRUE);365 }366 367 321 void matchImage (Catalog *catalog, off_t meas, int cat, int doImageList) { 368 322 369 323 off_t idx, ID; 370 int status;371 324 MeasureTiny *measure; 372 325 … … 380 333 } 381 334 catalog[cat].measureT[meas].myDet = TRUE; 382 383 if (USE_GRID) {384 status = findCCD (idx, meas, cat, measure);385 if (!status) {386 if (VERBOSE2) fprintf (stderr, "failed to determine CCD for "OFF_T_FMT", %d\n", meas, cat);387 return;388 }389 }390 335 391 336 // index for (catalog, measure) -> image … … 690 635 continue; 691 636 } 692 float Mgrid = getMgrid (m, c);637 float Mgrid = getMgridTiny (&catalog[c].measureT[m]); 693 638 if (isnan(Mgrid)) { 694 639 Ngrid++; … … 889 834 continue; 890 835 } 891 float Mgrid = getMgrid (m, c);836 float Mgrid = getMgridTiny (&catalog[c].measureT[m]); 892 837 if (isnan(Mgrid)) { 893 838 Ngrid++; … … 1179 1124 Mgrp = getMgrp (m, c, catalog[c].measureT[m].airmass, NULL); 1180 1125 if (isnan(Mgrp)) continue; 1181 Mgrid = getMgrid (m, c);1126 Mgrid = getMgridTiny (&catalog[c].measureT[m]); 1182 1127 if (isnan(Mgrid)) continue; 1183 1128 N++;
Note:
See TracChangeset
for help on using the changeset viewer.
