Changeset 40244
- Timestamp:
- Dec 5, 2017, 6:04:35 AM (9 years ago)
- Location:
- branches/eam_branches/ohana.20170822/src
- Files:
-
- 24 edited
-
addstar/src/FilterStars.c (modified) (1 diff)
-
addstar/src/ReadStarsUKIRT.c (modified) (1 diff)
-
addstar/src/SEDfit.c (modified) (1 diff)
-
addstar/src/find_proper.c (modified) (1 diff)
-
addstar/src/loadsupercos_rawdata.c (modified) (1 diff)
-
checkastro/src/BrightCatalog.c (modified) (7 diffs)
-
dvolens/src/update_objects_catalog.c (modified) (1 diff)
-
dvopsps/include/dvopsps.h (modified) (1 diff)
-
dvopsps/src/DetectionOps.c (modified) (8 diffs)
-
dvopsps/src/insert_detections_dvopsps_catalog.c (modified) (6 diffs)
-
fakeastro/src/make_2mass_measures.c (modified) (1 diff)
-
fakeastro/src/make_fake_stars_catalog.c (modified) (1 diff)
-
fakeastro/src/make_gaia_measures.c (modified) (1 diff)
-
markrock/src/find_slow_rocks.c (modified) (2 diffs)
-
opihi/dvo/gstar.c (modified) (1 diff)
-
opihi/dvo/imdata.c (modified) (1 diff)
-
relastro/src/BrightCatalog.c (modified) (7 diffs)
-
relphot/src/BrightCatalog.c (modified) (7 diffs)
-
relphot/src/StarOps.c (modified) (5 diffs)
-
relphot/src/bcatalog.c (modified) (1 diff)
-
relphot/src/setMrelCatalog.c (modified) (6 diffs)
-
relphot/src/setMrelFinal.c (modified) (1 diff)
-
uniphot/src/update_catalog_setphot.c (modified) (1 diff)
-
uniphot/src/update_catalog_uniphot.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20170822/src/addstar/src/FilterStars.c
r40212 r40244 73 73 outcat->measure[N].airmass = airmass (image[0].secz, outcat->average[N].R, outcat->average[N].D, image[0].sidtime, image[0].latitude); 74 74 outcat->measure[N].az = azimuth (15.0*image[0].sidtime - outcat->average[N].R, outcat->average[N].D, image[0].latitude); 75 outcat->measure[N].Mcal = image[0].McalPSF; 75 outcat->measure[N].McalPSF = image[0].McalPSF; 76 outcat->measure[N].McalAPER= image[0].McalAPER; 76 77 outcat->measure[N].t = image[0].tzero + 1e-4*outcat->measure[N].Yccd*image[0].trate; /* trate is in 0.1 msec / row */ 77 78 outcat->measure[N].dt = MTIME; -
branches/eam_branches/ohana.20170822/src/addstar/src/ReadStarsUKIRT.c
r40212 r40244 196 196 catalog->measure[i].FWy = ToShortPixels(seeing); 197 197 198 catalog->measure[i].Mcal = Mcal; 198 catalog->measure[i].McalPSF = Mcal; 199 catalog->measure[i].McalAPER = Mcal; 199 200 200 201 catalog->measure[i].detID = i; -
branches/eam_branches/ohana.20170822/src/addstar/src/SEDfit.c
r38467 r40244 172 172 outcat[0].measure[Nmeas].M = table[0].row[minFit.row][0].mags[n] + minFit.Md; 173 173 outcat[0].measure[Nmeas].dM = 0.0; 174 outcat[0].measure[Nmeas].Mcal = 0; 174 outcat[0].measure[Nmeas].McalPSF = 0; 175 outcat[0].measure[Nmeas].McalAPER = 0; 175 176 outcat[0].measure[Nmeas].t = TIMEREF; 176 177 outcat[0].measure[Nmeas].averef = Nave; -
branches/eam_branches/ohana.20170822/src/addstar/src/find_proper.c
r15036 r40244 104 104 105 105 /** add measurements for this star **/ 106 catalog[0].measure[Nmeas].dR = 360000.0*(catalog[0].average[n].R - usno[N].R); 107 catalog[0].measure[Nmeas].dD = 360000.0*(catalog[0].average[n].D - usno[N].D); 108 catalog[0].measure[Nmeas].M = 1000.0*fabs(usno[N].r); 109 catalog[0].measure[Nmeas].Mcal= 0; /* above measurement is exact */ 110 catalog[0].measure[Nmeas].dM = 100; /* error in input files stored in thousandths of mag */ 111 catalog[0].measure[Nmeas].t = 0; /* a flag: if 0, image is not in database */ 112 catalog[0].measure[Nmeas].averef = n; 113 catalog[0].measure[Nmeas].photcode = USNO_RED; 114 catalog[0].measure[Nmeas+1].dR = catalog[0].measure[Nmeas].dR; 115 catalog[0].measure[Nmeas+1].dD = catalog[0].measure[Nmeas].dD; 116 catalog[0].measure[Nmeas+1].M = 1000.0*fabs(usno[N].b); 117 catalog[0].measure[Nmeas+1].Mcal= 0; /* above measurement is exact */ 118 catalog[0].measure[Nmeas+1].dM = 100; /* error in input files stored in thousandths of mag */ 119 catalog[0].measure[Nmeas+1].t = 0; /* a flag: if 0, image is not in database */ 120 catalog[0].measure[Nmeas+1].averef = n; 106 catalog[0].measure[Nmeas].dR = 360000.0*(catalog[0].average[n].R - usno[N].R); 107 catalog[0].measure[Nmeas].dD = 360000.0*(catalog[0].average[n].D - usno[N].D); 108 catalog[0].measure[Nmeas].M = 1000.0*fabs(usno[N].r); 109 catalog[0].measure[Nmeas].McalPSF = 0; /* above measurement is exact */ 110 catalog[0].measure[Nmeas].McalAPER = 0; /* above measurement is exact */ 111 catalog[0].measure[Nmeas].dM = 100; /* error in input files stored in thousandths of mag */ 112 catalog[0].measure[Nmeas].t = 0; /* a flag: if 0, image is not in database */ 113 catalog[0].measure[Nmeas].averef = n; 114 catalog[0].measure[Nmeas].photcode = USNO_RED; 115 catalog[0].measure[Nmeas+1].dR = catalog[0].measure[Nmeas].dR; 116 catalog[0].measure[Nmeas+1].dD = catalog[0].measure[Nmeas].dD; 117 catalog[0].measure[Nmeas+1].M = 1000.0*fabs(usno[N].b); 118 catalog[0].measure[Nmeas+1].McalPSF = 0; /* above measurement is exact */ 119 catalog[0].measure[Nmeas+1].McalAPER = 0; /* above measurement is exact */ 120 catalog[0].measure[Nmeas+1].dM = 100; /* error in input files stored in thousandths of mag */ 121 catalog[0].measure[Nmeas+1].t = 0; /* a flag: if 0, image is not in database */ 122 catalog[0].measure[Nmeas+1].averef = n; 121 123 catalog[0].measure[Nmeas+1].photcode = USNO_BLUE; 122 124 /* add flag in average to mark as matched with the USNO catalog */ -
branches/eam_branches/ohana.20170822/src/addstar/src/loadsupercos_rawdata.c
r39457 r40244 86 86 87 87 // XXX fix these 88 newcat->measure[i].Mcal = 0.0; 88 newcat->measure[i].McalPSF = 0.0; 89 newcat->measure[i].McalAPER = 0.0; 89 90 newcat->measure[i].dt = image[Ni].exptime; 90 91 -
branches/eam_branches/ohana.20170822/src/checkastro/src/BrightCatalog.c
r40212 r40244 71 71 GET_COLUMN(dD, "DEC_OFF", float); 72 72 GET_COLUMN(M, "MAG_SYS", float); 73 GET_COLUMN(Mcal, "MAG_CAL", float); 73 GET_COLUMN(McalPSF, "MCAL_PSF", float); 74 GET_COLUMN(McalAPER, "MCAL_APER", float); 74 75 GET_COLUMN(dM, "MAG_ERR", float); 75 76 GET_COLUMN(airmass, "AIRMASS", float); … … 95 96 measure[i].dD = dD[i]; 96 97 measure[i].M = M[i]; 97 measure[i].Mcal = Mcal[i]; 98 measure[i].McalPSF = McalPSF[i]; 99 measure[i].McalAPER = McalAPER[i]; 98 100 measure[i].dM = dM[i]; 99 101 measure[i].airmass = airmass[i]; … … 116 118 free (dD ); 117 119 free (M ); 118 free (Mcal ); 120 free (McalPSF ); 121 free (McalAPER); 119 122 free (dM ); 120 123 free (airmass ); … … 366 369 float *dD ; ALLOCATE (dD , float, catalog->Nmeasure); 367 370 float *M ; ALLOCATE (M , float, catalog->Nmeasure); 368 float *Mcal ; ALLOCATE (Mcal , float, catalog->Nmeasure); 371 float *McalPSF ; ALLOCATE (McalPSF , float, catalog->Nmeasure); 372 float *McalAPER ; ALLOCATE (McalAPER , float, catalog->Nmeasure); 369 373 float *dM ; ALLOCATE (dM , float, catalog->Nmeasure); 370 374 float *airmass ; ALLOCATE (airmass , float, catalog->Nmeasure); … … 388 392 dD[i] = measure[i].dD ; 389 393 M[i] = measure[i].M ; 390 Mcal[i] = measure[i].Mcal ; 394 McalPSF[i] = measure[i].McalPSF ; 395 McalAPER[i] = measure[i].McalAPER ; 391 396 dM[i] = measure[i].dM ; 392 397 airmass[i] = measure[i].airmass ; … … 409 414 gfits_set_bintable_column (&theader, &ftable, "DEC_OFF", dD, catalog->Nmeasure); 410 415 gfits_set_bintable_column (&theader, &ftable, "MAG_SYS", M, catalog->Nmeasure); 411 gfits_set_bintable_column (&theader, &ftable, "MAG_CAL", Mcal, catalog->Nmeasure); 416 gfits_set_bintable_column (&theader, &ftable, "MCAL_PSF", McalPSF, catalog->Nmeasure); 417 gfits_set_bintable_column (&theader, &ftable, "MCAL_APER", McalAPER, catalog->Nmeasure); 412 418 gfits_set_bintable_column (&theader, &ftable, "MAG_ERR", dM, catalog->Nmeasure); 413 419 gfits_set_bintable_column (&theader, &ftable, "AIRMASS", airmass, catalog->Nmeasure); … … 428 434 free (dD ); 429 435 free (M ); 430 free (Mcal ); 436 free (McalPSF ); 437 free (McalAPER); 431 438 free (dM ); 432 439 free (airmass ); -
branches/eam_branches/ohana.20170822/src/dvolens/src/update_objects_catalog.c
r39611 r40244 219 219 220 220 // relphot sets measure->Mcal (setMcalOutput.c, called by setMrelFinal.c) 221 float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - measure->Mcal; 221 // XXX : I'm using McalAPER since these lens measurements are aperture-like, right? 222 float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - measure->McalAPER; 222 223 float Fcal = 3630.8 * MagToFlux(Mcal); 223 224 -
branches/eam_branches/ohana.20170822/src/dvopsps/include/dvopsps.h
r40230 r40244 19 19 float raErr; 20 20 float decErr; 21 float zp; 22 float zpFactor; 21 float zpPSF; 22 float zpFactorPSF; 23 float zpAPER; 24 float zpFactorAPER; 23 25 float telluricExt; 24 26 float airmass; -
branches/eam_branches/ohana.20170822/src/dvopsps/src/DetectionOps.c
r39547 r40244 56 56 GET_COLUMN(raErr , "raErr", float); 57 57 GET_COLUMN(decErr , "decErr", float); 58 GET_COLUMN(zp , "zp", float); 59 GET_COLUMN(zpFactor , "zpFactor", float); 58 GET_COLUMN(zpPSF , "zpPSF", float); 59 GET_COLUMN(zpFactorPSF , "zpFactorPSF", float); 60 GET_COLUMN(zpAPER , "zpAPER", float); 61 GET_COLUMN(zpFactorAPER, "zpFactorAPER",float); 60 62 GET_COLUMN(telluricExt , "telluricExt", float); 61 63 GET_COLUMN(airmass , "airmass", float); … … 84 86 detections[i].raErr = raErr[i]; 85 87 detections[i].decErr = decErr[i]; 86 detections[i].zp = zp[i]; 87 detections[i].zpFactor = zpFactor[i]; 88 detections[i].zpPSF = zpPSF[i]; 89 detections[i].zpFactorPSF = zpFactorPSF[i]; 90 detections[i].zpAPER = zpAPER[i]; 91 detections[i].zpFactorAPER = zpFactorAPER[i]; 88 92 detections[i].telluricExt = telluricExt[i]; 89 93 detections[i].airmass = airmass[i]; … … 110 114 free (raErr ); 111 115 free (decErr ); 112 free (zp ); 113 free (zpFactor ); 116 free (zpPSF ); 117 free (zpFactorPSF); 118 free (zpAPER ); 119 free (zpFactorAPER); 114 120 free (telluricExt); 115 121 free (airmass ); … … 180 186 gfits_define_bintable_column (&theader, "E", "raErr", NULL, NULL, 1.0, 0.0); 181 187 gfits_define_bintable_column (&theader, "E", "decErr", NULL, NULL, 1.0, 0.0); 182 gfits_define_bintable_column (&theader, "E", "zp", NULL, NULL, 1.0, 0.0); 183 gfits_define_bintable_column (&theader, "E", "zpFactor", NULL, NULL, 1.0, 0.0); 188 gfits_define_bintable_column (&theader, "E", "zpPSF", NULL, NULL, 1.0, 0.0); 189 gfits_define_bintable_column (&theader, "E", "zpFactorPSF", NULL, NULL, 1.0, 0.0); 190 gfits_define_bintable_column (&theader, "E", "zpAPER", NULL, NULL, 1.0, 0.0); 191 gfits_define_bintable_column (&theader, "E", "zpFactorAPER", NULL, NULL, 1.0, 0.0); 184 192 gfits_define_bintable_column (&theader, "E", "telluricExt", NULL, NULL, 1.0, 0.0); 185 193 gfits_define_bintable_column (&theader, "E", "airmass", NULL, NULL, 1.0, 0.0); … … 208 216 float *raErr ; ALLOCATE (raErr , float, Ndetections); 209 217 float *decErr ; ALLOCATE (decErr , float, Ndetections); 210 float *zp ; ALLOCATE (zp , float, Ndetections); 211 float *zpFactor ; ALLOCATE (zpFactor , float, Ndetections); 218 float *zpPSF ; ALLOCATE (zpPSF , float, Ndetections); 219 float *zpFactorPSF ; ALLOCATE (zpFactorPSF , float, Ndetections); 220 float *zpAPER ; ALLOCATE (zpAPER , float, Ndetections); 221 float *zpFactorAPER; ALLOCATE (zpFactorAPER, float, Ndetections); 212 222 float *telluricExt ; ALLOCATE (telluricExt , float, Ndetections); 213 223 float *airmass ; ALLOCATE (airmass , float, Ndetections); … … 234 244 raErr[i] = detections[i].raErr ; 235 245 decErr[i] = detections[i].decErr ; 236 zp[i] = detections[i].zp ; 237 zpFactor[i] = detections[i].zpFactor ; 246 zpPSF[i] = detections[i].zpPSF ; 247 zpFactorPSF[i] = detections[i].zpFactorPSF ; 248 zpAPER[i] = detections[i].zpAPER ; 249 zpFactorAPER[i]= detections[i].zpFactorAPER; 238 250 telluricExt[i] = detections[i].telluricExt ; 239 251 airmass[i] = detections[i].airmass ; … … 260 272 gfits_set_bintable_column (&theader, &ftable, "raErr", raErr , Ndetections); 261 273 gfits_set_bintable_column (&theader, &ftable, "decErr", decErr , Ndetections); 262 gfits_set_bintable_column (&theader, &ftable, "zp", zp , Ndetections); 263 gfits_set_bintable_column (&theader, &ftable, "zpFactor", zpFactor , Ndetections); 274 gfits_set_bintable_column (&theader, &ftable, "zpPSF", zpPSF , Ndetections); 275 gfits_set_bintable_column (&theader, &ftable, "zpFactorPSF", zpFactorPSF , Ndetections); 276 gfits_set_bintable_column (&theader, &ftable, "zpAPER", zpAPER , Ndetections); 277 gfits_set_bintable_column (&theader, &ftable, "zpFactorAPER",zpFactorAPER, Ndetections); 264 278 gfits_set_bintable_column (&theader, &ftable, "telluricExt", telluricExt , Ndetections); 265 279 gfits_set_bintable_column (&theader, &ftable, "airmass", airmass , Ndetections); … … 284 298 free (raErr ); 285 299 free (decErr ); 286 free (zp ); 287 free (zpFactor ); 300 free (zpPSF ); 301 free (zpFactorPSF ); 302 free (zpAPER ); 303 free (zpFactorAPER); 288 304 free (telluricExt ); 289 305 free (airmass ); -
branches/eam_branches/ohana.20170822/src/dvopsps/src/insert_detections_dvopsps_catalog.c
r39645 r40244 183 183 184 184 PrintIOBuffer (buffer, "INSERT INTO dvoDetectionFull (objID, detectID, ippObjID, ippDetectID, imageID, catID, "); 185 PrintIOBuffer (buffer, "ra, dec_, raErr, decErr, zp , zpFactor, telluricExt, airmass, expTime, ");185 PrintIOBuffer (buffer, "ra, dec_, raErr, decErr, zpPSF, zpFactorPSF, zpAPER, zpFactorAPER, telluricExt, airmass, expTime, "); 186 186 PrintIOBuffer (buffer, "Mpsf, dMpsf, Mkron, dMkron, Map, dMap, flags, objflags) VALUES \n"); 187 187 … … 254 254 PRINT_FLOAT(buffer, detection->raErr, "%.6f, "); 255 255 PRINT_FLOAT(buffer, detection->decErr, "%.6f, "); 256 PRINT_FLOAT(buffer, detection->zp, "%.6f, "); 257 PRINT_FLOAT(buffer, detection->zpFactor, "%.6e, "); 256 PRINT_FLOAT(buffer, detection->zpPSF, "%.6f, "); 257 PRINT_FLOAT(buffer, detection->zpFactorPSF, "%.6e, "); 258 PRINT_FLOAT(buffer, detection->zpAPER, "%.6f, "); 259 PRINT_FLOAT(buffer, detection->zpFactorAPER,"%.6e, "); 258 260 PRINT_FLOAT(buffer, detection->telluricExt, "%.6f, "); 259 261 PRINT_FLOAT(buffer, detection->airmass, "%.6f, "); … … 305 307 int assign_detection_values (Detections *detection, Measure *measure, Average *average) { 306 308 309 // myAbort ("check on measure->McalPSF vs McalAPER"); 310 307 311 PhotCode *code = GetPhotcodebyCode(measure->photcode); 308 312 … … 311 315 float Mflat = isfinite(measure->Mflat) ? measure->Mflat : 0.0; 312 316 float nominalZP = code->C * 0.001 + code->K * (measure->airmass - 1); 313 float zp = nominalZP - measure->Mcal - Mflat; 314 float zpFactor = pow(10.0, -0.4*zp + 3.56); 315 float telluricExt = - measure->Mcal; 317 float zpPSF = nominalZP - measure->McalPSF - Mflat; 318 float zpFactorPSF = pow(10.0, -0.4*zpPSF + 3.56); 319 float zpAPER = nominalZP - measure->McalAPER - Mflat; 320 float zpFactorAPER= pow(10.0, -0.4*zpAPER + 3.56); 321 float telluricExt = - measure->McalPSF; 316 322 float expTime = pow(10.0, 0.4 * measure->dt); 317 323 float airmass = measure->airmass; … … 329 335 detection->decErr = measure->dYccd * 0.01 * fabs(measure->pltscale); // estimate of decErr 330 336 331 detection->zp = zp; 332 detection->zpFactor = zpFactor; 337 detection->zpPSF = zpPSF; 338 detection->zpFactorPSF = zpFactorPSF; 339 detection->zpAPER = zpAPER; 340 detection->zpFactorAPER = zpFactorAPER; 333 341 detection->telluricExt = telluricExt; 334 342 detection->airmass = airmass; … … 337 345 // XXX clean this up with dvo_photcode_ops calls: 338 346 // if (isfinite(measure->FluxPSF) && (measure->FluxPSF < 0.0)) 339 detection->Mpsf = getMagFromValueOrFlux (measure->FluxPSF, measure->M, zp );340 detection->Mkron = getMagFromValueOrFlux (measure->FluxKron, measure->Mkron, zp );341 detection->Map = getMagFromValueOrFlux (measure->FluxAp, measure->Map, zp );347 detection->Mpsf = getMagFromValueOrFlux (measure->FluxPSF, measure->M, zpPSF); 348 detection->Mkron = getMagFromValueOrFlux (measure->FluxKron, measure->Mkron, zpAPER); 349 detection->Map = getMagFromValueOrFlux (measure->FluxAp, measure->Map, zpAPER); 342 350 343 351 detection->dMpsf = getdMagFromValueOrFlux (measure->FluxPSF, measure->dFluxPSF, measure->dM); -
branches/eam_branches/ohana.20170822/src/fakeastro/src/make_2mass_measures.c
r40212 r40244 103 103 measure[Nmeasure].airmass = 1.0; 104 104 measure[Nmeasure].az = 0.0; // irrelevant 105 measure[Nmeasure].Mcal = 0.0; 105 measure[Nmeasure].McalPSF = 0.0; 106 measure[Nmeasure].McalAPER= 0.0; 106 107 measure[Nmeasure].t = tzero_2mass; 107 108 measure[Nmeasure].dt = 0.0; -
branches/eam_branches/ohana.20170822/src/fakeastro/src/make_fake_stars_catalog.c
r40212 r40244 175 175 176 176 stars[Nstars].measure.az = azimuth (15.0*image->sidtime - stars[Nstars].average.R, stars[Nstars].average.D, image->latitude); 177 stars[Nstars].measure.Mcal = image->McalPSF; 177 stars[Nstars].measure.McalPSF = image->McalPSF; 178 stars[Nstars].measure.McalAPER= image->McalAPER; 178 179 stars[Nstars].measure.t = image->tzero + 1e-4*stars[Nstars].measure.Yccd*image->trate; // trate is in 0.1 msec / row 179 180 stars[Nstars].measure.dt = Mtime; -
branches/eam_branches/ohana.20170822/src/fakeastro/src/make_gaia_measures.c
r40212 r40244 104 104 measure[Nmeasure].airmass = 1.0; 105 105 measure[Nmeasure].az = 0.0; // irrelevant 106 measure[Nmeasure].Mcal = 0.0; 106 measure[Nmeasure].McalPSF = 0.0; 107 measure[Nmeasure].McalAPER= 0.0; 107 108 measure[Nmeasure].t = tzero_gaia; 108 109 measure[Nmeasure].dt = 0.0; -
branches/eam_branches/ohana.20170822/src/markrock/src/find_slow_rocks.c
r2490 r40244 69 69 RD_to_XY (&X1[j], &Y1[j], R1[j], D1[j], &catstats[0].coords); 70 70 T1[j] = catalog[0].measure[m+j].t; 71 M1[j] = catalog[0].measure[m+j].M - catalog[0].measure[m+j].Mcal ;71 M1[j] = catalog[0].measure[m+j].M - catalog[0].measure[m+j].McalPSF; 72 72 } 73 73 dt = T1[1] - T1[0]; … … 86 86 RD_to_XY (&X, &Y, R, D, &catstats[0].coords); 87 87 T = catalog[0].measure[m+j].t; 88 M = catalog[0].measure[m+j].M - catalog[0].measure[m+j].Mcal ;88 M = catalog[0].measure[m+j].M - catalog[0].measure[m+j].McalPSF; 89 89 if (T1[0] == T) continue; 90 90 if (T1[1] == T) continue; -
branches/eam_branches/ohana.20170822/src/opihi/dvo/gstar.c
r40212 r40244 760 760 761 761 if (FULL_OUTPUT) { 762 gprint (GP_LOG, "%6.3f ", catalog.measure[Nv].Mcal); 762 gprint (GP_LOG, "%6.3f ", catalog.measure[Nv].McalPSF); 763 gprint (GP_LOG, "%6.3f ", catalog.measure[Nv].McalAPER); 763 764 gprint (GP_LOG, "%6.3f ", catalog.measure[Nv].Mflat); 764 765 gprint (GP_LOG, "%6.3f ", catalog.measure[Nv].Map); -
branches/eam_branches/ohana.20170822/src/opihi/dvo/imdata.c
r39457 r40244 183 183 for (i = 0; i < catalog.Nmeasure; i++) { 184 184 if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue; 185 vec[0].elements.Flt[N] = catalog.measure[i].Mcal ;185 vec[0].elements.Flt[N] = catalog.measure[i].McalPSF; 186 186 N++; 187 187 CHECK_REALLOCATE (vec[0].elements.Flt, opihi_flt, NPTS, N, 1000); -
branches/eam_branches/ohana.20170822/src/relastro/src/BrightCatalog.c
r40212 r40244 68 68 GET_COLUMN(D, "DEC", double); 69 69 GET_COLUMN(M, "MAG_SYS", float); 70 GET_COLUMN(Mcal, "MAG_CAL", float); 70 GET_COLUMN(McalPSF, "MCAL_PSF", float); 71 GET_COLUMN(McalAPER, "MCAL_APER", float); 71 72 GET_COLUMN(dM, "MAG_ERR", float); 72 73 GET_COLUMN(airmass, "AIRMASS", float); … … 94 95 measure[i].D = D[i]; 95 96 measure[i].M = M[i]; 96 measure[i].Mcal = Mcal[i]; 97 measure[i].McalPSF = McalPSF[i]; 98 measure[i].McalAPER = McalAPER[i]; 97 99 measure[i].dM = dM[i]; 98 100 measure[i].airmass = airmass[i]; … … 120 122 free (D ); 121 123 free (M ); 122 free (Mcal ); 124 free (McalPSF ); 125 free (McalAPER); 123 126 free (dM ); 124 127 free (airmass ); … … 385 388 double *D ; ALLOCATE (D , double, catalog->Nmeasure); 386 389 float *M ; ALLOCATE (M , float, catalog->Nmeasure); 387 float *Mcal ; ALLOCATE (Mcal , float, catalog->Nmeasure); 390 float *McalPSF ; ALLOCATE (McalPSF , float, catalog->Nmeasure); 391 float *McalAPER ; ALLOCATE (McalAPER , float, catalog->Nmeasure); 388 392 float *dM ; ALLOCATE (dM , float, catalog->Nmeasure); 389 393 float *airmass ; ALLOCATE (airmass , float, catalog->Nmeasure); … … 408 412 D[i] = measure[i].D ; 409 413 M[i] = measure[i].M ; 410 Mcal[i] = measure[i].Mcal ; 414 McalPSF[i] = measure[i].McalPSF ; 415 McalAPER[i] = measure[i].McalAPER ; 411 416 dM[i] = measure[i].dM ; 412 417 airmass[i] = measure[i].airmass ; … … 434 439 gfits_set_bintable_column (&theader, &ftable, "DEC", D, catalog->Nmeasure); 435 440 gfits_set_bintable_column (&theader, &ftable, "MAG_SYS", M, catalog->Nmeasure); 436 gfits_set_bintable_column (&theader, &ftable, "MAG_CAL", Mcal, catalog->Nmeasure); 441 gfits_set_bintable_column (&theader, &ftable, "MCAL_PSF", McalPSF, catalog->Nmeasure); 442 gfits_set_bintable_column (&theader, &ftable, "MCAL_APER", McalAPER, catalog->Nmeasure); 437 443 gfits_set_bintable_column (&theader, &ftable, "MAG_ERR", dM, catalog->Nmeasure); 438 444 gfits_set_bintable_column (&theader, &ftable, "AIRMASS", airmass, catalog->Nmeasure); … … 454 460 free (D ); 455 461 free (M ); 456 free (Mcal ); 462 free (McalPSF ); 463 free (McalAPER); 457 464 free (dM ); 458 465 free (airmass ); -
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 } -
branches/eam_branches/ohana.20170822/src/uniphot/src/update_catalog_setphot.c
r40212 r40244 61 61 # endif 62 62 63 measure[0].Mcal = Mcal; 63 myAssert(isfinite(Mcal), "oops: ubercal made a nan"); 64 65 measure[0].McalPSF = Mcal; 66 measure[0].McalAPER = Mcal; 64 67 measure[0].Mflat = Mflat; // in the previous version, Mcal_offset (which is added to Mflat) had a negative sign here 65 68 measure[0].dMcal = dMcal; 66 myAssert(isfinite(measure[0].Mcal), "oops: ubercal made a nan");67 69 68 70 if (RESET) { -
branches/eam_branches/ohana.20170822/src/uniphot/src/update_catalog_uniphot.c
r40212 r40244 24 24 if (code[0].type != PHOT_DEP) continue; 25 25 if (code[0].equiv != photcode[0].code) continue; 26 catalog[0].measure[m].Mcal -= sgroup[0].M; 26 catalog[0].measure[m].McalPSF -= sgroup[0].M; 27 catalog[0].measure[m].McalAPER -= sgroup[0].M; 27 28 found ++; 28 29 }
Note:
See TracChangeset
for help on using the changeset viewer.
