Changeset 41606 for branches/eam_branches/relphot.20210521/src/StarOps.c
- Timestamp:
- May 21, 2021, 2:04:53 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/relphot.20210521/src/StarOps.c
r41603 r41606 8 8 Catalog *catalog; 9 9 int Ncatalog; 10 FlatCorrectionTable *flatcorr;11 10 SetMrelInfo summary; 12 11 } ThreadInfo; … … 14 13 // ** internal functions: 15 14 void *setMrel_worker (void *data); 16 int setMrel_threaded (Catalog *catalog, int Ncatalog , FlatCorrectionTable *flatcorr);17 int setMrel_catalog (Catalog *catalog, int Nc, int pass, FlatCorrectionTable *flatcorr,SetMrelInfo *results, int Nsecfilt);15 int setMrel_threaded (Catalog *catalog, int Ncatalog); 16 int setMrel_catalog (Catalog *catalog, int Nc, int pass, SetMrelInfo *results, int Nsecfilt); 18 17 int print_measure_set (Average *average, SecFilt *secfilt, Measure *measure); 19 18 … … 298 297 // * setMrelOutput updates average EXT flags (PS1 and 2MASS) 299 298 300 int setMrel (Catalog *catalog, int Ncatalog , FlatCorrectionTable *flatcorr) {299 int setMrel (Catalog *catalog, int Ncatalog) { 301 300 302 301 int i; 303 302 304 303 if (NTHREADS) { 305 int status = setMrel_threaded (catalog, Ncatalog , flatcorr);304 int status = setMrel_threaded (catalog, Ncatalog); 306 305 return status; 307 306 } … … 314 313 315 314 for (i = 0; i < Ncatalog; i++) { 316 setMrel_catalog_alt (catalog, i, FALSE, flatcorr,&results, Nsecfilt);315 setMrel_catalog_alt (catalog, i, FALSE, &results, Nsecfilt); 317 316 SetMrelInfoAccum (&summary, &results); 318 317 } … … 326 325 327 326 // setMrelOutput is NOT threaded because we read/write catalogs one at a time (for now) 328 int setMrelOutput (Catalog *catalog, int Ncatalog , FlatCorrectionTable *flatcorr) {327 int setMrelOutput (Catalog *catalog, int Ncatalog) { 329 328 330 329 int i; … … 337 336 338 337 for (i = 0; i < Ncatalog; i++) { 339 setMrel_catalog_alt (catalog, i, TRUE, flatcorr,&results, Nsecfilt);338 setMrel_catalog_alt (catalog, i, TRUE, &results, Nsecfilt); 340 339 SetMrelInfoAccum (&summary, &results); 341 340 } … … 347 346 } 348 347 349 int setMrel_threaded (Catalog *catalog, int Ncatalog , FlatCorrectionTable *flatcorr) {348 int setMrel_threaded (Catalog *catalog, int Ncatalog) { 350 349 351 350 int i; … … 374 373 threadinfo[i].catalog = catalog; 375 374 threadinfo[i].Ncatalog = Ncatalog; 376 threadinfo[i].flatcorr = flatcorr;377 375 SetMrelInfoInit (&threadinfo[i].summary, FALSE); 378 376 pthread_create (&threads[i], NULL, setMrel_worker, &threadinfo[i]); … … 435 433 436 434 Catalog *catalog = threadinfo->catalog; 437 FlatCorrectionTable *flatcorr = threadinfo->flatcorr; 438 439 setMrel_catalog_alt (catalog, i, FALSE, flatcorr, &results, Nsecfilt); 435 436 setMrel_catalog_alt (catalog, i, FALSE, &results, Nsecfilt); 440 437 SetMrelInfoAccum (&threadinfo->summary, &results); 441 438 } … … 474 471 475 472 /* set measure.Mcal for all measures except ID_MEAS_NOCAL and ID_IMAGE_PHOTOM_NOCAL */ 476 int setMcalOutput (Catalog *catalog, int Ncatalog , FlatCorrectionTable *flatcorr) {473 int setMcalOutput (Catalog *catalog, int Ncatalog) { 477 474 478 475 int i; … … 667 664 # define NSIGMA_CLIP 3.0 668 665 # define NSIGMA_REJECT 5.0 669 void clean_measures (Catalog *catalog, int Ncatalog, int final , FlatCorrectionTable *flatcorr) {666 void clean_measures (Catalog *catalog, int Ncatalog, int final) { 670 667 671 668 off_t j, k, m, Nmax, Ndel, Nave; … … 833 830 } 834 831 835 StatType statsStarN (Catalog *catalog, int Ncatalog, int Nsec, int seccode , FlatCorrectionTable *flatcorr) {832 StatType statsStarN (Catalog *catalog, int Ncatalog, int Nsec, int seccode) { 836 833 837 834 off_t j, k, m, Ntot; … … 1106 1103 float MrelPSF = getMrel (catalog, m, c, MAG_CLASS_PSF, MAG_SRC_CHP); // average magnitude 1107 1104 // float Mgrid = getMgridTiny (&catalog[c].measureT[m]); // camera offset (deprecated?) 1108 // float Mflat = getMflat (m, c, flatcorr,catalog); // flat-field correction1105 // float Mflat = getMflat (m, c, catalog); // flat-field correction 1109 1106 1110 1107 off_t n = catalog[c].measureT[m].averef; … … 1121 1118 fclose (fout); 1122 1119 } 1120 1121 // maybe make this a macro 1122 float getMflat (off_t meas, int cat, Catalog *catalog) { 1123 float offset = catalog[cat].measureT[meas].Mflat; 1124 if (!isfinite(offset)) { 1125 offset = 0.0; 1126 } 1127 return (offset); 1128 }
Note:
See TracChangeset
for help on using the changeset viewer.
