Changeset 37807 for trunk/Ohana/src/relphot
- Timestamp:
- Jan 11, 2015, 2:14:39 PM (12 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 14 edited
- 1 copied
-
. (modified) (1 prop)
-
src/relphot/doc/timeline.txt (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/relphot/doc/timeline.txt )
-
src/relphot/include/relphot.h (modified) (1 diff)
-
src/relphot/src/BoundaryTreeOps.c (modified) (1 diff)
-
src/relphot/src/ImageOps.c (modified) (4 diffs)
-
src/relphot/src/ImageTable.c (modified) (1 diff)
-
src/relphot/src/MosaicOps.c (modified) (5 diffs)
-
src/relphot/src/assign_images.c (modified) (3 diffs)
-
src/relphot/src/load_images.c (modified) (1 diff)
-
src/relphot/src/reload_catalogs.c (modified) (6 diffs)
-
src/relphot/src/relphot.c (modified) (3 diffs)
-
src/relphot/src/relphot_objects.c (modified) (1 diff)
-
src/relphot/src/relphot_parallel_regions.c (modified) (2 diffs)
-
src/relphot/src/select_images.c (modified) (5 diffs)
-
src/relphot/src/setMrelCatalog.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
- Property svn:mergeinfo changed
-
trunk/Ohana/src/relphot/include/relphot.h
r37116 r37807 452 452 int setMrel_catalog_alt (Catalog *catalog, int Nc, int pass, FlatCorrectionTable *flatcorr, SetMrelInfo *results, int Nsecfilt); 453 453 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); 454 int setMrelAverageStack (off_t meas, int cat, FlatCorrectionTable *flatcorr, SetMrelInfo *results, Average *average, SecFilt *secfilt, Measure *measure); 454 int setMrelAverageStack (off_t measureOffset, int cat, FlatCorrectionTable *flatcorr, SetMrelInfo *results, Average *average, SecFilt *secfilt, Measure *measure, off_t Nmeasure); 455 int setMrelAverageForcedWarp (off_t measureOffset, int cat, int pass, SetMrelInfo *results, Average *average, SecFilt *secfilt, Measure *measure, off_t *found, off_t Nmeasure); 456 455 457 int setGlobalObjStats (Average *average, Measure *measure); 456 458 -
trunk/Ohana/src/relphot/src/BoundaryTreeOps.c
r36491 r37807 51 51 if (!tess) return FALSE; 52 52 53 status = TessellationPrimaryCellIDs(tess, Ntess, tessID, projID, skycellID, ra, dec); 53 double R = ohana_normalize_angle(ra); 54 status = TessellationPrimaryCellIDs(tess, Ntess, tessID, projID, skycellID, R, dec); 54 55 return status; 55 56 } -
trunk/Ohana/src/relphot/src/ImageOps.c
r37116 r37807 35 35 static off_t *imageIdx; // list of index for image IDs 36 36 37 // QQ // as an alternative, we generate imageSeq, which directly maps imageID -> seq 38 // QQ static off_t *imageSeq; // list of index for image IDs 39 // QQ 40 // QQ // MAX_ID requires 512M to store the image index 41 // QQ # define MAX_ID 0x8000000 42 // QQ static off_t minImageID = MAX_ID; 43 // QQ static off_t maxImageID = 0; 44 37 45 // elsewhere, we have loaded a set of catalogs with measures (catalog[cat].measure[meas]) 38 46 // each image has N_onImage[ImageIndex] measurements … … 95 103 96 104 TessellationIDsByImageName (&tessID[i], &projectID[i], &skycellID[i], image[i].name); 105 106 // QQ minImageID = MIN(minImageID, image[i].imageID); 107 // QQ maxImageID = MAX(maxImageID, image[i].imageID); 108 // QQ myAssert (image[i].imageID < MAX_ID, "image IDs too large for index memory"); 97 109 } 98 110 … … 100 112 // XXX does this break the imageID <-> projectID, etc match? 101 113 llsortpair (imageIDs, imageIdx, Nimage); 114 115 // QQ ALLOCATE (imageSeq, off_t, maxImageID + 1); 116 // QQ for (i = 0; i < maxImageID + 1; i++) { 117 // QQ imageSeq[i] = -1; // not yet assigned 118 // QQ } 119 // QQ 120 // QQ for (i = 0; i < Nimage; i++) { 121 // QQ off_t N = image[i].imageID; 122 // QQ myAssert (imageSeq[N] == -1, "previously assigned"); 123 // QQ imageSeq[N] = i; 124 // QQ } 102 125 } 103 126 … … 167 190 168 191 off_t getImageByID (off_t ID) { 192 193 // QQ if (imageSeq) { 194 // QQ myAssert (ID >= minImageID, "oops"); 195 // QQ myAssert (ID <= maxImageID, "oops"); 196 // QQ off_t N = imageSeq[ID]; 197 // QQ return N; 198 // QQ } 169 199 170 200 // we have a pair of vectors (imageIDs, imageIdx) sorted by imageIDs -
trunk/Ohana/src/relphot/src/ImageTable.c
r36630 r37807 32 32 } 33 33 34 // XXX do not make the chip match -- we have not loaded the PHU entries (and do not need them here) 35 // BuildChipMatch (image, Nimage); 36 34 37 *nimage = Nimage; 35 38 return image; -
trunk/Ohana/src/relphot/src/MosaicOps.c
r37037 r37807 520 520 m = MosaicToImage[i][j]; 521 521 522 if (!FindMosaicForImage (image, Nimage, m)) {523 if (VERBOSE2) fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);524 continue;525 }526 527 522 NX = image[m].NX; 528 523 NY = image[m].NY; 529 XY_to_RD (&R, &D, 0.5*NX, 0.5*NY, &image[m].coords);524 if (!XY_to_RD (&R, &D, 0.5*NX, 0.5*NY, &image[m].coords)) continue; 530 525 R = ohana_normalize_angle_to_midpoint (R, 180.0); 531 526 … … 587 582 } 588 583 589 strcpy (mosaic[i].coords.ctype, "DEC--TAN");584 InitCoords (&mosaic[i].coords, "DEC--TAN"); 590 585 mosaic[i].coords.crval1 = Rmid; 591 586 mosaic[i].coords.crval2 = Dmid; 592 mosaic[i].coords.crpix1 = 0.0;593 mosaic[i].coords.crpix2 = 0.0;594 587 mosaic[i].coords.cdelt1 = 1.0 / 3600.0; 595 588 mosaic[i].coords.cdelt2 = 1.0 / 3600.0; 596 mosaic[i].coords.pc1_1 = 1.0;597 mosaic[i].coords.pc2_2 = 1.0;598 mosaic[i].coords.pc1_2 = 0.0;599 mosaic[i].coords.pc2_1 = 0.0;600 589 601 590 mosaic[i].Mcal = 0.0; … … 631 620 NY = image[m].NY; 632 621 dS += hypot (image[m].coords.cdelt1*image[m].coords.pc1_1, image[m].coords.cdelt1*image[m].coords.pc2_1); 633 XY_to_RD (&R, &D, 0.0, 0.0, &image[m].coords); 622 623 OhanaProjection proj = GetProjection (image[m].coords.ctype); 624 if ((proj == PROJ_WRP) && !image[m].coords.mosaic) { 625 XY_to_LM (&R, &D, 0.0, 0.0, &image[m].coords); 626 } else { 627 XY_to_RD (&R, &D, 0.0, 0.0, &image[m].coords); 628 } 634 629 Rmin = MIN (Rmin, R); 635 630 Rmax = MAX (Rmax, R); 636 631 Dmin = MIN (Dmin, D); 637 632 Dmax = MAX (Dmax, D); 638 XY_to_RD (&R, &D, (double) NX, 0.0, &image[m].coords); 633 634 if ((proj == PROJ_WRP) && !image[m].coords.mosaic) { 635 XY_to_LM (&R, &D, (double) NX, 0.0, &image[m].coords); 636 } else { 637 XY_to_RD (&R, &D, (double) NX, 0.0, &image[m].coords); 638 } 639 639 Rmin = MIN (Rmin, R); 640 640 Rmax = MAX (Rmax, R); 641 641 Dmin = MIN (Dmin, D); 642 642 Dmax = MAX (Dmax, D); 643 XY_to_RD (&R, &D, (double) NX, (double) NY, &image[m].coords); 643 644 if ((proj == PROJ_WRP) && !image[m].coords.mosaic) { 645 XY_to_LM (&R, &D, (double) NX, (double) NY, &image[m].coords); 646 } else { 647 XY_to_RD (&R, &D, (double) NX, (double) NY, &image[m].coords); 648 } 644 649 Rmin = MIN (Rmin, R); 645 650 Rmax = MAX (Rmax, R); 646 651 Dmin = MIN (Dmin, D); 647 652 Dmax = MAX (Dmax, D); 648 XY_to_RD (&R, &D, 0.0, (double) NY, &image[m].coords); 653 654 if ((proj == PROJ_WRP) && !image[m].coords.mosaic) { 655 XY_to_LM (&R, &D, 0.0, (double) NY, &image[m].coords); 656 } else { 657 XY_to_RD (&R, &D, 0.0, (double) NY, &image[m].coords); 658 } 649 659 Rmin = MIN (Rmin, R); 650 660 Rmax = MAX (Rmax, R); … … 652 662 Dmax = MAX (Dmax, D); 653 663 664 // XXX : this probably does not handle mosaics at RA = 0,360 well 665 654 666 /* we are using mosaic.Mcal, not image.Mcal. reset image.Mcal */ 655 667 … … 668 680 } 669 681 dS /= MosaicN_Image[i]; 670 strcpy (mosaic[i].coords.ctype, "DEC--TAN"); 682 683 InitCoords (&mosaic[i].coords, "DEC--TAN"); 671 684 mosaic[i].coords.crval1 = Rmin; 672 685 mosaic[i].coords.crval2 = Dmin; 673 mosaic[i].coords.crpix1 = 0.0;674 mosaic[i].coords.crpix2 = 0.0;675 686 mosaic[i].coords.cdelt1 = dS; 676 687 mosaic[i].coords.cdelt2 = dS; 677 mosaic[i].coords.pc1_1 = 1.0; 678 mosaic[i].coords.pc2_2 = 1.0; 679 mosaic[i].coords.pc1_2 = 0.0; 680 mosaic[i].coords.pc2_1 = 0.0; 688 681 689 RD_to_XY (&dX, &dY, Rmax, Dmax, &mosaic[i].coords); 682 690 -
trunk/Ohana/src/relphot/src/assign_images.c
r37037 r37807 80 80 if (!strcmp(&image[j].coords.ctype[4], "-DIS")) continue; 81 81 82 // match the image to its corresponding ASTROMETRIC mosaic (not the same as the Mosaic above)83 if (!FindMosaicForImage (image, Nimage, j)) {84 if (VERBOSE2) fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);85 continue;86 }87 88 82 // Exclude images with crazy astrometry 89 83 // XXX NOTE : this is gpc1-specific … … 123 117 124 118 if (MOSAIC_ZEROPT) { 125 // use the coords of the associated mosaic to select 119 // use the coords of the associated mosaic to select (only for chips; stacks use their own center) 126 120 Mosaic *mosaic = getMosaicForImage (j); 127 Rc = mosaic->coords.crval1; 128 Dc = mosaic->coords.crval2; 129 // NOTE : have defined mosaic Rc,Dc to choose the side of 0,360 on which most of the 130 // chips are located. but, for host assignment, we rationalize to 0.0 - 360.0 131 Rc = ohana_normalize_angle_to_midpoint (Rc, 180.0); 121 if (mosaic) { 122 Rc = mosaic->coords.crval1; 123 Dc = mosaic->coords.crval2; 124 // NOTE : have defined mosaic Rc,Dc to choose the side of 0,360 on which most of the 125 // chips are located. but, for host assignment, we rationalize to 0.0 - 360.0 126 Rc = ohana_normalize_angle_to_midpoint (Rc, 180.0); 127 } 132 128 } 133 129 … … 206 202 } 207 203 208 int calculate_host_image_bounds (RegionHostTable *regionHosts, double Rmid) {209 210 int i, n;211 off_t j;212 213 for (i = 0; i < regionHosts->Nhosts; i++) {214 215 RegionHostInfo *host = ®ionHosts->hosts[i];216 217 // XXX clear the chip match?218 219 BuildChipMatch (host->image, host->Nimage);220 221 double Rmin = 720.0;222 double Rmax = -360.0;223 double Dmin = +90.0;224 double Dmax = -90.0;225 226 for (j = 0; j < host->Nimage; j++) {227 228 Image *image = &host->image[j];229 230 if (!FindMosaicForImage (host->image, host->Nimage, j)) {231 fprintf (stderr, "missing astrometry? programming error?\n");232 abort ();233 }234 235 // define image corners236 for (n = 0; n < 4; n++) {237 double Xc, Yc, Rc, Dc;238 Xc = Xf[n]*image->NX;239 Yc = Yf[n]*image->NY;240 XY_to_RD (&Rc, &Dc, Xc, Yc, &image->coords);241 Rc = ohana_normalize_angle_to_midpoint (Rc, Rmid);242 243 Rmin = MIN (Rmin, Rc);244 Dmin = MIN (Dmin, Rc);245 246 Rmax = MAX (Rmax, Rc);247 Dmax = MAX (Dmax, Rc);248 }249 250 }251 252 // RminCat, RmaxCat may extended beyond 0.0 - 360.0253 host->RminCat = Rmin;254 host->DminCat = Dmin;255 host->RmaxCat = Rmax;256 host->DmaxCat = Dmax;257 258 // regionHosts needs to have the full outer boundary259 // (so reload_catalogs covers the correct region)260 regionHosts->Rmin = MIN(Rmin, regionHosts->Rmin);261 regionHosts->Rmax = MAX(Rmax, regionHosts->Rmax);262 regionHosts->Dmin = MIN(Dmin, regionHosts->Dmin);263 regionHosts->Dmax = MAX(Dmax, regionHosts->Dmax);264 }265 return TRUE;266 }267 268 269 204 // Rc is in range 0.0 - 360.0, hosts Rmin,Rmax in range 0.0 - 360.0 270 205 int find_host_for_coords (RegionHostTable *regionHosts, double Rc, double Dc) { -
trunk/Ohana/src/relphot/src/load_images.c
r35759 r37807 27 27 } 28 28 MARKTIME("read image table: %f sec\n", dtime); 29 30 BuildChipMatch (image, Nimage); 31 MARKTIME("build chip match for %d images: %f sec\n", (int) Nimage, dtime); 32 33 char mapfile[DVO_MAX_PATH]; 34 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR); 35 AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, VERBOSE); 36 37 // assign images.coords.offsetMap -> table->map[i] 38 if (table) { 39 AstromOffsetTableMatchChips (image, Nimage, table); 40 } 29 41 30 42 // allocate and init an array to identify the images included in the subset -
trunk/Ohana/src/relphot/src/reload_catalogs.c
r36630 r37807 128 128 } 129 129 130 int reload_catalog_parallel_group (HostTableGroup *group, SkyList *sky, char *imageFile); 131 130 132 // XXX Image to Image Subset 131 133 int reload_catalogs_parallel (SkyList *sky) { … … 165 167 free (BOUNDARY_TREE); 166 168 BOUNDARY_TREE = tmppath; 167 168 } 169 } 170 171 int Ngroups; 172 HostTableGroup *groups = HostTableGroups (table, &Ngroups); 173 // split the table into Ngroups, each with a unique set of machines (this avoids overloading the remote host machines) 174 175 int i; 176 for (i = 0; i < Ngroups; i++) { 177 // update only a group of unique machines at a time 178 reload_catalog_parallel_group (&groups[i], sky, imageFile); 179 } 180 return TRUE; 181 } 182 183 int reload_catalog_parallel_group (HostTableGroup *group, SkyList *sky, char *imageFile) { 169 184 170 185 int i, j; 171 for (i = 0; i < table->Nhosts; i++) {172 173 if (sky->Nregions < table->Nhosts) {186 for (i = 0; i < group->Nhosts; i++) { 187 188 if (sky->Nregions < group->Nhosts) { 174 189 // do any of the regions want this host? 175 190 int wantThisHost = FALSE; 176 191 for (j = 0; j < sky->Nregions; j++) { 177 if (HostTableTestHost (sky->regions[j], table->hosts[i].hostID)) {192 if (HostTableTestHost (sky->regions[j], group->hosts[i][0].hostID)) { 178 193 wantThisHost = TRUE; 179 194 break; … … 181 196 } 182 197 if (!wantThisHost) { 183 // fprintf (stderr, "skip host %s\n", table->hosts[i].hostname);198 // fprintf (stderr, "skip host %s\n", group->hosts[i][0].hostname); 184 199 continue; 185 200 } … … 187 202 188 203 // ensure that the paths are absolute path names 189 char *tmppath = abspath ( table->hosts[i].pathname, DVO_MAX_PATH);190 free ( table->hosts[i].pathname);191 table->hosts[i].pathname = tmppath;204 char *tmppath = abspath (group->hosts[i][0].pathname, DVO_MAX_PATH); 205 free (group->hosts[i][0].pathname); 206 group->hosts[i][0].pathname = tmppath; 192 207 193 208 char command[1024]; 194 209 snprintf (command, 1024, "relphot_client %s -update-catalogs %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d -minerror %f", 195 PhotcodeList, imageFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR);210 PhotcodeList, imageFile, group->hosts[i][0].hostID, CATDIR, group->hosts[i][0].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR); 196 211 197 212 // options & configs which affect relphot_client -update-catalogs … … 238 253 // launch the job on the remote machine (no handshake) 239 254 int errorInfo = 0; 240 int pid = rconnect ("ssh", table->hosts[i].hostname, command, table->hosts[i].stdio, &errorInfo, FALSE);255 int pid = rconnect ("ssh", group->hosts[i][0].hostname, command, group->hosts[i][0].stdio, &errorInfo, FALSE); 241 256 if (!pid) { 242 if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", table->hosts[i].hostname, errorInfo);257 if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", group->hosts[i][0].hostname, errorInfo); 243 258 exit (1); 244 259 } 245 table->hosts[i].pid = pid; // save for future reference260 group->hosts[i][0].pid = pid; // save for future reference 246 261 } 247 262 } … … 252 267 } 253 268 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 254 int status = HostTable WaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE);269 int status = HostTableGroupWaitJobsGetIO (group, __FILE__, __LINE__, VERBOSE); 255 270 if (!status) { 256 271 fprintf (stderr, "at least one remote client job failed to load data, exiting\n"); -
trunk/Ohana/src/relphot/src/relphot.c
r36630 r37807 9 9 switch (mode) { 10 10 case UPDATE_IMAGES: 11 // IF CALLED WITH NLOOP == 0, DOES NOT LOAD bcatalog, just loads image table and generates ImageSubset.dat 11 12 relphot_images (); 12 13 exit (0); … … 14 15 case UPDATE_AVERAGES: 15 16 // take the current set of detections and set the mean magnitudes 17 // DOES NOT LOAD THE IMAGE TABLE 16 18 relphot_objects (0, NULL); 17 19 exit (0); … … 43 45 exit (1); 44 46 } 47 48 /*** 49 50 I would like to merge the functionality of relphot_images (Nloop == 0), relphot_objects, and apply_offsets 51 52 ***/ -
trunk/Ohana/src/relphot/src/relphot_objects.c
r35104 r37807 36 36 if (!HostTableTestHost(skylist[0].regions[i], hostID)) continue; 37 37 38 // set up the basic catalog info39 38 // set up the basic catalog info 40 39 char hostfile[1024]; -
trunk/Ohana/src/relphot/src/relphot_parallel_regions.c
r37037 r37807 43 43 MARKTIME("-- load image data: %f sec\n", dtime); 44 44 45 // save Images.dat using the copied structure 46 if (UPDATE_CATFORMAT) { 47 // ensure the db format is updated 48 db.format = dvo_catalog_catformat (UPDATE_CATFORMAT); 49 } 50 45 51 /* assign the images to the different region hosts */ 46 52 if (!assign_images (&db, regionHosts)) Shutdown ("error assigning images to region hosts"); … … 49 55 /* launch processing on the parallel region hosts */ 50 56 if (!launch_region_hosts (regionHosts)) Shutdown ("error launching region hosts"); 57 MARKTIME ("finished relphot -parallel-regions: %f sec total\n", dtime); 51 58 52 59 // retrieve updated image parameters from the remote hosts (also set Image.mcal) -
trunk/Ohana/src/relphot/src/select_images.c
r36491 r37807 36 36 37 37 // the comparison is made in the catalog local projection. below we set crval1,2 38 tcoords.crpix1 = tcoords.crpix2 = 0.0;38 InitCoords (&tcoords, "DEC--TAN"); 39 39 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 40 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;41 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;42 strcpy (tcoords.ctype, "DEC--TAN");43 40 44 41 double RminSkyRegion = region[0].Rmin; … … 93 90 94 91 if (VERBOSE) fprintf (stderr, "finding images\n"); 95 BuildChipMatch (timage, Ntimage);96 MARKTIME("build chip match for %d images: %f sec\n", (int) Ntimage, dtime);97 92 98 93 D_NIMAGE = 6000; … … 107 102 108 103 if (!(i % 300000)) fprintf (stderr, "."); 104 105 // XXX I am just going for force this for the moment: 106 goto found_it; 109 107 110 108 /* exclude images by photcode */ … … 123 121 } 124 122 125 // this adds 1.3 sec for 3M images126 if (!FindMosaicForImage (timage, Ntimage, i)) {127 if (VERBOSE2) fprintf (stderr, "cannot find mosaic for "OFF_T_FMT"\n", i);128 continue;129 }130 131 123 /* define image corners - note the DIS images (mosaic phu) are special */ 132 124 if (!strcmp(&timage[i].coords.ctype[4], "-DIS")) { … … 405 397 406 398 // the comparison is made in the catalog local projection. below we set crval1,2 407 tcoords.crpix1 = tcoords.crpix2 = 0.0;399 InitCoords (&tcoords, "DEC--TAN"); 408 400 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 409 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;410 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;411 412 tcoords.Npolyterms = 0;413 memset (tcoords.polyterms, 0, 14*sizeof(float));414 strcpy (tcoords.ctype, "DEC--TAN");415 401 416 402 /* compare with each region file */ -
trunk/Ohana/src/relphot/src/setMrelCatalog.c
r37740 r37807 36 36 } 37 37 38 int setMrelAverageForcedWarp (off_t measureOffset, int cat, int pass, SetMrelInfo *results, Average *average, SecFilt *secfilt, Measure *measure, off_t *found);39 40 38 int setMrel_catalog_alt (Catalog *catalog, int Nc, int pass, FlatCorrectionTable *flatcorr, SetMrelInfo *results, int Nsecfilt) { 41 39 … … 60 58 Average *average = catalog[Nc].average ? &catalog[Nc].average[j] : NULL; 61 59 Measure *measure = catalog[Nc].measure ? &catalog[Nc].measure[m] : NULL; 62 setMrelAverageExposure (m, Nc, pass, flatcorr, results, average, &catalog[Nc].averageT[j], &catalog[Nc].secfilt[j*Nsecfilt], measure, &catalog[Nc].measureT[m], &catalog[Nc].found_t[Nsecfilt*j]); 60 SecFilt *secfilt = catalog[Nc].secfilt ? &catalog[Nc].secfilt[j*Nsecfilt] : NULL; 61 setMrelAverageExposure (m, Nc, pass, flatcorr, results, average, &catalog[Nc].averageT[j], secfilt, measure, &catalog[Nc].measureT[m], &catalog[Nc].found_t[Nsecfilt*j]); 63 62 64 63 // only apply Stack operation on setMrelFinal in first pass 65 64 if (isSetMrelFinal && (pass == 0)) { 66 setMrelAverageStack (m, Nc, flatcorr, results, &catalog[Nc].average[j], &catalog[Nc].secfilt[j*Nsecfilt], &catalog[Nc].measure[m]);65 setMrelAverageStack (m, Nc, flatcorr, results, average, secfilt, &catalog[Nc].measure[m], catalog[Nc].Nmeasure); 67 66 setGlobalObjStats (&catalog[Nc].average[j], &catalog[Nc].measure[m]); 68 67 } … … 70 69 // only measure force-warp mean values if issetMrelFinal (make it optional?) 71 70 if (isSetMrelFinal) { 72 setMrelAverageForcedWarp (m, Nc, pass, results, &catalog[Nc].average[j], &catalog[Nc].secfilt[j*Nsecfilt], &catalog[Nc].measure[m], &catalog[Nc].foundWarp_t[Nsecfilt*j]);73 setGlobalObjStats ( &catalog[Nc].average[j], &catalog[Nc].measure[m]);71 setMrelAverageForcedWarp (m, Nc, pass, results, average, secfilt, measure, &catalog[Nc].foundWarp_t[Nsecfilt*j], catalog[Nc].Nmeasure); 72 setGlobalObjStats (average, measure); 74 73 } 75 74 } … … 456 455 // 2) select the BEST detections per filter (regardless of PRIMARY) 457 456 // 3) apply the zero point and AB->Jy transformations 458 int setMrelAverageStack (off_t measureOffset, int cat, FlatCorrectionTable *flatcorr, SetMrelInfo *results, Average *average, SecFilt *secfilt, Measure *measure ) {457 int setMrelAverageStack (off_t measureOffset, int cat, FlatCorrectionTable *flatcorr, SetMrelInfo *results, Average *average, SecFilt *secfilt, Measure *measure, off_t Nmeasure) { 459 458 460 459 off_t k; … … 496 495 int Nstack = 0; // number for this photcode 497 496 int NstackDet = 0; // number for this photcode 497 498 secfilt[Nsec].stackBestOff = -1; 499 secfilt[Nsec].stackPrmryOff = -1; 498 500 499 501 off_t meas = measureOffset; … … 526 528 measure[k].dbFlags |= ID_MEAS_STACK_PRIMARY; 527 529 secfilt[Nsec].stackPrmryOff = meas; 530 myAssert (secfilt[Nsec].stackPrmryOff <= Nmeasure, "stackPrmryOff out of range"); 528 531 } 529 532 … … 637 640 638 641 secfilt[Nsec].stackBestOff = k + measureOffset; 642 myAssert (secfilt[Nsec].stackBestOff <= Nmeasure, "stackBestOff out of range"); 639 643 640 644 secfilt[Nsec].Nstack = Nstack; … … 669 673 // somewhat simplified relative to chip-photometry: 670 674 // * no grid, no mosaic, no 2MASS, no SYNTH, no Ubercal, no flatcorr 671 int setMrelAverageForcedWarp (off_t measureOffset, int cat, int pass, SetMrelInfo *results, Average *average, SecFilt *secfilt, Measure *measure, off_t *found ) {675 int setMrelAverageForcedWarp (off_t measureOffset, int cat, int pass, SetMrelInfo *results, Average *average, SecFilt *secfilt, Measure *measure, off_t *found, off_t Nmeasure) { 672 676 673 677 off_t k; … … 713 717 // if we cannot make that association, skip this set of warps 714 718 int stkTessID, stkProjID, stkSkycellID; 719 720 myAssert (secfilt[Nsec].stackBestOff <= Nmeasure, "stackBestOff out of range"); 715 721 if (!FindImageSkycellID (secfilt[Nsec].stackBestOff, cat, &stkTessID, &stkProjID, &stkSkycellID)) continue; 716 722
Note:
See TracChangeset
for help on using the changeset viewer.
