Changeset 41362
- Timestamp:
- May 22, 2020, 5:12:02 PM (6 years ago)
- Location:
- branches/eam_branches/relphot.20200519
- Files:
-
- 2 added
- 8 edited
-
Makefile (modified) (2 diffs)
-
include/relphot.h (modified) (11 diffs)
-
src/MosaicOps.c (modified) (1 diff)
-
src/ReadTGroupFile.c (added)
-
src/StarOps.c (modified) (12 diffs)
-
src/TGroupOps.c (added)
-
src/args.c (modified) (1 diff)
-
src/load_images.c (modified) (1 diff)
-
src/relphot_images.c (modified) (5 diffs)
-
src/relphot_parallel_images.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/relphot.20200519/Makefile
r39636 r41362 32 32 $(SRC)/BrightCatalog.$(ARCH).o \ 33 33 $(SRC)/MosaicOps.$(ARCH).o \ 34 $(SRC)/TGroupOps.$(ARCH).o \ 35 $(SRC)/ReadTGroupFile.$(ARCH).o \ 34 36 $(SRC)/SetSignals.$(ARCH).o \ 35 37 $(SRC)/Shutdown.$(ARCH).o \ … … 89 91 $(SRC)/BrightCatalog.$(ARCH).o \ 90 92 $(SRC)/MosaicOps.$(ARCH).o \ 93 $(SRC)/TGroupOps.$(ARCH).o \ 94 $(SRC)/ReadTGroupFile.$(ARCH).o \ 91 95 $(SRC)/SetSignals.$(ARCH).o \ 92 96 $(SRC)/Shutdown.$(ARCH).o \ -
branches/eam_branches/relphot.20200519/include/relphot.h
r40386 r41362 90 90 } Mosaic; 91 91 92 typedef struct { 93 unsigned int start; 94 unsigned int stop; 95 short photcode; 96 float McalPSF; 97 float McalAPER; 98 float dMcal; 99 float dMsys; 100 float McalChiSq; 101 unsigned short nFitPhotom; 102 unsigned int flags; 103 104 off_t Nimage; 105 off_t NIMAGE; 106 off_t *image; 107 108 off_t Nmeasure; 109 off_t NMEASURE; 110 off_t *measure; 111 112 off_t Ncatalog; 113 off_t NCATALOG; 114 off_t *catalog; 115 } TGroup; 116 92 117 typedef enum { 93 118 STATS_NONE, … … 145 170 int Ncal; 146 171 int Nmos; 172 int Ngrp; 147 173 int Ngrid; 148 174 … … 305 331 int VERBOSE_IMAGE; 306 332 int MOSAIC_ZEROPT; 333 int TGROUP_ZEROPT; 307 334 308 335 int TEST_IMAGE1; … … 403 430 void clean_measures PROTO((Catalog *catalog, int Ncatalog, int final, FlatCorrectionTable *flatcorr)); 404 431 void clean_mosaics PROTO((void)); 432 void clean_tgroups PROTO((void)); 405 433 void clean_stars PROTO((Catalog *catalog, int Ncatalog)); 406 434 int corner_check PROTO((double *x1, double *y1, double *x2, double *y2)); … … 410 438 void findImages PROTO((Catalog *catalog, int Ncatalog, int doImageList)); 411 439 int findMosaics PROTO((Catalog *catalog, int Ncatalog, int doMosaicList)); 440 int findTGroups PROTO((Catalog *catalog, int Ncatalog)); 412 441 413 442 void clearImages (void); … … 428 457 void freeImageBins PROTO((int Ncatalog, int doImageList)); 429 458 void freeMosaicBins PROTO((int Ncatalog, int doMosaicList)); 459 void freeTGroupBins PROTO((int Ncatalog, int doTGroupList)); 460 430 461 void free_catalogs PROTO((Catalog *catalog, int Ncatalog)); 431 462 int gcatalog PROTO((Catalog *catalog, int FINAL)); … … 437 468 float getMgrid PROTO((off_t meas, int cat)); 438 469 float getMmos PROTO((off_t meas, int cat)); 470 float getMgrp PROTO((off_t meas, int cat)); 439 471 float getMrel PROTO((Catalog *catalog, off_t meas, int cat, dvoMagClassType class, dvoMagSourceType source)); 440 472 short getUbercalDist PROTO((off_t meas, int cat)); … … 452 484 void initMosaicGrid PROTO((Image *image, off_t Nimage)); 453 485 void initMosaics PROTO((Image *subset, off_t Nsubset, Image *image, char *inSubset, off_t Nimage)); 486 void initTGroups PROTO((Image *subset, off_t *LineNumber, off_t Nsubset)); 487 void initTGroupBins PROTO((Catalog *catalog, int Ncatalog)); 454 488 void initMrel PROTO((Catalog *catalog, int Ncatalog)); 455 489 RelphotMode initialize PROTO((int argc, char **argv)); … … 460 494 int liststats_irls PROTO((StatDataSet *dataset, int Npoints, StatType *stats)); 461 495 496 unsigned int *ReadTGroupFile PROTO((FILE *f, int *nelem)); 497 void loadTGroups PROTO((char *filename)); 498 void initTGroupsMcal PROTO((void)); 499 TGroup *getTGroupForImage PROTO((off_t im)); 500 off_t findTGroup PROTO((unsigned int start, int photcode)); 501 462 502 Catalog *load_catalogs PROTO((SkyList *skylist, int *Ncatalog, int hostID, char *hostpath, char *syncfile)); 463 503 Catalog *load_catalogs_parallel PROTO((SkyList *sky, int *Ncatalog, char *syncfile)); … … 470 510 void matchImage PROTO((Catalog *catalog, off_t meas, int cat, int doImageList)); 471 511 void matchMosaics PROTO((Catalog *catalog, off_t meas, int cat, int doMosaicList)); 512 void matchTGroups PROTO((Catalog *catalog, off_t meas, int cat)); 513 472 514 double opening_angle PROTO((double x1, double y1, double x2, double y2, double x3, double y3)); 473 515 void plot_chisq PROTO((Catalog *catalog, int Ncatalog)); … … 491 533 int setExclusions PROTO((Catalog *catalog, int Ncatalog, int verbose)); 492 534 void setMcal PROTO((Catalog *catalog, int Poor, FlatCorrectionTable *flatcorr)); 493 void setMcalFinal PROTO((void)); 535 void setMcalFromMosaics PROTO((void)); 536 void setMcalFromTGroups PROTO((void)); 494 537 int setMcalOutput PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 495 538 void setMgrid PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 496 539 int setMmos PROTO((Catalog *catalog, int Poor, FlatCorrectionTable *flatcorr)); 540 int setMgrp PROTO((Catalog *catalog, int Poor, FlatCorrectionTable *flatcorr)); 497 541 int setMrel PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 498 542 void setMrelFinal PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr, int simpleAverage)); -
branches/eam_branches/relphot.20200519/src/MosaicOps.c
r40291 r41362 720 720 } 721 721 722 void setMcalF inal() {722 void setMcalFromMosaics () { 723 723 724 724 off_t i, j, im, Nimage; -
branches/eam_branches/relphot.20200519/src/StarOps.c
r40291 r41362 105 105 results->Ncal = 0; 106 106 results->Nmos = 0; 107 results->Ngrp = 0; 107 108 results->Ngrid = 0; 108 109 } … … 264 265 summary->Ncal += results->Ncal ; 265 266 summary->Nmos += results->Nmos ; 267 summary->Ngrp += results->Ngrp ; 266 268 summary->Ngrid += results->Ngrid; 267 269 } … … 313 315 SetMrelInfoAccum (&summary, &results); 314 316 } 315 if (VERBOSE2) fprintf (stderr, "%d stars with no data in photcode, %d stars marked having too few measurements (Nbad: %d, Ncal: %d, Nmos: %d, Ngr id: %d, Nsys: %d)\n", summary.Ncode, summary.Nfew, summary.Nbad, summary.Ncal, summary.Nmos, summary.Ngrid, summary.Nsys);317 if (VERBOSE2) fprintf (stderr, "%d stars with no data in photcode, %d stars marked having too few measurements (Nbad: %d, Ncal: %d, Nmos: %d, Ngrp: %d, Ngrid: %d, Nsys: %d)\n", summary.Ncode, summary.Nfew, summary.Nbad, summary.Ncal, summary.Nmos, summary.Ngrp, summary.Ngrid, summary.Nsys); 316 318 317 319 SetMrelInfoFree (&results); … … 336 338 SetMrelInfoAccum (&summary, &results); 337 339 } 338 if (VERBOSE2) fprintf (stderr, "%d stars with no data in photcode, %d stars marked having too few measurements (Nbad: %d, Ncal: %d, Nmos: %d, Ngr id: %d, Nsys: %d)\n", summary.Ncode, summary.Nfew, summary.Nbad, summary.Ncal, summary.Nmos, summary.Ngrid, summary.Nsys);340 if (VERBOSE2) fprintf (stderr, "%d stars with no data in photcode, %d stars marked having too few measurements (Nbad: %d, Ncal: %d, Nmos: %d, Ngrp: %d, Ngrid: %d, Nsys: %d)\n", summary.Ncode, summary.Nfew, summary.Nbad, summary.Ncal, summary.Nmos, summary.Ngrp, summary.Ngrid, summary.Nsys); 339 341 340 342 SetMrelInfoFree (&results); … … 393 395 // report stats & summary from the threads 394 396 for (i = 0; i < NTHREADS; i++) { 395 if (VERBOSE2) fprintf (stderr, "setMrel thread %d : %d stars with no data in photcode, %d stars marked having too few measurements (Nbad: %d, Ncal: %d, Nmos: %d, Ngr id: %d, Nsys: %d)\n",397 if (VERBOSE2) fprintf (stderr, "setMrel thread %d : %d stars with no data in photcode, %d stars marked having too few measurements (Nbad: %d, Ncal: %d, Nmos: %d, Ngrp: %d, Ngrid: %d, Nsys: %d)\n", 396 398 i, 397 399 threadinfo[i].summary.Ncode, … … 400 402 threadinfo[i].summary.Ncal, 401 403 threadinfo[i].summary.Nmos, 404 threadinfo[i].summary.Ngrp, 402 405 threadinfo[i].summary.Ngrid, 403 406 threadinfo[i].summary.Nsys); … … 405 408 SetMrelInfoFree (&threadinfo[i].summary); 406 409 } 407 if (VERBOSE2) fprintf (stderr, "total : %d stars with no data in photcode, %d stars marked having too few measurements (Nbad: %d, Ncal: %d, Nmos: %d, Ngr id: %d, Nsys: %d)\n", summary.Ncode, summary.Nfew, summary.Nbad, summary.Ncal, summary.Nmos, summary.Ngrid, summary.Nsys);410 if (VERBOSE2) fprintf (stderr, "total : %d stars with no data in photcode, %d stars marked having too few measurements (Nbad: %d, Ncal: %d, Nmos: %d, Ngrp: %d, Ngrid: %d, Nsys: %d)\n", summary.Ncode, summary.Nfew, summary.Nbad, summary.Ncal, summary.Nmos, summary.Ngrp, summary.Ngrid, summary.Nsys); 408 411 free (threadinfo); 409 412 … … 488 491 float Mmos = getMmos (m, i); 489 492 if (isnan(Mmos)) continue; 493 float Mgrp = getMgrp (m, i); 494 if (isnan(Mgrp)) continue; 490 495 float Mgrid = getMgrid (m, i); 491 496 if (isnan(Mgrid)) continue; … … 502 507 503 508 // set the output calibration 504 catalog[i].measure[m].McalPSF = McalPSF + Mmos + Mgrid; 505 catalog[i].measure[m].McalAPER = useStackAper ? McalAPER + Mmos + Mgrid : McalPSF + Mmos + Mgrid; 509 float Moff = Mmos + Mgrp + Mgrid; 510 catalog[i].measure[m].McalPSF = McalPSF + Moff; 511 catalog[i].measure[m].McalAPER = useStackAper ? McalAPER + Moff : McalPSF + Moff; 506 512 507 513 if (catalog[i].measureT[m].dbFlags & ID_MEAS_PHOTOM_UBERCAL) { … … 662 668 off_t *ilist; 663 669 double *tlist, *list, *dlist; 664 float Msys, Mcal, Mmos, Mgr id;665 int Ncal, Nmos, Ngr id, Nfew;670 float Msys, Mcal, Mmos, Mgrp, Mgrid; 671 int Ncal, Nmos, Ngrp, Ngrid, Nfew; 666 672 667 673 int Nsecfilt = GetPhotcodeNsecfilt (); … … 689 695 690 696 Ndel = Nave = 0; 691 Ncal = Nmos = Ngr id = Nfew = 0;697 Ncal = Nmos = Ngrp = Ngrid = Nfew = 0; 692 698 for (i = 0; i < Ncatalog; i++) { 693 699 for (j = 0; j < catalog[i].Naverage; j++) { … … 724 730 Mmos = getMmos (m, i); 725 731 if (isnan(Mmos)) { Nmos ++; continue; } 732 Mgrp = getMgrp (m, i); 733 if (isnan(Mgrp)) { Ngrp ++; continue; } 726 734 Mgrid = getMgrid (m, i); 727 735 if (isnan(Mgrid)) { Ngrid ++; continue; } -
branches/eam_branches/relphot.20200519/src/args.c
r40386 r41362 315 315 exit (2); 316 316 } 317 } 318 319 // calibrate the photometry by night / time period 320 TGROUP_ZEROPT = FALSE; 321 if ((N = get_argument (argc, argv, "-tgroup"))) { 322 TGROUP_ZEROPT = TRUE; 323 remove_argument (N, &argc, argv); 324 loadTGroups (argv[N]); 325 remove_argument (N, &argc, argv); 317 326 } 318 327 -
branches/eam_branches/relphot.20200519/src/load_images.c
r40291 r41362 110 110 MARKTIME("init images: %f sec\n", dtime); 111 111 112 initTGroups (subset, LineNumber, Nsubset); 113 112 114 return TRUE; 113 115 } -
branches/eam_branches/relphot.20200519/src/relphot_images.c
r40291 r41362 70 70 71 71 initMosaicBins (catalog, Ncatalog, TRUE); 72 initTGroupBins (catalog, Ncatalog); 73 72 74 initGridBins (catalog, Ncatalog); 73 75 initMrel (catalog, Ncatalog); … … 77 79 78 80 findMosaics (catalog, Ncatalog, TRUE); /* also sets Grid values */ 81 MARKTIME("-- set up mosaic indexes: %f sec\n", dtime); 82 83 findTGroups (catalog, Ncatalog); /* also sets Grid values */ 79 84 MARKTIME("-- set up mosaic indexes: %f sec\n", dtime); 80 85 … … 129 134 130 135 setMmos (catalog, FALSE, flatcorr); 136 setMgrp (catalog, FALSE, flatcorr); 137 131 138 setMgrid (catalog, flatcorr); 132 139 MARKTIME("-- set Mrel, Mcal, Mmos, Mgrid : %f sec\n", dtime); … … 172 179 setMcal (catalog, onlyPoorImages, flatcorr); 173 180 setMmos (catalog, onlyPoorImages, flatcorr); 181 setMgrp (catalog, onlyPoorImages, flatcorr); 174 182 MARKTIME("-- finalize Mcal values: %f sec\n", dtime); 175 183 176 setMcalFinal (); // copy per-mosaic calibrations to the images 184 setMcalFromMosaics (); // copy per-mosaic calibrations to the images 185 setMcalFromTGroups (); // copy per-tgroup calibrations to the images 177 186 178 187 if (SAVE_IMAGE_UPDATES) { … … 255 264 // If nloop == 0, the above pass is not performed, in which case 256 265 // the Mcal values passed to the mosaics are not returned to the images... 257 setMcalFinal (); // copy per-mosaic calibrations to the images 266 setMcalFromMosaics (); // copy per-mosaic calibrations to the images 267 setMcalFromTGroups (); // copy per-tgroup calibrations to the images 258 268 } 259 269 -
branches/eam_branches/relphot.20200519/src/relphot_parallel_images.c
r40291 r41362 116 116 setMcal (catalog, FALSE, flatcorr); 117 117 setMmos (catalog, FALSE, flatcorr); 118 // setMgrp (catalog, FALSE, flatcorr); XXX think this through: this may not make sense for tgroups 118 119 MARKTIME("-- set Mrel, Mcal, Mmos, Mgrid : %f sec\n", dtime); 119 120 … … 152 153 setMcal (catalog, onlyPoorImages, flatcorr); 153 154 setMmos (catalog, onlyPoorImages, flatcorr); 155 // setMgrp (catalog, onlyPoorImages, flatcorr); XXX see above 154 156 MARKTIME("-- finalize Mcal values: %f sec\n", dtime); 155 157 156 setMcalFinal (); // copy per-mosaic calibrations to the images 158 setMcalFromMosaics (); // copy per-mosaic calibrations to the images 159 // XXX keep? setMcalFromTGroups (); // copy per-tgroup calibrations to the images 157 160 158 161 share_image_mags (regionHosts, -1);
Note:
See TracChangeset
for help on using the changeset viewer.
