Changeset 40212 for branches/eam_branches/ohana.20170822/src/relphot
- Timestamp:
- Nov 22, 2017, 10:38:42 AM (9 years ago)
- Location:
- branches/eam_branches/ohana.20170822/src/relphot
- Files:
-
- 16 edited
-
include/relphot.h (modified) (4 diffs)
-
src/BrightCatalog.c (modified) (2 diffs)
-
src/GridOps.c (modified) (2 diffs)
-
src/ImageMagIO.c (modified) (8 diffs)
-
src/ImageOps.c (modified) (18 diffs)
-
src/ImageSubset.c (modified) (8 diffs)
-
src/MosaicOps.c (modified) (25 diffs)
-
src/StarOps.c (modified) (7 diffs)
-
src/plot_scatter.c (modified) (1 diff)
-
src/relphot_synthphot_catalog.c (modified) (1 diff)
-
src/select_images.c (modified) (1 diff)
-
src/setMrelCatalog.c (modified) (5 diffs)
-
src/setMrelFinal.c (modified) (1 diff)
-
src/share_image_mags.c (modified) (2 diffs)
-
src/share_mean_mags.c (modified) (2 diffs)
-
src/synthetic_mags.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20170822/src/relphot/include/relphot.h
r39926 r40212 77 77 unsigned int stop; 78 78 short photcode; 79 float Mcal; 79 float McalPSF; 80 float McalAPER; 80 81 float dMcal; 81 82 float dMsys; 82 unsigned short nFitPhotom; 83 short Xm; 83 float McalChiSq; 84 84 float secz; 85 85 float ubercalDist; 86 unsigned short nFitPhotom; 86 87 unsigned int flags; 87 88 char skipCal; // if TRUE, this mosaic is incomplete and should not be calibrated … … 201 202 202 203 typedef struct { 203 float Mcal; 204 float McalPSF; 205 float McalAPER; 204 206 float dMcal; 205 207 float dMagSys; 206 short Xm;208 float McalChiSq; 207 209 int nFitPhotom; 208 210 int flags; … … 220 222 221 223 typedef struct { 222 float Mcal; 224 float McalPSF; 225 float McalAPER; 223 226 float dMcal; 224 227 unsigned int imageID; … … 427 430 float getMgrid PROTO((off_t meas, int cat)); 428 431 float getMmos PROTO((off_t meas, int cat)); 429 float getMrel PROTO((Catalog *catalog, off_t meas, int cat ));432 float getMrel PROTO((Catalog *catalog, off_t meas, int cat, dvoMagClassType class, dvoMagSourceType source)); 430 433 short getUbercalDist PROTO((off_t meas, int cat)); 431 434 float getCenterOffset PROTO((off_t meas, int cat, Measure *measure, unsigned int *myID)); -
branches/eam_branches/ohana.20170822/src/relphot/src/BrightCatalog.c
r39478 r40212 199 199 ALLOCATE (secfilt, SecFilt, Nrow); 200 200 for (i = 0; i < Nrow; i++) { 201 secfilt[i].M = M[i];202 secfilt[i].dM = dM[i];203 secfilt[i].Mchisq = Mchisq[i];204 secfilt[i].flags = flags[i];205 secfilt[i].Ncode = Ncode[i];206 secfilt[i].Nused = Nused[i];207 secfilt[i].Mmin = Mmin[i];208 secfilt[i].Mmax = Mmax[i];201 secfilt[i].MpsfChp = M[i]; 202 secfilt[i].dMpsfChp = dM[i]; 203 secfilt[i].Mchisq = Mchisq[i]; 204 secfilt[i].flags = flags[i]; 205 secfilt[i].Ncode = Ncode[i]; 206 secfilt[i].Nused = Nused[i]; 207 secfilt[i].Mmin = Mmin[i]; 208 secfilt[i].Mmax = Mmax[i]; 209 209 } 210 210 fprintf (stderr, "loaded data for %lld secfilt\n", (long long) Nrow); … … 465 465 SecFilt *secfilt = catalog->secfilt; 466 466 for (i = 0; i < Nsec; i++) { 467 M [i] = secfilt[i].M ;468 dM [i] = secfilt[i].dM ;469 Mchisq[i] = secfilt[i].Mchisq ;470 flags [i] = secfilt[i].flags ;471 Ncode [i] = secfilt[i].Ncode ;472 Nused [i] = secfilt[i].Nused ;473 Mmin [i] = secfilt[i].Mmin ;474 Mmax [i] = secfilt[i].Mmax ;467 M [i] = secfilt[i].MpsfChp ; 468 dM [i] = secfilt[i].dMpsfChp; 469 Mchisq[i] = secfilt[i].Mchisq ; 470 flags [i] = secfilt[i].flags ; 471 Ncode [i] = secfilt[i].Ncode ; 472 Nused [i] = secfilt[i].Nused ; 473 Mmin [i] = secfilt[i].Mmin ; 474 Mmax [i] = secfilt[i].Mmax ; 475 475 } 476 476 -
branches/eam_branches/ohana.20170822/src/relphot/src/GridOps.c
r39632 r40212 568 568 continue; 569 569 } 570 Mrel = getMrel (catalog, m, c );570 Mrel = getMrel (catalog, m, c, MAG_CLASS_PSF, MAG_SRC_CHP); 571 571 if (isnan(Mrel)) { 572 572 Nrel ++; … … 649 649 Mmos = getMmos (m, c); 650 650 if (isnan(Mmos)) continue; 651 Mrel = getMrel (catalog, m, c );651 Mrel = getMrel (catalog, m, c, MAG_CLASS_PSF, MAG_SRC_CHP); 652 652 if (isnan(Mrel)) continue; 653 653 -
branches/eam_branches/ohana.20170822/src/relphot/src/ImageMagIO.c
r37037 r40212 58 58 char type[16]; 59 59 60 GET_COLUMN (Mcal, "MCAL", float); 60 GET_COLUMN (McalPSF, "MCAL_PSF", float); 61 GET_COLUMN (McalAPER, "MCAL_APER", float); 61 62 GET_COLUMN (dMcal, "MCAL_ERR", float); 62 63 GET_COLUMN (dMagSys, "MCAL_SYSERR", float); 63 GET_COLUMN ( nFitPhotom, "NFIT", int);64 GET_COLUMN ( flags, "FLAGS",int);65 GET_COLUMN ( ubercalDist, "UDIST",int);66 GET_COLUMN ( imageID, "ID",int);67 GET_COLUMN ( Xm, "CHISQ", short);64 GET_COLUMN (McalChiSq, "MCAL_CHISQ", float); 65 GET_COLUMN (nFitPhotom, "NFIT", int); 66 GET_COLUMN (flags, "FLAGS", int); 67 GET_COLUMN (ubercalDist, "UDIST", int); 68 GET_COLUMN (imageID, "ID", int); 68 69 69 70 // free the memory associated with the FITS files … … 75 76 ALLOCATE (image_mags, ImageMag, Nrow); 76 77 for (i = 0; i < Nrow; i++) { 77 image_mags[i].Mcal = Mcal [i]; 78 image_mags[i].McalPSF = McalPSF [i]; 79 image_mags[i].McalAPER = McalAPER [i]; 78 80 image_mags[i].dMcal = dMcal [i]; 79 81 image_mags[i].dMagSys = dMagSys [i]; 80 image_mags[i]. Xm = Xm[i];82 image_mags[i].McalChiSq = McalChiSq [i]; 81 83 image_mags[i].nFitPhotom = nFitPhotom [i]; 82 84 image_mags[i].flags = flags [i]; … … 86 88 fprintf (stderr, "loaded data for %lld images\n", (long long) Nrow); 87 89 88 free (Mcal ); 90 free (McalPSF ); 91 free (McalAPER ); 89 92 free (dMcal ); 90 93 free (dMagSys ); 91 free ( Xm);94 free (McalChiSq ); 92 95 free (nFitPhotom ); 93 96 free (flags ); … … 121 124 gfits_create_table_header (&theader, "BINTABLE", "IMAGE_MAGS"); 122 125 123 gfits_define_bintable_column (&theader, "E", "MCAL", "cal offset", "magnitudes", 1.0, 0.0); 126 gfits_define_bintable_column (&theader, "E", "MCAL_PSF", "PSF cal offset", "magnitudes", 1.0, 0.0); 127 gfits_define_bintable_column (&theader, "E", "MCAL_APER", "APER cal offset", "magnitudes", 1.0, 0.0); 124 128 gfits_define_bintable_column (&theader, "E", "MCAL_ERR", "cal error", "magnitudes", 1.0, 0.0); 125 129 gfits_define_bintable_column (&theader, "E", "MCAL_SYSERR", "systematic error", "magnitudes", 1.0, 0.0); 130 gfits_define_bintable_column (&theader, "E", "MCAL_CHISQ", "cal chisq", "unitless", 1.0, 0.0); 126 131 gfits_define_bintable_column (&theader, "J", "NFIT", "number of fitted stars", "unitless", 1.0, 0.0); 127 132 gfits_define_bintable_column (&theader, "J", "FLAGS", "analysis flags", "unitless", 1.0, 0.0); 128 133 gfits_define_bintable_column (&theader, "J", "UDIST", "distance to ubercal images", "images", 1.0, 0.0); 129 134 gfits_define_bintable_column (&theader, "J", "ID", "image ID", "unitless", 1.0, 0.0); 130 gfits_define_bintable_column (&theader, "I", "CHISQ", "cal chisq", "unitless", 1.0, FT_BZERO_INT16);131 135 132 136 // generate the output array that carries the data 133 137 gfits_create_table (&theader, &ftable); 134 138 135 float *Mcal ; 139 float *McalPSF ; 140 float *McalAPER ; 136 141 float *dMcal ; 137 142 float *dMagSys ; 138 float * Xm;143 float *McalChiSq ; 139 144 int *nFitPhotom ; 140 145 int *flags ; … … 143 148 144 149 // create intermediate storage arrays 145 ALLOCATE (Mcal , float, Nimage_mags); 150 ALLOCATE (McalPSF , float, Nimage_mags); 151 ALLOCATE (McalAPER , float, Nimage_mags); 146 152 ALLOCATE (dMcal , float, Nimage_mags); 147 153 ALLOCATE (dMagSys , float, Nimage_mags); 148 ALLOCATE ( Xm, float, Nimage_mags);154 ALLOCATE (McalChiSq , float, Nimage_mags); 149 155 ALLOCATE (nFitPhotom , int, Nimage_mags); 150 156 ALLOCATE (flags , int, Nimage_mags); … … 154 160 // assign the storage arrays 155 161 for (i = 0; i < Nimage_mags; i++) { 156 Mcal [i] = image_mags[i].Mcal ; 162 McalPSF [i] = image_mags[i].McalPSF ; 163 McalAPER [i] = image_mags[i].McalAPER ; 157 164 dMcal [i] = image_mags[i].dMcal ; 158 165 dMagSys [i] = image_mags[i].dMagSys ; 159 Xm [i] = image_mags[i].Xm;166 McalChiSq [i] = image_mags[i].McalChiSq ; 160 167 nFitPhotom [i] = image_mags[i].nFitPhotom ; 161 168 flags [i] = image_mags[i].flags ; … … 165 172 166 173 // add the columns to the output array 167 gfits_set_bintable_column (&theader, &ftable, "MCAL", Mcal , Nimage_mags); 174 gfits_set_bintable_column (&theader, &ftable, "MCAL_PSF", McalPSF , Nimage_mags); 175 gfits_set_bintable_column (&theader, &ftable, "MCAL_APER", McalAPER , Nimage_mags); 168 176 gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR", dMcal , Nimage_mags); 169 177 gfits_set_bintable_column (&theader, &ftable, "MCAL_SYSERR", dMagSys , Nimage_mags); 170 gfits_set_bintable_column (&theader, &ftable, " CHISQ", Xm, Nimage_mags);178 gfits_set_bintable_column (&theader, &ftable, "MCAL_CHISQ", McalChiSq , Nimage_mags); 171 179 gfits_set_bintable_column (&theader, &ftable, "NFIT", nFitPhotom , Nimage_mags); 172 180 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags , Nimage_mags); … … 174 182 gfits_set_bintable_column (&theader, &ftable, "ID", imageID , Nimage_mags); 175 183 176 free (Mcal ); 184 free (McalPSF ); 185 free (McalAPER ); 177 186 free (dMcal ); 178 187 free (dMagSys ); 179 free ( Xm);188 free (McalChiSq ); 180 189 free (nFitPhotom ); 181 190 free (flags ); -
branches/eam_branches/ohana.20170822/src/relphot/src/ImageOps.c
r39643 r40212 143 143 image[i].photom_map_id = input[i].photom_map_id; 144 144 image[i].flags = input[i].flags ; 145 image[i].Mcal = input[i].Mcal ; 145 image[i].McalPSF = input[i].McalPSF ; 146 image[i].McalAPER = input[i].McalAPER ; 146 147 image[i].dMcal = input[i].dMcal ; 147 148 image[i].tzero = input[i].tzero ; … … 179 180 subset[i].photom_map_id = image[i].photom_map_id; 180 181 subset[i].flags = image[i].flags ; 181 subset[i].Mcal = image[i].Mcal ; 182 subset[i].McalPSF = image[i].McalPSF ; 183 subset[i].McalAPER = image[i].McalAPER ; 182 184 subset[i].dMcal = image[i].dMcal ; 183 185 subset[i].tzero = image[i].tzero ; … … 443 445 444 446 if (image[i].flags & IMAGE_BAD) return (NAN); 445 value = image[i].Mcal ;447 value = image[i].McalPSF; 446 448 447 449 // to do this, I need to pass in the catalog and flatcorr pointers … … 470 472 471 473 if (image[i].flags & IMAGE_BAD) return (NAN); 472 value = image[i].Mcal ;474 value = image[i].McalPSF; 473 475 474 476 // to do this, I need to pass in the catalog and flatcorr pointers … … 483 485 } 484 486 485 // returns image.Mcal - ff(x,y)486 487 short getUbercalDist (off_t meas, int cat) { 487 488 … … 499 500 } 500 501 501 // returns image.Mcal - ff(x,y)502 502 float getCenterOffset (off_t meas, int cat, Measure *measure, unsigned int *myID) { 503 503 … … 519 519 } 520 520 521 // returns image.Mcal - ff(x,y)522 521 int MatchImageName (off_t meas, int cat, char *name) { 523 522 … … 542 541 } 543 542 544 // returns image.Mcal - ff(x,y)545 543 int MatchImageSkycellID (off_t meas, int cat, int myTessID, int myProjectionID, int mySkycellID) { 546 544 … … 563 561 } 564 562 565 // returns image.Mcal - ff(x,y)566 563 int FindImageSkycellID (off_t meas, int cat, int *myTessID, int *myProjectionID, int *mySkycellID) { 567 564 … … 703 700 continue; 704 701 } 705 Mrel = getMrel (catalog, m, c); 702 703 // Mrel is the average magnitude for this star. For PS1 stacks, we have too much 704 // PSF variability. We need to calibrate the PSF magnitudes separately from the 705 // Aperture-like magnitues. (We have an option to use the kron magnitudes or the 706 // other apertures here). I basically need to do this analysis separately for each 707 // magnitude type 708 709 Mrel = getMrel (catalog, m, c, MAG_CLASS_PSF, MAG_SRC_CHP); 706 710 if (isnan(Mrel)) { 707 711 Nrel ++; … … 774 778 liststats_irls (refStars, Nref, &stats); 775 779 # endif 776 image[i].Mcal = stats.mean; 780 image[i].McalPSF = stats.mean; 781 image[i].McalAPER = stats.mean; 777 782 image[i].dMcal = stats.error; 778 783 image[i].nFitPhotom = Nref; 779 image[i]. Xm = 100.0*log10(stats.chisq);784 image[i].McalChiSq = stats.chisq; 780 785 Ncalibrated ++; 781 786 … … 787 792 788 793 if ((image[i].imageID == TEST_IMAGE1) || (image[i].imageID == TEST_IMAGE2)) { 789 fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].Mcal , image[i].dMcal);794 fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].McalPSF, image[i].dMcal); 790 795 } 791 796 792 797 if (!mark && VERBOSE_IMAGE) { 793 fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].Mcal , image[i].dMcal);798 fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].McalPSF, image[i].dMcal); 794 799 } 795 800 796 801 if (PLOTSTUFF) { 797 fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].Mcal , image[i].dMcal);802 fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].McalPSF, image[i].dMcal); 798 803 plot_setMcal (refStars->flxlist, Nref, &stats, CLOUD_TOLERANCE); 799 804 } … … 803 808 image[i].dMagSys = stats.sigma; 804 809 805 if (image[i].Mcal < -CLOUD_TOLERANCE) {806 image[i].Mcal = 0.0;810 if (image[i].McalPSF < -CLOUD_TOLERANCE) { 811 image[i].McalPSF = 0.0; 807 812 } 808 813 … … 848 853 if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue; 849 854 850 mlist[N] = image[i].Mcal ;855 mlist[N] = image[i].McalPSF; 851 856 slist[N] = image[i].dMcal; 852 857 dlist[N] = 1; … … 873 878 mark = FALSE; 874 879 image[i].flags &= ~ID_IMAGE_PHOTOM_POOR; 875 mark = (image[i].dMcal > MaxScatter) || (fabs(image[i].Mcal - MedOffset) > MaxOffset);880 mark = (image[i].dMcal > MaxScatter) || (fabs(image[i].McalPSF - MedOffset) > MaxOffset); 876 881 if (mark) { 877 882 Nmark ++; … … 961 966 if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue; 962 967 963 Mlist[Nplot] = image[i].Mcal ;968 Mlist[Nplot] = image[i].McalPSF; 964 969 dlist[Nplot] = image[i].dMcal; 965 970 xlist[Nplot] = image[i].secz; 966 971 minAirmass = MIN (image[i].secz, minAirmass); 967 972 maxAirmass = MAX (image[i].secz, maxAirmass); 968 minMcal = MIN (image[i].Mcal , minMcal);969 maxMcal = MAX (image[i].Mcal , maxMcal);973 minMcal = MIN (image[i].McalPSF, minMcal); 974 maxMcal = MAX (image[i].McalPSF, maxMcal); 970 975 mindMcal = MIN (image[i].dMcal, mindMcal); 971 976 maxdMcal = MAX (image[i].dMcal, maxdMcal); … … 1092 1097 if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue; 1093 1098 1094 list[n] = pow (10.0, 0.01*image[i].Xm);1099 list[n] = image[i].McalChiSq; 1095 1100 dlist[n] = 1; 1096 1101 n++; … … 1125 1130 if (FREEZE_IMAGES && isGPC1chip(image[i].photcode)) continue; 1126 1131 1127 list[n] = image[i].Mcal ;1132 list[n] = image[i].McalPSF; 1128 1133 dlist[n] = 1; 1129 1134 n++; -
branches/eam_branches/ohana.20170822/src/relphot/src/ImageSubset.c
r39478 r40212 63 63 char type[16]; 64 64 65 GET_COLUMN (Mcal, "MCAL", float); 65 GET_COLUMN (McalPSF, "MCAL_PSF", float); 66 GET_COLUMN (McalAPER, "MCAL_APER", float); 66 67 GET_COLUMN (dMcal, "MCAL_ERR", float); 67 68 GET_COLUMN (imageID, "IMAGE_ID", int); … … 79 80 ALLOCATE (image, ImageSubset, Nrow); 80 81 for (i = 0; i < Nrow; i++) { 81 image[i].Mcal = Mcal[i]; 82 image[i].McalPSF = McalPSF[i]; 83 image[i].McalAPER = McalAPER[i]; 82 84 image[i].dMcal = dMcal[i]; 83 85 image[i].imageID = imageID[i]; … … 93 95 fprintf (stderr, "loaded data for %lld images\n", (long long) Nrow); 94 96 95 free (Mcal); 97 free (McalPSF); 98 free (McalAPER); 96 99 free (dMcal); 97 100 free (imageID); … … 151 154 gfits_create_table (&theader, &ftable); 152 155 153 float *Mcal , *dMcal;156 float *McalPSF, *McalAPER, *dMcal; 154 157 unsigned int *imageID, *map, *flags, *tzero; 155 158 int *tessID, *projID, *skycellID; … … 158 161 159 162 // create intermediate storage arrays 160 ALLOCATE (Mcal, float, Nimage); 163 ALLOCATE (McalPSF, float, Nimage); 164 ALLOCATE (McalAPER, float, Nimage); 161 165 ALLOCATE (dMcal, float, Nimage); 162 166 ALLOCATE (imageID, unsigned int, Nimage); … … 172 176 // assign the storage arrays 173 177 for (i = 0; i < Nimage; i++) { 174 Mcal[i] = image[i].Mcal; 178 McalPSF[i] = image[i].McalPSF; 179 McalAPER[i] = image[i].McalAPER; 175 180 dMcal[i] = image[i].dMcal; 176 181 imageID[i] = image[i].imageID; … … 186 191 187 192 // add the columns to the output array 188 gfits_set_bintable_column (&theader, &ftable, "MCAL", Mcal, Nimage); 193 gfits_set_bintable_column (&theader, &ftable, "MCAL_PSF", McalPSF, Nimage); 194 gfits_set_bintable_column (&theader, &ftable, "MCAL_APER", McalAPER, Nimage); 189 195 gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR", dMcal, Nimage); 190 196 gfits_set_bintable_column (&theader, &ftable, "IMAGE_ID", imageID, Nimage); … … 198 204 gfits_set_bintable_column (&theader, &ftable, "UBERCAL_DIST", ucdist, Nimage); 199 205 200 free (Mcal); 206 free (McalPSF); 207 free (McalAPER); 201 208 free (dMcal); 202 209 free (imageID); -
branches/eam_branches/ohana.20170822/src/relphot/src/MosaicOps.c
r39632 r40212 111 111 112 112 /* a new mosaic, define ranges -- preserve the original values incase this image is not used */ 113 mosaic[Nmosaic].start = start; 114 mosaic[Nmosaic].stop = stop; 115 mosaic[Nmosaic].Mcal = 0.0; // note : mosaic stores only offsets relative to the original image values 116 mosaic[Nmosaic].dMcal = 0.0; // note : at the end, mosaic.Mcal is added back to the input images 117 mosaic[Nmosaic].dMsys = 0.0; 118 mosaic[Nmosaic].Xm = 0.0; 119 mosaic[Nmosaic].flags = image[i].flags; 120 mosaic[Nmosaic].secz = image[i].secz; 121 mosaic[Nmosaic].photcode = GetPhotcodeEquivCodebyCode (image[i].photcode); 113 mosaic[Nmosaic].start = start; 114 mosaic[Nmosaic].stop = stop; 115 mosaic[Nmosaic].McalPSF = 0.0; // note : at the end, mosaic.Mcal is added back to the input images 116 mosaic[Nmosaic].McalAPER = 0.0; // note : mosaic stores only offsets relative to the original image values 117 mosaic[Nmosaic].dMcal = 0.0; // note : at the end, mosaic.Mcal is added back to the input images 118 mosaic[Nmosaic].dMsys = 0.0; 119 mosaic[Nmosaic].McalChiSq = 0.0;// NAN or 0.0? 120 mosaic[Nmosaic].flags = image[i].flags; 121 mosaic[Nmosaic].secz = image[i].secz; 122 mosaic[Nmosaic].photcode = GetPhotcodeEquivCodebyCode (image[i].photcode); 122 123 123 124 // XXX do we need to do something about flag consistency across a mosaic? … … 208 209 for (i = 0; i < Nmosaic; i++) { 209 210 /* a new mosaic, define ranges */ 210 mosaic[i].start = startTimesMosaic[i]; 211 mosaic[i].stop = 0; 212 mosaic[i].Mcal = 0.0; 213 mosaic[i].dMcal = 0.0; 214 mosaic[i].dMsys = 0.0; 215 mosaic[i].Xm = 0.0; 216 mosaic[i].flags = 0; 217 mosaic[i].secz = NAN; 218 mosaic[i].photcode = 0; 219 mosaic[i].skipCal = FALSE; 211 mosaic[i].start = startTimesMosaic[i]; 212 mosaic[i].stop = 0; 213 mosaic[i].McalPSF = 0.0; // note : at the end, mosaic.Mcal is added back to the input images 214 mosaic[i].McalAPER = 0.0; // note : mosaic stores only offsets relative to the original image values 215 mosaic[i].dMcal = 0.0; // note : at the end, mosaic.Mcal is added back to the input images 216 mosaic[i].dMsys = 0.0; 217 mosaic[i].McalChiSq = 0.0;// NAN or 0.0? 218 mosaic[i].flags = 0; 219 mosaic[i].secz = NAN; 220 mosaic[i].photcode = 0; 221 mosaic[i].skipCal = FALSE; 220 222 221 223 memset (&mosaic[i].coords, 0, sizeof(Coords)); … … 294 296 abort(); 295 297 } 296 mosaic[j].stop = stop; 297 mosaic[j].Mcal = 0.0; 298 mosaic[j].dMcal = 0.0; 299 mosaic[j].Xm = 0.0; 300 mosaic[j].dMsys = subset[i].flags; 301 mosaic[j].flags = subset[i].flags; 302 mosaic[j].secz = subset[i].secz; 303 mosaic[j].photcode = GetPhotcodeEquivCodebyCode (subset[i].photcode); 298 mosaic[j].stop = stop; 299 300 mosaic[j].McalPSF = 0.0; 301 mosaic[j].McalAPER = 0.0; 302 mosaic[j].dMcal = 0.0; 303 mosaic[j].McalChiSq = 0.0; 304 305 mosaic[j].dMsys = subset[i].flags; 306 mosaic[j].flags = subset[i].flags; 307 mosaic[j].secz = subset[i].secz; 308 mosaic[j].photcode = GetPhotcodeEquivCodebyCode (subset[i].photcode); 304 309 } 305 310 … … 377 382 // init the mosaic array values 378 383 for (i = 0; i < Nmosaic; i++) { 379 mosaic[i].start = startTimesMosaic[i]; 380 mosaic[i].stop = 0; 381 mosaic[i].Mcal = 0.0; 382 mosaic[i].dMcal = 0.0; 383 mosaic[i].dMsys = 0.0; 384 mosaic[i].Xm = 0.0; 385 mosaic[i].flags = 0; 386 mosaic[i].secz = NAN; 387 mosaic[i].photcode = 0; 388 mosaic[i].skipCal = FALSE; 384 mosaic[i].start = startTimesMosaic[i]; 385 mosaic[i].stop = 0; 386 mosaic[i].McalPSF = 0.0; // note : at the end, mosaic.Mcal is added back to the input images 387 mosaic[i].McalAPER = 0.0; // note : mosaic stores only offsets relative to the original image values 388 mosaic[i].dMcal = 0.0; // note : at the end, mosaic.Mcal is added back to the input images 389 mosaic[i].dMsys = 0.0; 390 mosaic[i].McalChiSq = 0.0;// NAN or 0.0? 391 mosaic[i].flags = 0; 392 mosaic[i].secz = NAN; 393 mosaic[i].photcode = 0; 394 mosaic[i].skipCal = FALSE; 389 395 390 396 memset (&mosaic[i].coords, 0, sizeof(Coords)); … … 438 444 } 439 445 mosaic[j].stop = stop; 440 mosaic[j].Mcal = 0.0; 441 mosaic[j].dMcal = 0.0; 442 mosaic[j].Xm = 0.0; 443 mosaic[j].dMsys = image[i].flags; 444 mosaic[j].flags = image[i].flags; 445 mosaic[j].secz = image[i].secz; 446 mosaic[j].photcode = GetPhotcodeEquivCodebyCode (image[i].photcode); 446 mosaic[j].McalPSF = 0.0; 447 mosaic[j].McalAPER = 0.0; 448 mosaic[j].dMcal = 0.0; 449 mosaic[j].McalChiSq = 0.0; 450 mosaic[j].dMsys = image[i].flags; 451 mosaic[j].flags = image[i].flags; 452 mosaic[j].secz = image[i].secz; 453 mosaic[j].photcode = GetPhotcodeEquivCodebyCode (image[i].photcode); 447 454 } 448 455 MARKTIME("assign images to mosaic: %f sec\n", dtime); … … 594 601 mosaic[i].coords.cdelt2 = 1.0 / 3600.0; 595 602 596 mosaic[i].Mcal = 0.0; 597 mosaic[i].dMcal = 0.0; 598 mosaic[i].Xm = 0.0; 603 mosaic[i].McalPSF = 0.0; 604 mosaic[i].McalAPER = 0.0; 605 mosaic[i].dMcal = 0.0; 606 mosaic[i].dMsys = 0.0; 607 mosaic[i].McalChiSq = 0.0; 599 608 } 600 609 return; … … 612 621 double dS, dX, dY; 613 622 double R, D, Rmin, Rmax, Dmin, Dmax; 614 double Mcal , dMcal, Xm;623 double McalPSF, McalAPER, dMcal, McalChiSq; 615 624 616 625 fprintf (stderr, "*** moving Mcal from image.Mcal to mosaic.Mcal ***\n"); … … 621 630 Dmax = Rmax = -360.0; 622 631 dS = 0.0; 623 Mcal = dMcal = Xm= 0;632 McalPSF = McalAPER = dMcal = McalChiSq = 0; 624 633 for (j = 0; j < MosaicN_Image[i]; j++) { 625 634 m = MosaicToImage[i][j]; … … 678 687 // if it helps, note that ubercal uses a single zp per exposure, so the mean of those values is the same as the value 679 688 680 Mcal += image[m].Mcal; 681 dMcal += image[m].dMcal; 682 Xm += image[m].Xm; 683 684 image[m].Mcal = 0.0; 685 image[m].dMcal = NAN; 686 image[m].Xm = NAN_S_SHORT; 689 McalPSF += image[m].McalPSF; 690 McalAPER += image[m].McalAPER; 691 dMcal += image[m].dMcal; 692 McalChiSq += image[m].McalChiSq; 693 694 image[m].McalPSF = 0.0; 695 image[m].McalAPER = 0.0; 696 image[m].dMcal = NAN; 697 image[m].McalChiSq = NAN; 687 698 } 688 699 dS /= MosaicN_Image[i]; … … 696 707 RD_to_XY (&dX, &dY, Rmax, Dmax, &mosaic[i].coords); 697 708 698 mosaic[i].Mcal = Mcal / MosaicN_Image[i]; 699 mosaic[i].dMcal = dMcal / MosaicN_Image[i]; 700 mosaic[i].Xm = Xm / MosaicN_Image[i]; 709 mosaic[i].McalPSF = McalPSF / MosaicN_Image[i]; 710 mosaic[i].McalAPER = McalAPER / MosaicN_Image[i]; 711 mosaic[i].dMcal = dMcal / MosaicN_Image[i]; 712 mosaic[i].McalChiSq = McalChiSq / MosaicN_Image[i]; 701 713 } 702 714 if (!USE_GRID) return; … … 724 736 for (j = 0; j < MosaicN_Image[i]; j++) { 725 737 im = MosaicToImage[i][j]; 726 image[im].Mcal += mosaic[i].Mcal; 727 image[im].dMcal = mosaic[i].dMcal; 728 image[im].Xm = mosaic[i].Xm; 738 image[im].McalPSF += mosaic[i].McalPSF; 739 image[im].McalAPER += mosaic[i].McalAPER; 740 image[im].dMcal = mosaic[i].dMcal; 741 image[im].McalChiSq = mosaic[i].McalChiSq; 729 742 image[im].ubercalDist = mosaic[i].ubercalDist; 730 image[im].dMagSys = mosaic[i].dMsys; 731 image[im].nFitPhotom = mosaic[i].nFitPhotom; 732 image[im].flags |= (mosaic[i].flags & ID_IMAGE_PHOTOM_FEW); 733 image[im].flags |= (mosaic[i].flags & ID_IMAGE_PHOTOM_POOR); 734 } 735 mosaic[i].Mcal = 0.0; 743 image[im].dMagSys = mosaic[i].dMsys; 744 image[im].nFitPhotom = mosaic[i].nFitPhotom; 745 image[im].flags |= (mosaic[i].flags & ID_IMAGE_PHOTOM_FEW); 746 image[im].flags |= (mosaic[i].flags & ID_IMAGE_PHOTOM_POOR); 747 } 748 mosaic[i].McalPSF = 0.0; 749 mosaic[i].McalAPER = 0.0; 736 750 } 737 751 } … … 886 900 887 901 if (mosaic[i].flags & IMAGE_BAD) return (NAN); 888 value = mosaic[i].Mcal ;902 value = mosaic[i].McalPSF; 889 903 return (value); 890 904 } … … 1130 1144 off_t c = MosaicToCatalog[Nmos][j]; 1131 1145 1146 // NOTE : we are only using Mcal == McalPSF in this function; we set McalAPER to McalPSF 1132 1147 if (fout) { 1133 1148 Mcal = getMcal (m, c, flatcorr, catalog); 1134 1149 Mgrid = getMgrid (m, c); 1135 Mrel = getMrel (catalog, m, c );1150 Mrel = getMrel (catalog, m, c, MAG_CLASS_PSF, MAG_SRC_CHP); 1136 1151 Mflat = getMflat (m, c, flatcorr, catalog); 1137 1152 … … 1160 1175 continue; 1161 1176 } 1162 Mrel = getMrel (catalog, m, c );1177 Mrel = getMrel (catalog, m, c, MAG_CLASS_PSF, MAG_SRC_CHP); 1163 1178 if (isnan(Mrel)) { 1164 1179 info->Nrel ++; … … 1226 1241 if (VERBOSE2 && info->PoorImages) fprintf (stderr, "Mmos: %f %f %d %d\n", stats.mean, stats.sigma, stats.Nmeas, N); 1227 1242 1228 myMosaic[0].Mcal = stats.mean; 1229 myMosaic[0].dMcal = stats.error; 1243 // for now, I have no reason to measure these separately for camera-level images 1244 myMosaic[0].McalPSF = stats.mean; 1245 myMosaic[0].McalAPER = stats.mean; 1246 myMosaic[0].dMcal = stats.error; 1247 myMosaic[0].McalChiSq = stats.chisq; 1230 1248 myMosaic[0].nFitPhotom = N; 1231 myMosaic[0].Xm = 100.0*log10(stats.chisq);1232 1249 1233 1250 if (testImage) { … … 1244 1261 myMosaic[0].dMsys = stats.sigma; 1245 1262 1246 if (myMosaic[0].Mcal < -CLOUD_TOLERANCE) {1247 myMosaic[0].Mcal = 0.0;1263 if (myMosaic[0].McalPSF < -CLOUD_TOLERANCE) { 1264 myMosaic[0].McalPSF = 0.0; 1248 1265 } 1249 1266 1250 1267 if (testImage) { 1251 fprintf (stderr, "%f %f : %f\n", myMosaic[0].Mcal , myMosaic[0].dMsys, pow (10.0, 0.01*myMosaic[0].Xm));1268 fprintf (stderr, "%f %f : %f\n", myMosaic[0].McalPSF, myMosaic[0].dMsys, myMosaic[0].McalChiSq); 1252 1269 } 1253 1270 … … 1427 1444 imageOffset[i] = 0.0; 1428 1445 1429 if (VERBOSE2 && (fabs(mosaic[i].Mcal ) < CLOUD_TOLERANCE)) {1430 fprintf (stderr, "cloud-free: %s : %f\n", image[MosaicToImage[i][0]].name, mosaic[i].Mcal );1446 if (VERBOSE2 && (fabs(mosaic[i].McalPSF) < CLOUD_TOLERANCE)) { 1447 fprintf (stderr, "cloud-free: %s : %f\n", image[MosaicToImage[i][0]].name, mosaic[i].McalPSF); 1431 1448 } 1432 if (VERBOSE2 && (mosaic[i].Mcal < -CLOUD_TOLERANCE)) {1433 imageOffset[i] = -mosaic[i].Mcal ;1434 // NOTE the negative sign: down below, we are going to add in the negative of Mcal 1449 if (VERBOSE2 && (mosaic[i].McalPSF < -CLOUD_TOLERANCE)) { 1450 imageOffset[i] = -mosaic[i].McalPSF; 1451 // NOTE the negative sign: down below, we are going to add in the negative of McalPSF 1435 1452 // to this image, and the propagated mean values for other images 1436 fprintf (stderr, "anti-clouds: %s : %f\n", image[MosaicToImage[i][0]].name, mosaic[i].Mcal );1453 fprintf (stderr, "anti-clouds: %s : %f\n", image[MosaicToImage[i][0]].name, mosaic[i].McalPSF); 1437 1454 } 1438 if (VERBOSE2 && (mosaic[i].Mcal > CLOUD_TOLERANCE)) {1439 fprintf (stderr, "cloudy : %s : %f\n", image[MosaicToImage[i][0]].name, mosaic[i].Mcal );1455 if (VERBOSE2 && (mosaic[i].McalPSF > CLOUD_TOLERANCE)) { 1456 fprintf (stderr, "cloudy : %s : %f\n", image[MosaicToImage[i][0]].name, mosaic[i].McalPSF); 1440 1457 } 1441 1458 } … … 1540 1557 } 1541 1558 1542 // a negative cloud image (cloud: Mcal > 0; anti-clouds: Mcal < 0; imageOffset = -Mcal)1559 // a negative cloud image (cloud: McalPSF > 0; anti-clouds: McalPSF < 0; imageOffset = -McalPSF) 1543 1560 if (imageOffset[i] > 0.0) continue; 1544 1561 … … 1564 1581 // find the images / mosaics with negative clouds and save their offset 1565 1582 for (i = 0; i < Nmosaic; i++) { 1566 mosaic[i].Mcal += imageOffset[i];1583 mosaic[i].McalPSF += imageOffset[i]; 1567 1584 } 1568 1585 … … 1605 1622 if (KEEP_UBERCAL && (mosaic[i].flags & ID_IMAGE_PHOTOM_UBERCAL)) continue; 1606 1623 1607 list[n] = mosaic[i].Mcal ;1624 list[n] = mosaic[i].McalPSF; 1608 1625 dlist[n] = 1; 1609 1626 n++; … … 1681 1698 Mgrid = getMgrid (m, c); 1682 1699 if (isnan(Mgrid)) continue; 1683 Mrel = getMrel (catalog, m, c );1700 Mrel = getMrel (catalog, m, c, MAG_CLASS_PSF, MAG_SRC_CHP); 1684 1701 if (isnan(Mrel)) continue; 1685 1702 N++; … … 1719 1736 if (KEEP_UBERCAL && (mosaic[i].flags & ID_IMAGE_PHOTOM_UBERCAL)) continue; 1720 1737 1721 list[n] = pow (10.0, 0.01*mosaic[i].Xm);1738 list[n] = mosaic[i].McalChiSq; 1722 1739 dlist[n] = 1; 1723 1740 n++; … … 1751 1768 if (mosaic[i].flags & IMAGE_BAD) continue; 1752 1769 if (mosaic[i].skipCal) continue; 1753 mlist[N] = mosaic[i].Mcal ;1770 mlist[N] = mosaic[i].McalPSF; 1754 1771 slist[N] = mosaic[i].dMcal; 1755 1772 dlist[N] = 1; … … 1781 1798 Nscatter ++; 1782 1799 } 1783 if (fabs(mosaic[i].Mcal - MedOffset) > MaxOffset) {1800 if (fabs(mosaic[i].McalPSF - MedOffset) > MaxOffset) { 1784 1801 mark = TRUE; 1785 1802 Noffset ++; … … 1858 1875 1859 1876 for (i = 0; i < Nmosaic; i++) { 1860 Mlist[i] = mosaic[i].Mcal ;1877 Mlist[i] = mosaic[i].McalPSF; 1861 1878 dlist[i] = mosaic[i].dMcal; 1862 1879 xlist[i] = mosaic[i].secz; -
branches/eam_branches/ohana.20170822/src/relphot/src/StarOps.c
r40019 r40212 34 34 } 35 35 36 float getMrel (Catalog *catalog, off_t meas, int cat) { 37 38 int Nsec, Nsecfilt, photcode; 39 int ave; 40 float value; 41 42 ave = catalog[cat].measureT[meas].averef; 43 photcode = catalog[cat].measureT[meas].photcode; 36 // 37 float getMrel (Catalog *catalog, off_t meas, int cat, dvoMagClassType class, dvoMagSourceType source) { 38 39 int ave = catalog[cat].measureT[meas].averef; 40 int photcode = catalog[cat].measureT[meas].photcode; 44 41 45 42 int ecode = GetPhotcodeEquivCodebyCode (photcode); 46 Nsec = GetPhotcodeNsec(ecode); 47 Nsecfilt = GetPhotcodeNsecfilt (); 43 int Nsec = GetPhotcodeNsec(ecode); 44 int Nsecfilt = GetPhotcodeNsecfilt (); 45 46 int entry = Nsecfilt*ave+Nsec; 47 48 SecFilt *secfilt = &catalog[cat].secfilt[entry]; 48 49 49 50 // is this star OK? 50 if (catalog[cat].secfilt[Nsecfilt*ave+Nsec].flags & STAR_BAD) return (NAN); 51 52 value = catalog[cat].secfilt[Nsecfilt*ave+Nsec].M; 53 return (value); 51 if (secfilt->flags & STAR_BAD) return (NAN); 52 53 switch (class) { 54 case MAG_CLASS_PSF: 55 switch (source) { 56 case MAG_SRC_CHP: 57 return secfilt->MpsfChp; 58 case MAG_SRC_WRP: 59 return secfilt->MpsfWrp; 60 case MAG_SRC_STK: 61 return secfilt->MpsfStk; 62 default: 63 return NAN; 64 } 65 break; 66 case MAG_CLASS_KRON: 67 switch (source) { 68 case MAG_SRC_CHP: 69 return secfilt->MkronChp; 70 case MAG_SRC_WRP: 71 return secfilt->MkronWrp; 72 case MAG_SRC_STK: 73 return secfilt->MkronStk; 74 default: 75 return NAN; 76 } 77 break; 78 case MAG_CLASS_APER: 79 switch (source) { 80 case MAG_SRC_CHP: 81 return secfilt->MapChp; 82 case MAG_SRC_WRP: 83 return secfilt->MapWrp; 84 case MAG_SRC_STK: 85 return secfilt->MapStk; 86 default: 87 return NAN; 88 } 89 break; 90 case MAG_CLASS_NONE: 91 case MAG_CLASS_DEV: // DeVaucouleur Model (only for galphot) 92 case MAG_CLASS_EXP: // Exponential Model (only for galphot) 93 case MAG_CLASS_SER: // Sersic Model (only for galphot) 94 return NAN; 95 break; 96 } 97 return NAN; // should not be able to reach here 54 98 } 55 99 … … 513 557 if (VERBOSE) fprintf (stderr, "marking poor stars\n"); 514 558 515 /* find Xmmedian -> ChiSq lim must be > median */559 /* find Mchisq median -> ChiSq lim must be > median */ 516 560 for (i = Ntot = 0; i < Ncatalog; i++) { 517 561 Ntot += catalog[i].Naverage; … … 535 579 if (isnan(Mchisq)) continue; 536 580 xlist[Ntot] = Mchisq; 537 slist[Ntot] = catalog[i].secfilt[Nsecfilt*j+Nsec].dM ;581 slist[Ntot] = catalog[i].secfilt[Nsecfilt*j+Nsec].dMpsfChp; 538 582 dlist[Ntot] = 1; 539 583 Ntot ++; … … 551 595 for (i = 0; i < Ncatalog; i++) { 552 596 for (j = 0; j < catalog[i].Naverage; j++) { 553 dM = catalog[i].secfilt[Nsecfilt*j+Nsec].dM ;597 dM = catalog[i].secfilt[Nsecfilt*j+Nsec].dMpsfChp; 554 598 float Mchisq = catalog[i].secfilt[Nsecfilt*j+Nsec].Mchisq; 555 599 mark = (dM > MaxScatter) || (isnan(Mchisq)) || (Mchisq > MaxChisq); … … 865 909 if (catalog[i].secfilt[Nsecfilt*j+Nsec].flags & STAR_BAD) continue; 866 910 867 dM = catalog[i].secfilt[Nsecfilt*j+Nsec].dM ;911 dM = catalog[i].secfilt[Nsecfilt*j+Nsec].dMpsfChp; 868 912 if (isnan(dM)) continue; 869 913 list[n] = dM; … … 906 950 for (j = 0; j < catalog[i].Naverage; j++) { 907 951 if (catalog[i].secfilt[Nsecfilt*j+Nsec].flags & STAR_BAD) continue; 908 dMrel = catalog[i].secfilt[Nsecfilt*j+Nsec].dM ;952 dMrel = catalog[i].secfilt[Nsecfilt*j+Nsec].dMpsfChp; 909 953 bin = dMrel / 0.00025; 910 954 bin = MAX (0, MIN (NBIN-1, bin)); … … 946 990 for (j = 0; j < catalog[i].Naverage; j++) { 947 991 if (catalog[i].secfilt[Nsecfilt*j+Nsec].flags & STAR_BAD) continue; 948 xlist[N] = catalog[i].secfilt[Nsecfilt*j+Nsec].M ;992 xlist[N] = catalog[i].secfilt[Nsecfilt*j+Nsec].MpsfChp; 949 993 value = catalog[i].secfilt[Nsecfilt*j+Nsec].Mchisq; 950 994 if (isnan((double)(value))) continue; -
branches/eam_branches/ohana.20170822/src/relphot/src/plot_scatter.c
r37037 r40212 47 47 if (isnan(Mgrid)) continue; 48 48 49 Mrel = catalog[i].secfilt[Nsecfilt*j+Nsec].M ;49 Mrel = catalog[i].secfilt[Nsecfilt*j+Nsec].MpsfChp; 50 50 if (isnan(Mrel)) continue; 51 51 -
branches/eam_branches/ohana.20170822/src/relphot/src/relphot_synthphot_catalog.c
r38062 r40212 92 92 float *value = (float *) zpts->matrix[Nsec].buffer; 93 93 float ZP = !isnan(value[Npix]) ? value[Npix] : 0.0; 94 secfilt[Nsec].M = measure[measSYN[i]].M + ZP;95 secfilt[Nsec].dM = 0.6;96 secfilt[Nsec].Mchisq = NAN;97 secfilt[Nsec].flags |= ID_SECF_USE_SYNTH;94 secfilt[Nsec].MpsfChp = measure[measSYN[i]].M + ZP; 95 secfilt[Nsec].dMpsfChp = 0.6; 96 secfilt[Nsec].Mchisq = NAN; 97 secfilt[Nsec].flags |= ID_SECF_USE_SYNTH; 98 98 } 99 99 } -
branches/eam_branches/ohana.20170822/src/relphot/src/select_images.c
r39648 r40212 259 259 if (RESET_ZEROPTS) { 260 260 if (!KEEP_UBERCAL || !(image[nimage].flags & ID_IMAGE_PHOTOM_UBERCAL)) { 261 image[nimage].Mcal = 0.0; 262 image[nimage].dMcal = NAN; 263 image[nimage].flags &= ~ID_IMAGE_PHOTOM_UBERCAL; 261 image[nimage].McalPSF = 0.0; 262 image[nimage].McalAPER = 0.0; 263 image[nimage].dMcal = NAN; 264 image[nimage].flags &= ~ID_IMAGE_PHOTOM_UBERCAL; 264 265 } 265 266 } -
branches/eam_branches/ohana.20170822/src/relphot/src/setMrelCatalog.c
r39926 r40212 377 377 } 378 378 } 379 secfilt[Nsec].M = Mpsf + ZP;380 secfilt[Nsec].dM = 0.6;381 secfilt[Nsec].Mchisq = 0.0;382 secfilt[Nsec].flags |= ID_SECF_USE_SYNTH;379 secfilt[Nsec].MpsfChp = Mpsf + ZP; 380 secfilt[Nsec].dMpsfChp = 0.6; 381 secfilt[Nsec].Mchisq = 0.0; 382 secfilt[Nsec].flags |= ID_SECF_USE_SYNTH; 383 383 continue; 384 384 } … … 390 390 secfilt[Nsec].flags |= ID_OBJ_FEW; 391 391 } else { 392 secfilt[Nsec].M = psfstats->mean;393 secfilt[Nsec].dM = psfstats->error;394 secfilt[Nsec].Mchisq = (psfstats->Nmeas > 1) ? psfstats->chisq : NAN;392 secfilt[Nsec].MpsfChp = psfstats->mean; 393 secfilt[Nsec].dMpsfChp = psfstats->error; 394 secfilt[Nsec].Mchisq = (psfstats->Nmeas > 1) ? psfstats->chisq : NAN; 395 395 } 396 396 int minRankPSF = (Nranking > 0) ? results->psfData[Nsec].ranking[0] : 10; … … 410 410 411 411 if (Nranking) { 412 secfilt[Nsec]. Mstdev= psfstats->sigma;413 secfilt[Nsec].Nused = psfstats->Nmeas;414 secfilt[Nsec].Mmax = psfstats->max;415 secfilt[Nsec].Mmin = psfstats->min;412 secfilt[Nsec].sMpsfChp = psfstats->sigma; 413 secfilt[Nsec].Nused = psfstats->Nmeas; 414 secfilt[Nsec].Mmax = psfstats->max; 415 secfilt[Nsec].Mmin = psfstats->min; 416 416 } 417 417 secfilt[Nsec].psfQfMax = results->psfQfMax[Nsec]; … … 424 424 Nranking = MAG_STATS_BY_RANKING (&results->aperData[Nsec], apstats); 425 425 if (Nranking) { 426 secfilt[Nsec].Map = apstats->mean;427 secfilt[Nsec].dMap = apstats->error;428 secfilt[Nsec].sMap = apstats->sigma;426 secfilt[Nsec].MapChp = apstats->mean; 427 secfilt[Nsec].dMapChp = apstats->error; 428 secfilt[Nsec].sMapChp = apstats->sigma; 429 429 secfilt[Nsec].NusedAp = Nranking; 430 430 } … … 435 435 Nranking = MAG_STATS_BY_RANKING (&results->kronData[Nsec], kronstats); 436 436 if (Nranking) { 437 secfilt[Nsec].Mkron = kronstats->mean;438 secfilt[Nsec].dMkron = kronstats->error;439 secfilt[Nsec].sMkron = kronstats->sigma;437 secfilt[Nsec].MkronChp = kronstats->mean; 438 secfilt[Nsec].dMkronChp = kronstats->error; 439 secfilt[Nsec].sMkronChp = kronstats->sigma; 440 440 secfilt[Nsec].NusedKron = Nranking; 441 441 } -
branches/eam_branches/ohana.20170822/src/relphot/src/setMrelFinal.c
r39632 r40212 105 105 ALLOCATE (catalog[0].measureRank, char, catalog[0].Nmeasure); 106 106 setMeasureRank (catalog); 107 setMrelOutput (catalog, 1, flatcorr); // sets the values secfilt.M = <measure.M + measure.Mflat - image.Mcal>107 setMrelOutput (catalog, 1, flatcorr); // sets the values secfilt.MpsfChp = <measure.M + measure.Mflat - image.Mcal> 108 108 setMcalOutput (catalog, 1, flatcorr); // sets measure.Mcal = image.Mcal 109 109 -
branches/eam_branches/ohana.20170822/src/relphot/src/share_image_mags.c
r36630 r40212 74 74 continue; 75 75 } 76 images[seq].Mcal = image_mags[i].Mcal; 76 images[seq].McalPSF = image_mags[i].McalPSF; 77 images[seq].McalAPER = image_mags[i].McalAPER; 77 78 images[seq].dMcal = image_mags[i].dMcal; 78 79 images[seq].dMagSys = image_mags[i].dMagSys; 79 images[seq]. Xm = image_mags[i].Xm;80 images[seq].McalChiSq = image_mags[i].McalChiSq; 80 81 images[seq].nFitPhotom = image_mags[i].nFitPhotom; 81 82 images[seq].flags = image_mags[i].flags; … … 91 92 int set_image_mags (ImageMag *image_mags, Image *image) { 92 93 93 image_mags->Mcal = image->Mcal; 94 image_mags->McalPSF = image->McalPSF; 95 image_mags->McalAPER = image->McalAPER; 94 96 image_mags->dMcal = image->dMcal; 95 97 image_mags->dMagSys = image->dMagSys; 96 image_mags-> Xm = image->Xm;98 image_mags->McalChiSq = image->McalChiSq; 97 99 image_mags->nFitPhotom = image->nFitPhotom; 98 100 image_mags->flags = image->flags; -
branches/eam_branches/ohana.20170822/src/relphot/src/share_mean_mags.c
r39457 r40212 111 111 if (Nsec < 0) continue; 112 112 113 catalog[catSeq].secfilt[objSeq*Nsecfilt + Nsec].M = meanmags[i].M;113 catalog[catSeq].secfilt[objSeq*Nsecfilt + Nsec].MpsfChp = meanmags[i].M; 114 114 } 115 115 free (meanmags); … … 122 122 int set_mean_mags (MeanMag *meanmags, AverageTiny *average, SecFilt *secfilt, int Nsec) { 123 123 124 meanmags->M = secfilt->M ;125 meanmags->dM = secfilt->dM ;124 meanmags->M = secfilt->MpsfChp; 125 meanmags->dM = secfilt->dMpsfChp; 126 126 meanmags->Mchisq = secfilt->Mchisq; 127 127 meanmags->Nsec = Nsec; // key to secfilt entry -
branches/eam_branches/ohana.20170822/src/relphot/src/synthetic_mags.c
r39457 r40212 37 37 // (r - i > 0.5) : w = r + 0.268 - 0.435 (r-i) - 0.078(r-i)^2 38 38 39 float Mr = secfilt[NSr].M ;40 float Mi = secfilt[NSi].M ;39 float Mr = secfilt[NSr].MpsfChp; 40 float Mi = secfilt[NSi].MpsfChp; 41 41 42 42 if (!isfinite(Mr)) return FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.
