Changeset 40244 for branches/eam_branches/ohana.20170822/src/relphot
- Timestamp:
- Dec 5, 2017, 6:04:35 AM (9 years ago)
- Location:
- branches/eam_branches/ohana.20170822/src/relphot/src
- Files:
-
- 5 edited
-
BrightCatalog.c (modified) (7 diffs)
-
StarOps.c (modified) (5 diffs)
-
bcatalog.c (modified) (1 diff)
-
setMrelCatalog.c (modified) (6 diffs)
-
setMrelFinal.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20170822/src/relphot/src/BrightCatalog.c
r40212 r40244 66 66 GET_COLUMN(D, "DEC", double); 67 67 GET_COLUMN(M, "MAG_SYS", float); 68 GET_COLUMN(Mcal, "MAG_CAL", float); 68 GET_COLUMN(McalPSF, "MCAL_PSF", float); 69 GET_COLUMN(McalAPER, "MCAL_APER", float); 69 70 GET_COLUMN(Mflat, "MAG_FLAT", float); 70 71 GET_COLUMN(dM, "MAG_ERR", float); … … 89 90 measure[i].D = D[i]; 90 91 measure[i].M = M[i]; 91 measure[i].Mcal = Mcal[i]; 92 measure[i].McalPSF = McalPSF[i]; 93 measure[i].McalAPER = McalAPER[i]; 92 94 measure[i].Mflat = Mflat[i]; 93 95 measure[i].dM = dM[i]; … … 110 112 free (D ); 111 113 free (M ); 112 free (Mcal ); 114 free (McalPSF ); 115 free (McalAPER); 113 116 free (Mflat ); 114 117 free (dM ); … … 293 296 double *D ; ALLOCATE (D , double, catalog->Nmeasure); 294 297 float *M ; ALLOCATE (M , float, catalog->Nmeasure); 295 float *Mcal ; ALLOCATE (Mcal , float, catalog->Nmeasure); 298 float *McalPSF ; ALLOCATE (McalPSF , float, catalog->Nmeasure); 299 float *McalAPER ; ALLOCATE (McalAPER , float, catalog->Nmeasure); 296 300 float *Mflat ; ALLOCATE (Mflat , float, catalog->Nmeasure); 297 301 float *dM ; ALLOCATE (dM , float, catalog->Nmeasure); … … 311 315 MeasureTiny *measure = catalog->measure; 312 316 for (i = 0; i < catalog->Nmeasure; i++) { 313 R[i] = measure[i].R ;314 D[i] = measure[i].D ;317 R[i] = measure[i].R ; 318 D[i] = measure[i].D ; 315 319 M[i] = measure[i].M ; 316 Mcal[i] = measure[i].Mcal ; 320 McalPSF[i] = measure[i].McalPSF ; 321 McalAPER[i] = measure[i].McalAPER ; 317 322 Mflat[i] = measure[i].Mflat ; 318 323 dM[i] = measure[i].dM ; … … 334 339 gfits_set_bintable_column (&theader, &ftable, "DEC", D, catalog->Nmeasure); 335 340 gfits_set_bintable_column (&theader, &ftable, "MAG_SYS", M, catalog->Nmeasure); 336 gfits_set_bintable_column (&theader, &ftable, "MAG_CAL", Mcal, catalog->Nmeasure); 341 gfits_set_bintable_column (&theader, &ftable, "MCAL_PSF", McalPSF, catalog->Nmeasure); 342 gfits_set_bintable_column (&theader, &ftable, "MCAL_APER", McalAPER, catalog->Nmeasure); 337 343 gfits_set_bintable_column (&theader, &ftable, "MAG_FLAT", Mflat, catalog->Nmeasure); 338 344 gfits_set_bintable_column (&theader, &ftable, "MAG_ERR", dM, catalog->Nmeasure); … … 352 358 free (D ); 353 359 free (M ); 354 free (Mcal ); 360 free (McalPSF ); 361 free (McalAPER); 355 362 free (Mflat ); 356 363 free (dM ); -
branches/eam_branches/ohana.20170822/src/relphot/src/StarOps.c
r40231 r40244 473 473 int i; 474 474 off_t j, k, m; 475 float Mcal, Mmos, Mgrid;476 475 477 476 MEAS_BAD = ID_MEAS_NOCAL; … … 484 483 for (k = 0; k < catalog[i].averageT[j].Nmeasure; k++, m++) { 485 484 if (catalog[i].measureT[m].dbFlags & MEAS_BAD) continue; 486 Mcal = getMcal (m, i, MAG_CLASS_PSF); 487 if (isnan(Mcal)) continue; 488 Mmos = getMmos (m, i); 485 float McalPSF = getMcal (m, i, MAG_CLASS_PSF); 486 float McalAPER = getMcal (m, i, MAG_CLASS_APER); 487 if (isnan(McalPSF)) continue; 488 float Mmos = getMmos (m, i); 489 489 if (isnan(Mmos)) continue; 490 Mgrid = getMgrid (m, i);490 float Mgrid = getMgrid (m, i); 491 491 if (isnan(Mgrid)) continue; 492 493 // XXX note that this operation is setting measure->McalAPER to image->McalAPER 494 // regardless of how the average value was calculate. 495 // IF average.Mkron (e.g.) is calculated using image.McalPSF, we should store McalPSF for both 496 // of these items below 492 497 493 498 // note that measurements for which the image is not selected will not be modified … … 495 500 496 501 // set the output calibration 497 catalog[i].measure[m].Mcal = Mcal + Mmos + Mgrid; 502 catalog[i].measure[m].McalPSF = McalPSF + Mmos + Mgrid; 503 catalog[i].measure[m].McalAPER = McalAPER + Mmos + Mgrid; 498 504 499 505 if (catalog[i].measureT[m].dbFlags & ID_MEAS_PHOTOM_UBERCAL) { 500 myAssert (isfinite(catalog[i].measure[m].Mcal ), "oops, broke an ubercal mag");506 myAssert (isfinite(catalog[i].measure[m].McalPSF), "oops, broke an ubercal mag"); 501 507 } 502 508 } … … 560 566 int m = catalog[i].averageT[j].measureOffset; 561 567 for (n = 0; n < catalog[i].averageT[j].Nmeasure; n++) { 562 fprintf (fout, "meas %5d %5d | %6.3f %6.3f | %6.3f \n", m+n, catalog[i].measureT[m+n].photcode, catalog[i].measureT[m+n].M, catalog[i].measureT[m+n].Mkron, catalog[i].measureT[m+n].Mcal);568 fprintf (fout, "meas %5d %5d | %6.3f %6.3f | %6.3f %6.3f\n", m+n, catalog[i].measureT[m+n].photcode, catalog[i].measureT[m+n].M, catalog[i].measureT[m+n].Mkron, catalog[i].measureT[m+n].McalPSF, catalog[i].measureT[m+n].McalAPER); 563 569 } 564 570 } … … 643 649 // sigma of the INNER 50% mean. it then flags any measurements which are more than 644 650 // NSIGMA_REJECT (5) sigma of the mean 651 652 // this function only operations on the PSF magnitudes 645 653 646 654 # define NSIGMA_CLIP 3.0 -
branches/eam_branches/ohana.20170822/src/relphot/src/bcatalog.c
r39641 r40244 153 153 if (subcatalog[0].measureT[Nmeasure].dbFlags & ID_MEAS_PHOTOM_UBERCAL) { 154 154 if (!KEEP_UBERCAL) { 155 subcatalog[0].measureT[Nmeasure].Mcal = 0.0; 155 subcatalog[0].measureT[Nmeasure].McalPSF = 0.0; 156 subcatalog[0].measureT[Nmeasure].McalAPER = 0.0; 156 157 subcatalog[0].measureT[Nmeasure].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL; 157 158 } 158 159 } else { 159 160 if (getImageEntry (Nmeasure, Ncat) >= 0) { 160 subcatalog[0].measureT[Nmeasure].Mcal = 0.0; 161 subcatalog[0].measureT[Nmeasure].McalPSF = 0.0; 162 subcatalog[0].measureT[Nmeasure].McalAPER = 0.0; 161 163 } 162 164 } -
branches/eam_branches/ohana.20170822/src/relphot/src/setMrelCatalog.c
r40231 r40244 102 102 // 3) UBERCAL measurements can have their weight increased by a big factor to help tie down the averages 103 103 // 4) some reference photcode of some kind can be specified as fixed and have a high weight 104 105 // Although I calculate McalAPER for exposures, I am only using McalPSF for exposures 106 // XXX this means that a query of the database for mag:rel:kron will be inconsistent if there 107 // is any significant difference 104 108 105 109 // set mean of chip measurements (selected by photcode range for now): … … 224 228 // overlaps). Msys + measure.Mcal is our best guess of the true magnitude 225 229 Mmos = Mgrid = 0; 226 Mcal = measureT[k].Mcal ; // check that this is zero for loaded REF value230 Mcal = measureT[k].McalPSF; // check that this is zero for loaded REF value 227 231 } else { 228 232 // getMcal returns image[].Mcal; note the flat-field correction is stored in measure.Mflat … … 521 525 // 2) select the BEST detections per filter (regardless of PRIMARY) 522 526 // 3) apply the zero point and AB->Jy transformations 527 528 // I calculate McalAPER and McalPSF independently for stacks. I use McalAPER for Mkron 529 // and Map, and McalPSF for Mpsf. A query of the database for mag:rel:kron will be 530 // inconsistent if there is any significant difference 531 523 532 int setMrelAverageStack (Catalog *catalog, int cat, off_t ave, int Nsecfilt, FlatCorrectionTable *flatcorr) { 524 533 … … 633 642 // overlaps). Msys + measure.Mcal is our best guess of the true magnitude 634 643 Mmos = Mgrid = 0; 635 McalPSF = measure[k].Mcal ; // check that this is zero for loaded REF value644 McalPSF = measure[k].McalPSF; // check that this is zero for loaded REF value 636 645 McalAPER = McalPSF; // check that this is zero for loaded REF value 637 646 } else { … … 791 800 // * no grid, no mosaic, no 2MASS, no SYNTH, no Ubercal, no flatcorr 792 801 // analysis is done on flux, not mags (as the faintest objects will be nearly insignificant) 802 803 // Although I calculate McalAPER for exposures, I am only using McalPSF for exposures 804 // XXX this means that a query of the database for mag:rel:kron will be inconsistent if there 805 // is any significant difference 806 793 807 int setMrelAverageForcedWarp (Catalog *catalog, int cat, off_t ave, int Nsecfilt, FlatCorrectionTable *flatcorr, SetMrelInfo *results) { 794 808 OHANA_UNUSED_PARAM(flatcorr); … … 868 882 // data for which the associated image has not been loaded (probably because of 869 883 // overlaps). Msys + measure.Mcal is our best guess of the true magnitude 870 Mcal = measure[k].Mcal ; // check that this is zero for loaded REF value884 Mcal = measure[k].McalPSF; // check that this is zero for loaded REF value 871 885 } else { 872 886 Mcal = getMcal (meas, cat, MAG_CLASS_PSF); -
branches/eam_branches/ohana.20170822/src/relphot/src/setMrelFinal.c
r40213 r40244 65 65 if (catalog[0].measure[m].dbFlags & ID_MEAS_PHOTOM_UBERCAL) { 66 66 if (!KEEP_UBERCAL) { 67 catalog[0].measure[m].Mcal = 0.0; 67 catalog[0].measure[m].McalPSF = 0.0; 68 catalog[0].measure[m].McalAPER = 0.0; 68 69 catalog[0].measure[m].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL; 69 70 } 70 71 } else { 71 72 if (RESET_ZEROPTS && (getImageEntry (m, 0) >= 0)) { 72 catalog[0].measure[m].Mcal = 0.0; 73 catalog[0].measure[m].McalPSF = 0.0; 74 catalog[0].measure[m].McalAPER = 0.0; 73 75 } 74 76 }
Note:
See TracChangeset
for help on using the changeset viewer.
