Changeset 34844 for trunk/Ohana/src/relphot
- Timestamp:
- Dec 18, 2012, 10:04:35 AM (14 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 7 edited
- 1 copied
-
. (modified) (1 prop)
-
src/relphot/Makefile (modified) (2 diffs)
-
src/relphot/include/relphot.h (modified) (4 diffs)
-
src/relphot/src/BoundaryTreeOps.c (modified) (1 diff)
-
src/relphot/src/ImageOps.c (modified) (2 diffs)
-
src/relphot/src/StarOps.c (modified) (6 diffs)
-
src/relphot/src/args.c (modified) (1 diff)
-
src/relphot/src/setMrelCatalog.c (copied) (copied from branches/eam_branches/ipp-20121130/Ohana/src/relphot/src/setMrelCatalog.c )
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20121130/Ohana (added) merged: 34818-34822,34825-34827,34830-34831,34835-34837,34841
- Property svn:mergeinfo changed
-
trunk/Ohana/src/relphot/Makefile
r34260 r34844 49 49 $(SRC)/setExclusions.$(ARCH).o \ 50 50 $(SRC)/setMrelFinal.$(ARCH).o \ 51 $(SRC)/setMrelCatalog.$(ARCH).o \ 51 52 $(SRC)/BoundaryTreeOps.$(ARCH).o \ 52 53 $(SRC)/write_coords.$(ARCH).o … … 78 79 $(SRC)/setExclusions.$(ARCH).o \ 79 80 $(SRC)/setMrelFinal.$(ARCH).o \ 81 $(SRC)/setMrelCatalog.$(ARCH).o \ 80 82 $(SRC)/BoundaryTreeOps.$(ARCH).o \ 81 83 $(SRC)/write_coords.$(ARCH).o -
trunk/Ohana/src/relphot/include/relphot.h
r34642 r34844 63 63 64 64 typedef struct { 65 int Nfew; 66 int Ncode; 67 int Nsys; 68 int Nbad; 69 int Ncal; 70 int Nmos; 71 int Ngrid; 72 73 // NOTE: the following arrays are (possibly) pre-allocated and carried down to each 74 // thread. The first 3 (list, dlist, wlist) are used in all relphot analyses; the 75 // others are only used on the final output steps. 76 77 double *list; // list of measure.mag values for a given star 78 double *dlist; // mag errors for a star 79 double *wlist; // weights to use for mean mags 80 double *aplist; // ap mags for a star 81 double *kronlist; // kron mags for a star 82 double *dkronlist; // kron mag errors 83 84 double *psfqf_list; // psfqf for all filters 85 double *psfqfperf_list; // psfqfperf for all filters 86 double *stargal_list; // stargal for all filters 87 88 StatType stats; 89 StatType apstats; 90 StatType kronstats; 91 } SetMrelInfo; 92 93 typedef struct { 65 94 AverageTiny *average; // array of (minimal) average data 66 95 MeasureTiny *measure; // array of (minimal) measure data … … 113 142 114 143 char *BOUNDARY_TREE; 144 145 int SET_MREL_VERSION; 115 146 116 147 double MAG_LIM; … … 239 270 Coords *getCoords PROTO((off_t meas, int cat)); 240 271 off_t getImageEntry PROTO((off_t meas, int cat)); 272 273 float getMcal_alt PROTO((off_t meas, int cat, FlatCorrectionTable *flatcorr, float Xccd, float Yccd)); 241 274 float getMcal PROTO((off_t meas, int cat, FlatCorrectionTable *flatcorr, Catalog *catalog)); 242 275 float getMflat PROTO((off_t meas, int cat, FlatCorrectionTable *flatcorr, Catalog *catalog)); … … 348 381 int load_tree (char *treefile); 349 382 int BoundaryTreePrimaryCell (char *primaryCellName, double ra, double dec); 383 384 int print_measure_set_alt (Average *average, SecFilt *secfilt, Measure *measure); 385 int setMrel_catalog_alt (Catalog *catalog, int Nc, int pass, FlatCorrectionTable *flatcorr, SetMrelInfo *results, int Nsecfilt); 386 int setMrelAverageExposure (off_t meas, int cat, int pass, FlatCorrectionTable *flatcorr, SetMrelInfo *results, Average *average, AverageTiny *averageT, SecFilt *secfilt, Measure *measure, MeasureTiny *measureT, off_t *found); 387 int setMrelAverageStack (off_t meas, int cat, FlatCorrectionTable *flatcorr, SetMrelInfo *results, Average *average, SecFilt *secfilt, Measure *measure, char *primaryCell); 388 int setGlobalObjStats (Average *average, Measure *measure); 389 390 void SetMrelInfoInit (SetMrelInfo *results, int allocLists); -
trunk/Ohana/src/relphot/src/BoundaryTreeOps.c
r34260 r34844 21 21 } 22 22 23 # define USE_PROJECTION_CELL 0 24 # if (USE_PROJECTION_CELL) 23 25 snprintf (primaryCellName, DVO_MAX_PATH, "RINGS.V3.%s", tree->name[zone][band]); 26 # else 27 28 // I have ra, dec, and the primary projection cell. In order to choose the primary skycell, 29 // I just need to project to ra,dec to X,Y based on the center of the cell and then get the subdivision right. 30 31 double x = 0.0; 32 double y = 0.0; 33 BoundaryTreeProjection (&x, &y, ra, dec, tree, zone, band); 34 35 int xi = x / tree->dX[zone][band]; 36 int yi = y / tree->dY[zone][band]; 37 int N = xi + tree->NX_SUB * yi; 38 39 // XXX short-circuit this for now (we should use this code if we make tree have more variable NX,NY values 40 // char format[24], skycellname[128]; 41 // int Ndigit = (int)(log10(tree->NX_SUB*tree->NY_SUB)) + 1 ; 42 // snprintf (format, 24, "%s.%%0%dd", tree->name[zone][band], Ndigit); 43 // snprintf (skycellname, 128, format, N); 44 45 snprintf (primaryCellName, DVO_MAX_PATH, "RINGS.V3.%s.%03d", tree->name[zone][band], N); 46 # endif 47 24 48 return TRUE; 25 49 } -
trunk/Ohana/src/relphot/src/ImageOps.c
r34260 r34844 352 352 353 353 // returns image.Mcal - ff(x,y) 354 float getMcal_alt (off_t meas, int cat, FlatCorrectionTable *flatcorr, float Xccd, float Yccd) { 355 356 off_t i; 357 float value, offset; 358 359 i = MeasureToImage[cat][meas]; 360 if (i == -1) return (NAN); 361 362 if (image[i].flags & IMAGE_BAD) return (NAN); 363 value = image[i].Mcal; 364 offset = 0.0; 365 366 // to do this, I need to pass in the catalog and flatcorr pointers 367 int flat_id = image[i].photom_map_id; 368 if (flat_id) { 369 offset = FlatCorrectionOffset (flatcorr, flat_id, Xccd, Yccd); 370 } 371 value -= offset; 372 373 return (value); 374 } 375 376 // returns image.Mcal - ff(x,y) 354 377 short getUbercalDist (off_t meas, int cat) { 355 378 … … 400 423 if (i == -1) return FALSE; 401 424 402 // this is a bit crude: stack image names are of the form 403 // RINGS.V3.skycell.1495.027.sky.191211.stk.988232.cmf 404 // the primaryCell has a name of the form RINGS.V3.skycell.1495 425 // this is a bit crude: stack image names are of the form: 426 // RINGS.V3.skycell.1495.027.sky.191211.stk.988232.cmf. 427 428 // the primaryCell has a name of the form RINGS.V3.skycell.1495 or RINGS.V3.skycell.1495.027 429 // (if we use projection or skycell as the primary) 405 430 406 431 if (!strncmp(image[i].name, name, strlen(name))) return TRUE; -
trunk/Ohana/src/relphot/src/StarOps.c
r34749 r34844 2 2 3 3 static int Nmax; 4 5 typedef struct {6 int Nfew;7 int Ncode;8 int Nsys;9 int Nbad;10 int Ncal;11 int Nmos;12 int Ngrid;13 14 // NOTE: the following arrays are (possibly) pre-allocated and carried down to each15 // thread. The first 3 (list, dlist, wlist) are used in all relphot analyses; the16 // others are only used on the final output steps.17 18 double *list; // list of measure.mag values for a given star19 double *dlist; // mag errors for a star20 double *wlist; // weights to use for mean mags21 double *aplist; // ap mags for a star22 double *kronlist; // kron mags for a star23 double *dkronlist; // kron mag errors24 25 double *psfqf_list; // psfqf for all filters26 double *psfqfperf_list; // psfqfperf for all filters27 double *stargal_list; // stargal for all filters28 } SetMrelInfo;29 4 30 5 enum {THREAD_RUN, THREAD_DONE}; … … 154 129 for (i = 0; i < Ncatalog; i++) { 155 130 // pass == -1 for anything other than the final pass 156 setMrel_catalog (catalog, i, -1, flatcorr, &results, Nsecfilt); 131 switch (SET_MREL_VERSION) { 132 case 0: 133 setMrel_catalog (catalog, i, -1, flatcorr, &results, Nsecfilt); 134 break; 135 case 1: 136 setMrel_catalog_alt (catalog, i, -1, flatcorr, &results, Nsecfilt); 137 break; 138 default: 139 fprintf (stderr, "invalid setMrel version %d (use 0 or 1)\n", SET_MREL_VERSION); 140 exit (2); 141 } 157 142 SetMrelInfoAccum (&summary, &results); 158 143 } … … 182 167 183 168 for (i = 0; i < Ncatalog; i++) { 184 setMrel_catalog (catalog, i, pass, flatcorr, &results, Nsecfilt); // XXX add arguments as needed for options 169 switch (SET_MREL_VERSION) { 170 case 0: 171 setMrel_catalog (catalog, i, pass, flatcorr, &results, Nsecfilt); 172 break; 173 case 1: 174 setMrel_catalog_alt (catalog, i, pass, flatcorr, &results, Nsecfilt); 175 break; 176 default: 177 fprintf (stderr, "invalid setMrel version %d (use 0 or 1)\n", SET_MREL_VERSION); 178 exit (2); 179 } 185 180 SetMrelInfoAccum (&summary, &results); 186 181 } … … 286 281 287 282 // pass == -1 for anything other than the final pass 288 setMrel_catalog (catalog, i, -1, flatcorr, &results, Nsecfilt); 283 switch (SET_MREL_VERSION) { 284 case 0: 285 setMrel_catalog (catalog, i, -1, flatcorr, &results, Nsecfilt); 286 break; 287 case 1: 288 setMrel_catalog_alt (catalog, i, -1, flatcorr, &results, Nsecfilt); 289 break; 290 default: 291 fprintf (stderr, "invalid setMrel version %d (use 0 or 1)\n", SET_MREL_VERSION); 292 exit (2); 293 } 289 294 SetMrelInfoAccum (&threadinfo->summary, &results); 290 295 } … … 332 337 liststats_setmode (&kronstats, STATMODE); 333 338 334 // StatType psfstats;335 // liststats_setmode (&psfstats, "MEAN");336 337 339 double *list = results->list; 338 340 double *dlist = results->dlist; … … 363 365 364 366 if (isSetMrelFinal) { 367 // set the name of the primary skycell (this is used in a strcmp to match the skycells in stack detections) 365 368 BoundaryTreePrimaryCell(primaryCell, catalog[Nc].average[j].R, catalog[Nc].average[j].D); 366 369 } -
trunk/Ohana/src/relphot/src/args.c
r34642 r34844 64 64 } 65 65 66 SET_MREL_VERSION = 1; 67 if ((N = get_argument (argc, argv, "-set-mrel-version"))) { 68 remove_argument (N, &argc, argv); 69 SET_MREL_VERSION = atof(argv[N]); 70 remove_argument (N, &argc, argv); 71 } 72 66 73 VERBOSE = VERBOSE2 = FALSE; 67 74 if ((N = get_argument (argc, argv, "-v"))) {
Note:
See TracChangeset
for help on using the changeset viewer.
