Changeset 35759
- Timestamp:
- Jul 3, 2013, 2:14:41 PM (13 years ago)
- Location:
- trunk/Ohana/src/relphot
- Files:
-
- 14 edited
-
include/relphot.h (modified) (5 diffs)
-
src/BoundaryTreeOps.c (modified) (1 diff)
-
src/ImageOps.c (modified) (9 diffs)
-
src/ImageSubset.c (modified) (6 diffs)
-
src/MosaicOps.c (modified) (5 diffs)
-
src/StarOps.c (modified) (1 diff)
-
src/args.c (modified) (4 diffs)
-
src/load_images.c (modified) (1 diff)
-
src/plot_scatter.c (modified) (2 diffs)
-
src/plotstuff.c (modified) (2 diffs)
-
src/reload_catalogs.c (modified) (2 diffs)
-
src/select_images.c (modified) (1 diff)
-
src/setMrelCatalog.c (modified) (7 diffs)
-
src/setMrelFinal.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/include/relphot.h
r35416 r35759 17 17 # define GRID_V2 18 18 # define NO_IMAGE -100 19 20 # define ID_SECF_STACK_PRIMARY 0x00004000 19 21 20 22 // choose off_t or int depending on full-scale relphot analysis resources … … 114 116 unsigned int photom_map_id; 115 117 unsigned int flags; 118 int projID; 119 int skycellID; 116 120 unsigned int tzero; 117 121 unsigned char trate; … … 149 153 char *IMAGES; 150 154 char *BCATALOG; 155 char *BOUNDARY_TREE; 151 156 ModeType MODE; 152 157 … … 328 333 void plot_star_coords PROTO((Catalog *catalog, int Ncatalog)); 329 334 void plot_stars PROTO((Catalog *catalog, int Ncatalog)); 335 336 void plot_list_add PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N)); 337 int get_graph PROTO((int N)); 338 int open_graph PROTO((int N)); 339 330 340 void reload_catalogs PROTO((SkyList *skylist, FlatCorrectionTable *flatcorr, int hostID, char *hostpath)); 331 341 int reload_catalogs_parallel PROTO((SkyList *sky)); … … 390 400 391 401 int MatchImageName (off_t meas, int cat, char *name); 402 int MatchImageSkycellID (off_t meas, int cat, int myProjectionID, int mySkycellID); 392 403 393 404 int load_tree (char *treefile); 394 405 int BoundaryTreePrimaryCell (char *primaryCellName, double ra, double dec); 406 int BoundaryTreePrimaryCellIDs (int *projID, int *skycellID, double ra, double dec); 395 407 396 408 int print_measure_set_alt (Average *average, SecFilt *secfilt, Measure *measure); -
trunk/Ohana/src/relphot/src/BoundaryTreeOps.c
r34844 r35759 49 49 } 50 50 51 int BoundaryTreePrimaryCellIDs (int *projID, int *skycellID, double ra, double dec) { 52 53 int zone, band; 54 55 *projID = -1; 56 *skycellID = -1; 57 58 if (!tree) return FALSE; 59 60 if (!BoundaryTreeCellCoords (tree, &zone, &band, ra, dec)) { 61 fprintf (stderr, "mismatch!\n"); 62 return FALSE; 63 } 64 65 // I have ra, dec, and the primary projection cell. In order to choose the primary skycell, 66 // I just need to project to ra,dec to X,Y based on the center of the cell and then get the subdivision right. 67 68 double x = 0.0; 69 double y = 0.0; 70 BoundaryTreeProjection (&x, &y, ra, dec, tree, zone, band); 71 72 int xi = x / tree->dX[zone][band]; 73 int yi = y / tree->dY[zone][band]; 74 int N = xi + tree->NX_SUB * yi; 75 76 *projID = tree->projID[zone][band]; 77 *skycellID = N; 78 79 return TRUE; 80 } 81 51 82 int load_tree (char *treefile) { 52 83 -
trunk/Ohana/src/relphot/src/ImageOps.c
r35104 r35759 45 45 static IDX_T **ImageToMeasure = NULL; // measure for given measure on image : ImageMeasure[ImageIndex][i] = cat (i : 0 < NonImage[ImageIndex]) 46 46 47 // Projection Cell / SkyCell ID : for stack primary detection, we need to know the projection cell and skycell ID for each 48 // stack image. for now, we generate these ID arrays based on the image names when we load in the image table (initImages). 49 // When we pass data to the remote clients via the ImageSubset, the projID/skycellID values are carried directly in the table. 50 int *projectID = NULL; 51 int *skycellID = NULL; 52 47 53 // MeasureToImage was 'bin' 48 54 // ImageToCatalog was 'clist' … … 74 80 ALLOCATE (imageIdx, off_t, Nimage); 75 81 82 // for stack images, assign projection cell ID and skycell ID based on filenames 83 ALLOCATE (projectID, int, Nimage); 84 ALLOCATE (skycellID, int, Nimage); 85 76 86 for (i = 0; i < Nimage; i++) { 77 87 imageIdx[i] = i; 78 88 imageIDs[i] = image[i].imageID; 79 } 89 projectID[i] = -1; 90 skycellID[i] = -1; 91 if (!strncmp (image[i].name, "RINGS.V3.skycell", strlen("RINGS.V3.skycell"))) { 92 projectID[i] = atoi(&image[i].name[17]); 93 skycellID[i] = atoi(&image[i].name[22]); 94 } 95 } 96 97 // sort the image index by the IDs 80 98 llsortpair (imageIDs, imageIdx, Nimage); 81 99 } … … 88 106 // create full a Image array and save the needed values 89 107 ALLOCATE (image, Image, N); 108 ALLOCATE (projectID, int, N); 109 ALLOCATE (skycellID, int, N); 110 90 111 for (i = 0; i < N; i++) { 91 112 image[i].imageID = input[i].imageID ; … … 97 118 image[i].trate = input[i].trate ; 98 119 image[i].ubercalDist = input[i].ubercalDist ; 120 projectID[i] = input[i].projID ; 121 skycellID[i] = input[i].skycellID ; 99 122 } 100 123 LineNumber = line_number; … … 130 153 subset[i].trate = image[i].trate ; 131 154 subset[i].ubercalDist = image[i].ubercalDist ; 155 subset[i].projID = projectID[i]; 156 subset[i].skycellID = skycellID[i]; 132 157 } 133 158 return subset; … … 433 458 if (!strncmp(image[i].name, name, strlen(name))) return TRUE; 434 459 return FALSE; 460 } 461 462 // returns image.Mcal - ff(x,y) 463 int MatchImageSkycellID (off_t meas, int cat, int myProjectionID, int mySkycellID) { 464 465 off_t i; 466 467 if (!MeasureToImage) return FALSE; 468 469 i = MeasureToImage[cat][meas]; 470 if (i == -1) return FALSE; 471 472 if (projectID[i] == -1) return FALSE; 473 if (skycellID[i] == -1) return FALSE; 474 475 if (projectID[i] != myProjectionID) return FALSE; 476 if (skycellID[i] != mySkycellID) return FALSE; 477 478 return TRUE; 435 479 } 436 480 … … 595 639 image[i].Xm = 100.0*log10(stats.chisq); 596 640 597 plot_setMcal (list, N, &stats, CLOUD_TOLERANCE); 641 if (PLOTSTUFF) { 642 fprintf (stderr, "Mcal for : %s\n", image[i].name); 643 plot_setMcal (list, N, &stats, CLOUD_TOLERANCE); 644 } 598 645 599 646 // bright end scatter … … 683 730 } 684 731 732 static int setMcal_init_done = FALSE; 685 733 void plot_setMcal (double *list, int Npts, StatType *stats, float clouds) { 686 734 … … 691 739 if (!PLOTSTUFF) return; 692 740 741 if (Npts == 0) { 742 // fprintf (stderr, "cannot set image Mcal values yet (nan Mave)\n"); 743 return; 744 } 745 746 plot_defaults (&graphdata); 747 graphdata.xmin = -0.01; 748 graphdata.xmax = +1.01; 749 graphdata.ymin = -0.21; 750 graphdata.ymax = +0.21; 751 752 if (!setMcal_init_done) { 753 int kapa = get_graph(0); 754 if (kapa < 1) { 755 kapa = open_graph(0); 756 if (!kapa) return; 757 } 758 759 KapaClearSections (kapa); 760 KapaClearPlots (kapa); 761 KapaSetLimits (kapa, &graphdata); 762 KapaSetFont (kapa, "helvetica", 14); 763 KapaBox (kapa, &graphdata); 764 setMcal_init_done = TRUE; 765 } 766 693 767 ALLOCATE (xlist, double, Npts); 694 695 /**** Mcal vs seq ****/696 float minMcal = +100.0;697 float maxMcal = -100.0;698 768 for (i = 0; i < Npts; i++) { 699 xlist[i] = i; 700 minMcal = MIN (list[i], minMcal); 701 maxMcal = MAX (list[i], maxMcal); 702 } 703 704 float McalRange = MAX(1.2*(maxMcal - minMcal), 0.21); 705 float McalCenter = 0.5*(maxMcal + minMcal); 706 707 plot_defaults (&graphdata); 708 graphdata.xmin = -1; 709 graphdata.xmax = Npts + 1; 710 graphdata.ymin = McalCenter - 0.5*McalRange; 711 graphdata.ymax = McalCenter + 0.5*McalRange; 712 plot_list (&graphdata, xlist, list, Npts, "sequence vs Mcal", "%s.seq.png", OUTROOT); 769 xlist[i] = i / (float) Npts; 770 } 771 772 plot_list_add (&graphdata, xlist, list, Npts); 713 773 714 774 free (xlist); -
trunk/Ohana/src/relphot/src/ImageSubset.c
r35104 r35759 58 58 char type[16]; 59 59 60 GET_COLUMN (Mcal, "MCAL", float); 61 GET_COLUMN (dMcal, "MCAL_ERR", float); 62 GET_COLUMN (imageID, "IMAGE_ID", int); 63 GET_COLUMN (map, "PHOTOM_MAP", int); 64 GET_COLUMN (flags, "FLAGS", int); 65 GET_COLUMN (tzero, "TZERO", int); 66 GET_COLUMN (trate, "TRATE", short); 67 GET_COLUMN (ucdist, "UBERCAL_DIST", short); 60 GET_COLUMN (Mcal, "MCAL", float); 61 GET_COLUMN (dMcal, "MCAL_ERR", float); 62 GET_COLUMN (imageID, "IMAGE_ID", int); 63 GET_COLUMN (map, "PHOTOM_MAP", int); 64 GET_COLUMN (flags, "FLAGS", int); 65 GET_COLUMN (projID, "PROJ_ID", int); 66 GET_COLUMN (skycellID, "SKYCELL_ID", int); 67 GET_COLUMN (tzero, "TZERO", int); 68 GET_COLUMN (trate, "TRATE", short); 69 GET_COLUMN (ucdist, "UBERCAL_DIST", short); 68 70 69 71 // XXX free the fits table data here … … 76 78 image[i].photom_map_id = map[i]; 77 79 image[i].flags = flags[i]; 80 image[i].projID = projID[i]; 81 image[i].skycellID = skycellID[i]; 78 82 image[i].tzero = tzero[i]; 79 83 image[i].trate = trate[i]; … … 87 91 free (map); 88 92 free (flags); 93 free (projID); 94 free (skycellID); 89 95 free (tzero); 90 96 free (trate); … … 124 130 gfits_define_bintable_column (&theader, "J", "FLAGS", "flags", NULL, 1.0, 1.0*0x8000); 125 131 132 gfits_define_bintable_column (&theader, "J", "PROJ_ID", "ID", NULL, 1.0, 0.0); 133 gfits_define_bintable_column (&theader, "J", "SKYCELL_ID", "ID", NULL, 1.0, 0.0); 134 126 135 gfits_define_bintable_column (&theader, "J", "TZERO", "exposure start", NULL, 1.0, 1.0*0x8000); 127 136 gfits_define_bintable_column (&theader, "I", "TRATE", "tti rate", NULL, 1.0, 0.0); … … 134 143 float *Mcal, *dMcal; 135 144 unsigned int *imageID, *map, *flags, *tzero; 145 int *projID, *skycellID; 136 146 unsigned short *trate; 137 147 short *ucdist; 138 148 139 149 // create intermediate storage arrays 140 ALLOCATE (Mcal, float, Nimage); 141 ALLOCATE (dMcal, float, Nimage); 142 ALLOCATE (imageID, unsigned int, Nimage); 143 ALLOCATE (map, unsigned int, Nimage); 144 ALLOCATE (flags, unsigned int, Nimage); 145 ALLOCATE (tzero, unsigned int, Nimage); 146 ALLOCATE (trate, unsigned short, Nimage); 147 ALLOCATE (ucdist, short, Nimage); 150 ALLOCATE (Mcal, float, Nimage); 151 ALLOCATE (dMcal, float, Nimage); 152 ALLOCATE (imageID, unsigned int, Nimage); 153 ALLOCATE (map, unsigned int, Nimage); 154 ALLOCATE (flags, unsigned int, Nimage); 155 ALLOCATE (projID, int, Nimage); 156 ALLOCATE (skycellID, int, Nimage); 157 ALLOCATE (tzero, unsigned int, Nimage); 158 ALLOCATE (trate, unsigned short, Nimage); 159 ALLOCATE (ucdist, short, Nimage); 148 160 149 161 // assign the storage arrays 150 162 for (i = 0; i < Nimage; i++) { 151 Mcal[i] = image[i].Mcal; 152 dMcal[i] = image[i].dMcal; 153 imageID[i] = image[i].imageID; 154 map[i] = image[i].photom_map_id; 155 flags[i] = image[i].flags; 156 tzero[i] = image[i].tzero; 157 trate[i] = image[i].trate; 158 ucdist[i] = image[i].ubercalDist; 163 Mcal[i] = image[i].Mcal; 164 dMcal[i] = image[i].dMcal; 165 imageID[i] = image[i].imageID; 166 map[i] = image[i].photom_map_id; 167 flags[i] = image[i].flags; 168 tzero[i] = image[i].tzero; 169 trate[i] = image[i].trate; 170 ucdist[i] = image[i].ubercalDist; 171 projID[i] = image[i].projID; 172 skycellID[i] = image[i].skycellID; 159 173 } 160 174 161 175 // add the columns to the output array 162 gfits_set_bintable_column (&theader, &ftable, "MCAL", Mcal, Nimage); 163 gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR", dMcal, Nimage); 164 gfits_set_bintable_column (&theader, &ftable, "IMAGE_ID", imageID, Nimage); 165 gfits_set_bintable_column (&theader, &ftable, "PHOTOM_MAP", map, Nimage); 166 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags, Nimage); 167 gfits_set_bintable_column (&theader, &ftable, "TZERO", tzero, Nimage); 168 gfits_set_bintable_column (&theader, &ftable, "TRATE", trate, Nimage); 169 gfits_set_bintable_column (&theader, &ftable, "UBERCAL_DIST", ucdist, Nimage); 176 gfits_set_bintable_column (&theader, &ftable, "MCAL", Mcal, Nimage); 177 gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR", dMcal, Nimage); 178 gfits_set_bintable_column (&theader, &ftable, "IMAGE_ID", imageID, Nimage); 179 gfits_set_bintable_column (&theader, &ftable, "PHOTOM_MAP", map, Nimage); 180 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags, Nimage); 181 gfits_set_bintable_column (&theader, &ftable, "PROJ_ID", projID, Nimage); 182 gfits_set_bintable_column (&theader, &ftable, "SKYCELL_ID", skycellID, Nimage); 183 gfits_set_bintable_column (&theader, &ftable, "TZERO", tzero, Nimage); 184 gfits_set_bintable_column (&theader, &ftable, "TRATE", trate, Nimage); 185 gfits_set_bintable_column (&theader, &ftable, "UBERCAL_DIST", ucdist, Nimage); 170 186 171 187 free (Mcal); … … 174 190 free (map); 175 191 free (flags); 192 free (projID); 193 free (skycellID); 176 194 free (tzero); 177 195 free (trate); -
trunk/Ohana/src/relphot/src/MosaicOps.c
r35416 r35759 711 711 if (FREEZE_MOSAICS) return (FALSE); 712 712 713 if (NTHREADS) { 713 // plots cannot be done in a threaded context (the plot commands collide) 714 // so do not run setMmos in threaded mode if PLOTSTUFF is set 715 if (NTHREADS && !PLOTSTUFF) { 714 716 int status = setMmos_threaded (catalog, PoorImages, flatcorr); 715 717 return status; … … 734 736 SetMmosInfoInit (&info, Nmax, TRUE, PoorImages); 735 737 738 // int savePlotDelay = PLOTDELAY; 739 // if (PLOTSTUFF) PLOTDELAY = 0.0; 740 736 741 for (i = 0; i < Nmosaic; i++) { 737 742 setMmos_mosaic (&mosaic[i], i, image, catalog, &info, flatcorr); 738 743 } 739 744 SetMmosInfoFree (&info); 745 746 if (PLOTSTUFF) { 747 fprintf (stdout, "press return\n"); 748 if (fscanf (stdin, "%*c") != 1) fprintf (stderr, "\n"); 749 } 740 750 741 751 npass_output ++; … … 757 767 758 768 StatType stats; 759 liststats_setmode (&stats, STATMODE); 769 // liststats_setmode (&stats, STATMODE); 770 liststats_setmode (&stats, "INNER_WTMEAN"); 760 771 761 772 double *list = info->list; … … 937 948 } 938 949 939 plot_setMcal (list, N, &stats, CLOUD_TOLERANCE); 950 if (PLOTSTUFF) { 951 fprintf (stderr, "Mmos: %6.3f %6.3f +/- %6.3f %5d %5d | %s\n", stats.mean, stats.median, stats.sigma, stats.Nmeas, N, image[MosaicToImage[Nmos][0]].name); 952 plot_setMcal (list, N, &stats, CLOUD_TOLERANCE); 953 } 940 954 941 955 // bright end scatter … … 961 975 // fprintf (stderr, "%d %d %d\n", (int) i, (int) im, image[im].ubercalDist); 962 976 } 977 963 978 return TRUE; 964 979 } -
trunk/Ohana/src/relphot/src/StarOps.c
r35104 r35759 168 168 for (i = 0; i < Ncatalog; i++) { 169 169 switch (SET_MREL_VERSION) { 170 case 0:171 setMrel_catalog (catalog, i, pass, flatcorr, &results, Nsecfilt);172 break;170 // case 0: 171 // setMrel_catalog (catalog, i, pass, flatcorr, &results, Nsecfilt); 172 // break; 173 173 case 1: 174 174 setMrel_catalog_alt (catalog, i, pass, flatcorr, &results, Nsecfilt); 175 175 break; 176 176 default: 177 fprintf (stderr, "invalid setMrel version %d (use 0 or1)\n", SET_MREL_VERSION);177 fprintf (stderr, "invalid setMrel version %d (use 1)\n", SET_MREL_VERSION); 178 178 exit (2); 179 179 } -
trunk/Ohana/src/relphot/src/args.c
r35416 r35759 177 177 } 178 178 179 SET_MREL_VERSION = 1;180 if ((N = get_argument (argc, argv, "-set-mrel-version"))) {181 remove_argument (N, &argc, argv);182 SET_MREL_VERSION = atof(argv[N]);183 remove_argument (N, &argc, argv);184 }185 186 179 UPDATE = FALSE; 187 180 if ((N = get_argument (argc, argv, "-update"))) { … … 218 211 } 219 212 213 BOUNDARY_TREE = NULL; 220 214 if ((N = get_argument (argc, argv, "-boundary-tree"))) { 221 215 remove_argument (N, &argc, argv); 222 load_tree (argv[N]); 216 BOUNDARY_TREE = strcreate(argv[N]); 217 load_tree (BOUNDARY_TREE); 223 218 remove_argument (N, &argc, argv); 224 219 } … … 419 414 } 420 415 416 BOUNDARY_TREE = NULL; 417 if ((N = get_argument (argc, argv, "-boundary-tree"))) { 418 remove_argument (N, &argc, argv); 419 BOUNDARY_TREE = strcreate(argv[N]); 420 load_tree (BOUNDARY_TREE); 421 remove_argument (N, &argc, argv); 422 } 423 421 424 /* specify portion of the sky */ 422 425 UserPatch.Rmin = 0; … … 433 436 remove_argument (N, &argc, argv); 434 437 UserPatch.Dmax = atof (argv[N]); 438 remove_argument (N, &argc, argv); 439 } 440 441 SET_MREL_VERSION = 1; 442 if ((N = get_argument (argc, argv, "-set-mrel-version"))) { 443 remove_argument (N, &argc, argv); 444 SET_MREL_VERSION = atof(argv[N]); 435 445 remove_argument (N, &argc, argv); 436 446 } -
trunk/Ohana/src/relphot/src/load_images.c
r35416 r35759 95 95 # endif 96 96 97 if (Nimage == 0) { 98 fprintf (stderr, "no images selected for analysis : problem with region or photcode?\n"); 99 exit (4); 100 } 101 97 102 // match chips to mosaics (if applicable) 98 103 initMosaics (subset, Nsubset, image, inSubset, Nimage); -
trunk/Ohana/src/relphot/src/plot_scatter.c
r33651 r35759 48 48 49 49 Mrel = catalog[i].secfilt[Nsecfilt*j+Nsec].M; 50 if (isnan(Mrel)) continue; 51 50 52 xlist[N] = Mrel; 51 53 ylist[N] = PhotSysTiny (&catalog[i].measureT[m], &catalog[i].averageT[j], &catalog[i].secfilt[j*Nsecfilt]) - Mcal - Mmos - Mgrid - Mrel; … … 54 56 } 55 57 } 58 } 59 60 if (N == 0) { 61 fprintf (stderr, "no valid average values yet\n"); 62 continue; 56 63 } 57 64 -
trunk/Ohana/src/relphot/src/plotstuff.c
r33651 r35759 19 19 } 20 20 21 int get_graph (int N) { 22 return Xgraph[N]; 23 } 24 21 25 int open_graph (int N) { 22 26 23 27 char name[100]; 24 28 25 sprintf (name, "gastro [%d]", N);29 sprintf (name, "gastro:%d", N); 26 30 27 31 // if -plot is supplied, the plots are shown on the screen; … … 156 160 } 157 161 162 // plot the vector pair to a file with name defined by the varargs format 163 void plot_list_add (Graphdata *graphdata, double *xlist, double *ylist, int Npts) { 164 165 KapaPrepPlot (Xgraph[0], Npts, graphdata); 166 PlotVector (Npts, xlist, 0, 0, "x"); 167 PlotVector (Npts, ylist, 1, 0, "y"); 168 } 169 158 170 void plot_defaults (Graphdata *graphdata) { 159 171 -
trunk/Ohana/src/relphot/src/reload_catalogs.c
r35104 r35759 156 156 // load the list of hosts 157 157 HostTable *table = HostTableLoad (CATDIR, sky->hosts); 158 159 if (BOUNDARY_TREE) { 160 char *tmppath = abspath(BOUNDARY_TREE, DVO_MAX_PATH); 161 free (BOUNDARY_TREE); 162 BOUNDARY_TREE = tmppath; 163 164 } 158 165 159 166 int i; … … 187 194 if (!KEEP_UBERCAL) { snprintf (tmpline, 1024, "%s -reset-ubercal", command); strcpy (command, tmpline); } 188 195 if (UPDATE_CATFORMAT) { snprintf (tmpline, 1024, "%s -update-catformat %s", command, UPDATE_CATFORMAT); strcpy (command, tmpline); } 196 if (BOUNDARY_TREE) { snprintf (tmpline, 1024, "%s -boundary-tree %s", command, BOUNDARY_TREE); strcpy (command, tmpline); } 189 197 if (SET_MREL_VERSION != 1) { snprintf (tmpline, 1024, "%s -set-mrel-version %d", command, SET_MREL_VERSION); strcpy (command, tmpline); } 190 198 if (AreaSelect) { snprintf (tmpline, 1024, "%s -area %f %f %f %f", command, AreaXmin, AreaXmax, AreaYmin, AreaYmax); strcpy (command, tmpline); } -
trunk/Ohana/src/relphot/src/select_images.c
r35416 r35759 407 407 tcoords.pc1_1 = tcoords.pc2_2 = 1.0; 408 408 tcoords.pc1_2 = tcoords.pc2_1 = 0.0; 409 410 tcoords.Npolyterms = 0; 411 memset (tcoords.polyterms, 0, 14*sizeof(float)); 409 412 strcpy (tcoords.ctype, "RA---TAN"); 410 413 -
trunk/Ohana/src/relphot/src/setMrelCatalog.c
r35104 r35759 110 110 if (!isSetMrelFinal && (secfilt[Nsec].flags & STAR_BAD)) continue; 111 111 112 int NexpPS1 = 0; 112 113 int Ncode = 0; 113 114 int Next = 0; … … 132 133 if (code->equiv != thisCode) { continue; } 133 134 Ncode ++; 135 136 // are we a PS1 exposure photcode? 137 if ((measure[k].photcode >= 10000) && (measure[k].photcode <= 10500)) { 138 NexpPS1 ++; 139 } 134 140 135 141 if (measureT[k].dbFlags & MEAS_BAD) SKIP_THIS_MEAS(Nbad); … … 272 278 int Nminmeas = isSetMrelFinal ? 1 : STAR_TOOFEW + 1; 273 279 280 // XXX : ugh : another hard-wired photcode entry... 281 if (isSetMrelFinal && (pass == 0)) { 282 if ((thisCode < 6) || (thisCode == 9)) { 283 secfilt[Nsec].Ncode = NexpPS1; 284 } else { 285 secfilt[Nsec].Ncode = Ncode; // 2MASS data if it exists 286 } 287 } 288 274 289 // when performing the grid analysis, STAR_TOOFEW should be set to 1; 275 290 if (N < Nminmeas) { /* too few measurements */ … … 309 324 310 325 secfilt[Nsec].Mstdev = 1000.0*stats->sigma; // Mstdev is in millimags (not enough space for more precision) 311 secfilt[Nsec].Ncode = Ncode;326 // secfilt[Nsec].Ncode = Ncode; 312 327 secfilt[Nsec].Nused = stats->Nmeas; 313 328 … … 391 406 392 407 // set the name of the primary skycell (this is used in a strcmp to match the skycells in stack detections) 393 BoundaryTreePrimaryCell(primaryCell, average[0].R, average[0].D); 408 // XXX drop BoundaryTreePrimaryCell(primaryCell, average[0].R, average[0].D); 409 int projectID = -1; 410 int skycellID = -1; 411 BoundaryTreePrimaryCellIDs(&projectID, &skycellID, average[0].R, average[0].D); 394 412 395 413 int NstackGood = 0; … … 459 477 // which stack image should we use for the mean value? 460 478 // if we request the primary (USE_TREE_FOR_PRIMARY), then find the min distances for data from the primary cell 461 if (MatchImage Name (meas, cat, primaryCell)) {479 if (MatchImageSkycellID (meas, cat, projectID, skycellID)) { 462 480 float stackPrimaryOffset = getCenterOffset (meas, cat, &measure[k], &stackImageID); 463 481 if (stackPrimaryOffset < stackPrimaryOffsetMin) { … … 550 568 if (stackPrimaryMeasureMin >= 0) { 551 569 measure[k].dbFlags |= ID_MEAS_STACK_PRIMARY; 570 secfilt[Nsec].flags |= ID_SECF_STACK_PRIMARY; 552 571 } 553 572 -
trunk/Ohana/src/relphot/src/setMrelFinal.c
r34749 r35759 16 16 // flags used by the photometry analysis (excluding UBERCAL) 17 17 unsigned int PHOTOM_FLAGS = 18 ID_MEAS_NOCAL | // detection ignored for this analysis (photcode, time range) 19 ID_MEAS_POOR_PHOTOM | // detection is photometry outlier 20 ID_MEAS_SKIP_PHOTOM | // detection was ignored for photometry measurement 21 ID_MEAS_AREA; // detetion was outside acceptable area of device 22 18 ID_MEAS_NOCAL | // detection ignored for this analysis (photcode, time range) 19 ID_MEAS_POOR_PHOTOM | // detection is photometry outlier 20 ID_MEAS_SKIP_PHOTOM | // detection was ignored for photometry measurement 21 ID_MEAS_AREA | // detetion was outside acceptable area of device 22 ID_MEAS_SYNTH_MAG | // magnitude is synthetic 23 ID_MEAS_STACK_PRIMARY | // this stack measurement is in the primary skycell 24 ID_MEAS_STACK_PHOT_SRC; // this measurement supplied the stack photometry 25 26 // ID_MEAS_PHOTOM_UBERCAL -- externally-supplied zero point from ubercal analysis 27 // this is set by 'setphot', do not reset here 28 23 29 // flags used by the photometry analysis (excluding UBERCAL) 24 30 // unsigned int secfiltFlags =
Note:
See TracChangeset
for help on using the changeset viewer.
