Changeset 40212
- Timestamp:
- Nov 22, 2017, 10:38:42 AM (9 years ago)
- Location:
- branches/eam_branches/ohana.20170822/src
- Files:
-
- 88 edited
-
addstar/src/FilterStars.c (modified) (1 diff)
-
addstar/src/LoadDataPMM.c (modified) (1 diff)
-
addstar/src/ReadImageHeader.c (modified) (1 diff)
-
addstar/src/ReadSDSSHeader.c (modified) (1 diff)
-
addstar/src/ReadStarsSDSS.c (modified) (1 diff)
-
addstar/src/ReadStarsUKIRT.c (modified) (1 diff)
-
addstar/src/calibrate.c (modified) (6 diffs)
-
addstar/src/fakeimage.c (modified) (2 diffs)
-
addstar/src/find_matches.c (modified) (2 diffs)
-
addstar/src/find_matches_closest.c (modified) (2 diffs)
-
addstar/src/find_matches_gaia.c (modified) (1 diff)
-
addstar/src/loadsupercos_plates.c (modified) (1 diff)
-
checkastro/src/BrightCatalog.c (modified) (2 diffs)
-
delstar/src/gimages.c (modified) (1 diff)
-
dvomerge/src/merge_catalogs_old.c (modified) (3 diffs)
-
dvopsps/src/insert_objects_dvopsps_catalog.c (modified) (3 diffs)
-
fakeastro/src/insert_fakestar.c (modified) (1 diff)
-
fakeastro/src/load_template_images.c (modified) (1 diff)
-
fakeastro/src/make_2mass_measures.c (modified) (1 diff)
-
fakeastro/src/make_fake_stars_catalog.c (modified) (3 diffs)
-
fakeastro/src/make_gaia_measures.c (modified) (1 diff)
-
getstar/src/ReadImageHeader.c (modified) (1 diff)
-
getstar/src/select_by_region.c (modified) (2 diffs)
-
getstar/src/write_getstar_ps1_dev_0.c (modified) (3 diffs)
-
getstar/src/write_getstar_ps1_dev_1.c (modified) (3 diffs)
-
getstar/src/write_getstar_ps1_dev_2.c (modified) (3 diffs)
-
imregister/imphot/dumpfits.c (modified) (1 diff)
-
imregister/imphot/output.c (modified) (1 diff)
-
kapa2/src/DrawObjects.c (modified) (1 diff)
-
libautocode/def/secfilt.d (modified) (2 diffs)
-
libdvo/src/dvo_catalog.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_PS1_DEV_1.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_PS1_DEV_2.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_PS1_REF.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_PS1_SIM.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_PS1_V1.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_PS1_V2.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_PS1_V3.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_V4.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_V5.c (modified) (3 diffs)
-
libdvo/src/dvo_convert_PS1_V5_LOAD.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_PS1_V6.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_elixir.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_loneos.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_panstarrs_DEV_0.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_panstarrs_DEV_1.c (modified) (2 diffs)
-
libdvo/src/dvo_photcode_ops.c (modified) (17 diffs)
-
opihi/dvo/gimages.c (modified) (1 diff)
-
opihi/dvo/gstar.c (modified) (11 diffs)
-
opihi/dvo/imlist.c (modified) (1 diff)
-
opihi/dvo/imphot.c (modified) (3 diffs)
-
opihi/dvo/imstats.c (modified) (2 diffs)
-
opihi/dvo/objectcoverage.c (modified) (1 diff)
-
opihi/dvo/paverage.c (modified) (1 diff)
-
opihi/dvo/skycoverage.c (modified) (1 diff)
-
opihi/lib.shell/evaluate_stack.c (modified) (1 diff)
-
photdbc/src/get_mags.c (modified) (2 diffs)
-
photdbc/src/join_stars.c (modified) (1 diff)
-
photdbc/src/make_subcatalog.c (modified) (1 diff)
-
relastro/include/relastro.h (modified) (1 diff)
-
relastro/src/BrightCatalog.c (modified) (2 diffs)
-
relastro/src/ImageOps.c (modified) (2 diffs)
-
relastro/src/MosaicOps.c (modified) (1 diff)
-
relphot/include/relphot.h (modified) (4 diffs)
-
relphot/src/BrightCatalog.c (modified) (2 diffs)
-
relphot/src/GridOps.c (modified) (2 diffs)
-
relphot/src/ImageMagIO.c (modified) (8 diffs)
-
relphot/src/ImageOps.c (modified) (18 diffs)
-
relphot/src/ImageSubset.c (modified) (8 diffs)
-
relphot/src/MosaicOps.c (modified) (25 diffs)
-
relphot/src/StarOps.c (modified) (7 diffs)
-
relphot/src/plot_scatter.c (modified) (1 diff)
-
relphot/src/relphot_synthphot_catalog.c (modified) (1 diff)
-
relphot/src/select_images.c (modified) (1 diff)
-
relphot/src/setMrelCatalog.c (modified) (5 diffs)
-
relphot/src/setMrelFinal.c (modified) (1 diff)
-
relphot/src/share_image_mags.c (modified) (2 diffs)
-
relphot/src/share_mean_mags.c (modified) (2 diffs)
-
relphot/src/synthetic_mags.c (modified) (1 diff)
-
uniphot/include/setphot.h (modified) (1 diff)
-
uniphot/src/ImageSubset.c (modified) (4 diffs)
-
uniphot/src/dumpresult.c (modified) (2 diffs)
-
uniphot/src/fit_groups.c (modified) (2 diffs)
-
uniphot/src/match_zpts_to_images.c (modified) (3 diffs)
-
uniphot/src/update_catalog_setastrom.c (modified) (2 diffs)
-
uniphot/src/update_catalog_setphot.c (modified) (1 diff)
-
uniphot/src/update_catalog_uniphot.c (modified) (1 diff)
-
uniphot/src/update_dvo_uniphot.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20170822/src/addstar/src/FilterStars.c
r39473 r40212 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].Mcal ;75 outcat->measure[N].Mcal = image[0].McalPSF; 76 76 outcat->measure[N].t = image[0].tzero + 1e-4*outcat->measure[N].Yccd*image[0].trate; /* trate is in 0.1 msec / row */ 77 77 outcat->measure[N].dt = MTIME; -
branches/eam_branches/ohana.20170822/src/addstar/src/LoadDataPMM.c
r38553 r40212 234 234 // altaz (&alt, &az, 15.0*image[0].sidtime - image[0].coords.crval1, image[0].coords.crval2, Latitude); 235 235 236 // secz is in units of airmass 236 237 image[0].trate = 0.0; 237 238 image[0].secz = 1.0; 238 239 image[0].ccdnum = 0; 239 240 240 // secz is in units milli-airmass 241 image[0].Mcal = 0.0; 242 image[0].Xm = NAN_S_SHORT; 243 image[0].flags = 0; 241 image[0].McalPSF = 0.0; 242 image[0].McalAPER = 0.0; 243 image[0].McalChiSq = NAN; 244 image[0].dMcal = NAN; 245 image[0].flags = 0; 244 246 245 247 image[0].nstar = 0; -
branches/eam_branches/ohana.20170822/src/addstar/src/ReadImageHeader.c
r39457 r40212 265 265 } 266 266 267 /* secz is in units milli-airmass */268 image[0].Mcal = ZERO_POINT_OFFSET;269 image[0].dMcal = ZERO_POINT_ERROR;270 image[0]. Xm = NAN_S_SHORT;271 image[0].flags = 0;267 image[0].McalPSF = ZERO_POINT_OFFSET; 268 image[0].McalAPER = ZERO_POINT_OFFSET; 269 image[0].dMcal = ZERO_POINT_ERROR; 270 image[0].McalChiSq = NAN; 271 image[0].flags = 0; 272 272 273 273 /* find expected number of stars */ -
branches/eam_branches/ohana.20170822/src/addstar/src/ReadSDSSHeader.c
r16810 r40212 47 47 48 48 // secz is in units milli-airmass 49 image[0].Mcal = 0.0; 50 image[0].Xm = NAN_S_SHORT; 49 image[0].McalPSF = 0.0; 50 image[0].McalAPER = 0.0; 51 image[0].McalChiSq = NAN; 52 image[0].dMcal = NAN; 51 53 image[0].code = 0; 52 54 memset (image[0].dummy, 0, sizeof(image[0].dummy)); -
branches/eam_branches/ohana.20170822/src/addstar/src/ReadStarsSDSS.c
r39161 r40212 258 258 altaz (&alt, &az, 15.0*images[N].sidtime - images[N].coords.crval1, images[N].coords.crval2, Latitude); 259 259 260 // secz is in units of airmass 260 261 images[N].trate = clockRate * 1e-4; 261 262 images[N].secz = catalog->measure[0].airmass; 262 263 images[N].ccdnum = camcol; 263 264 264 // secz is in units milli-airmass 265 images[N].Mcal = 0.0; 266 images[N].Xm = NAN_S_SHORT; 267 images[N].flags = 0; 265 images[N].McalPSF = 0.0; 266 images[N].McalAPER = 0.0; 267 images[N].McalChiSq = NAN; 268 images[N].dMcal = NAN; 269 images[N].flags = 0; 268 270 269 271 images[N].nstar = Nstars; -
branches/eam_branches/ohana.20170822/src/addstar/src/ReadStarsUKIRT.c
r39161 r40212 251 251 252 252 // secz is in units milli-airmass 253 images[N].Mcal = Mcal; 254 images[N].Xm = NAN_S_SHORT; 255 images[N].flags = 0; 253 images[N].McalPSF = Mcal; 254 images[N].McalAPER = Mcal; 255 images[N].McalChiSq = NAN; 256 images[N].dMcal = NAN; 257 images[N].flags = 0; 256 258 257 259 images[N].nstar = Nstars; -
branches/eam_branches/ohana.20170822/src/addstar/src/calibrate.c
r39457 r40212 74 74 /* check if this reference code is an average magnitude */ 75 75 if (Nsec != -1) { 76 CalM0 = secfilt[Nsec].M ;77 dCalM = secfilt[Nsec].dM ;76 CalM0 = secfilt[Nsec].MpsfChp; 77 dCalM = secfilt[Nsec].dMpsfChp; 78 78 found0 = TRUE; 79 79 } … … 82 82 Nsec = GetPhotcodeNsec (CalC1); 83 83 if (Nsec != -1) { 84 CalM1 = secfilt[Nsec].M ;84 CalM1 = secfilt[Nsec].MpsfChp; 85 85 found1 = TRUE; 86 86 } … … 89 89 Nsec = GetPhotcodeNsec (CalC2); 90 90 if (Nsec != -1) { 91 CalM2 = secfilt[Nsec].M ;91 CalM2 = secfilt[Nsec].MpsfChp; 92 92 found2 = TRUE; 93 93 } … … 151 151 if (MaxN == -1) { 152 152 fprintf (stderr, "no clean stars\n"); 153 image[0].Mcal = 10.000; 154 image[0].dMcal = 10.000; 153 image[0].McalPSF = 10.000; 154 image[0].McalAPER = 10.000; 155 image[0].dMcal = 10.000; 155 156 return; 156 157 } … … 187 188 if (Nkeep < 5) { 188 189 fprintf (stderr, "too few stars\n"); 189 image[0].Mcal = 10.000; 190 image[0].dMcal = 10.000; 190 image[0].McalPSF = 10.000; 191 image[0].McalAPER = 10.000; 192 image[0].dMcal = 10.000; 191 193 return; 192 194 } … … 225 227 fprintf (stdout, "ZERO_POINT_NSTARS = %4.0f\n", N); 226 228 // fprintf (stderr, "N: %.0f, mean: %f, wt mean: %f, stdev: %f, precision: %f\n", N, M1, Mw, M2, M2 / sqrt (N)); 227 image[0].Mcal = M1; 228 image[0].dMcal = M2 / sqrt (N); 229 image[0].McalPSF = M1; 230 image[0].McalAPER = M1; 231 image[0].dMcal = M2 / sqrt (N); 229 232 image[0].nFitPhotom = N; 230 233 } else { 231 234 fprintf (stderr, "too few stars\n"); 232 image[0].Mcal = 10.000; 233 image[0].dMcal = 10.000; 235 image[0].McalPSF = 10.000; 236 image[0].McalAPER = 10.000; 237 image[0].dMcal = 10.000; 234 238 image[0].nFitPhotom = 0; 235 239 } -
branches/eam_branches/ohana.20170822/src/addstar/src/fakeimage.c
r37807 r40212 110 110 image[i+1].ccdnum = 0xff; 111 111 112 image[i+1].Mcal = 0.0; 113 image[i+1].Xm = NAN_S_SHORT; 112 image[i+1].McalPSF = 0.0; 113 image[i+1].McalAPER = 0.0; 114 image[i+1].McalChiSq = NAN; 115 image[i+1].dMcal = NAN; 114 116 image[i+1].flags = 0; 115 117 … … 165 167 image[0].secz = 1.0; 166 168 image[0].ccdnum = 0xff; 167 image[0].Mcal = 0.0; 168 image[0].Xm = NAN_S_SHORT; 169 170 image[0].McalPSF = 0.0; 171 image[0].McalAPER = 0.0; 172 image[0].McalChiSq = NAN; 173 image[0].dMcal = NAN; 169 174 image[0].flags = 0; 175 170 176 image[0].nstar = 0; 171 177 -
branches/eam_branches/ohana.20170822/src/addstar/src/find_matches.c
r38986 r40212 212 212 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 213 213 if (Nsec > -1) { 214 if (isnan(tgtcat[0].secfilt[n*Nsecfilt+Nsec].M )) {215 tgtcat[0].secfilt[n*Nsecfilt+Nsec].M = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF);214 if (isnan(tgtcat[0].secfilt[n*Nsecfilt+Nsec].MpsfChp)) { 215 tgtcat[0].secfilt[n*Nsecfilt+Nsec].MpsfChp = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF); 216 216 } 217 217 } … … 305 305 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 306 306 if (Nsec > -1) { 307 tgtcat[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF);307 tgtcat[0].secfilt[Nave*Nsecfilt+Nsec].MpsfChp = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF); 308 308 } 309 309 -
branches/eam_branches/ohana.20170822/src/addstar/src/find_matches_closest.c
r38986 r40212 248 248 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 249 249 if (Nsec > -1) { 250 if (isnan(tgtcat[0].secfilt[n*Nsecfilt+Nsec].M )) {251 tgtcat[0].secfilt[n*Nsecfilt+Nsec].M = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF);250 if (isnan(tgtcat[0].secfilt[n*Nsecfilt+Nsec].MpsfChp)) { 251 tgtcat[0].secfilt[n*Nsecfilt+Nsec].MpsfChp = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF); 252 252 } 253 253 } … … 352 352 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 353 353 if (Nsec > -1) { 354 tgtcat[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF);354 tgtcat[0].secfilt[Nave*Nsecfilt+Nsec].MpsfChp = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF); 355 355 } 356 356 -
branches/eam_branches/ohana.20170822/src/addstar/src/find_matches_gaia.c
r39926 r40212 267 267 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 268 268 if (Nsec > -1) { 269 tgtcat[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF);269 tgtcat[0].secfilt[Nave*Nsecfilt+Nsec].MpsfChp = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF); 270 270 } 271 271 -
branches/eam_branches/ohana.20170822/src/addstar/src/loadsupercos_plates.c
r37807 r40212 72 72 image[Nimage].apmifit = 0.0; 73 73 image[Nimage].dapmifit = 0.0; 74 image[Nimage].Mcal = 0.0; 75 image[Nimage].dMcal = 0.0; 76 image[Nimage].Xm = 0.0; 74 image[Nimage].McalPSF = 0.0; 75 image[Nimage].McalAPER = 0.0; 76 image[Nimage].McalChiSq = 0.0; 77 image[Nimage].dMcal = 0.0; 77 78 78 79 char photname[128]; -
branches/eam_branches/ohana.20170822/src/checkastro/src/BrightCatalog.c
r37043 r40212 270 270 ALLOCATE (secfilt, SecFilt, Nrow); 271 271 for (i = 0; i < Nrow; i++) { 272 secfilt[i].M = M[i];273 secfilt[i].dM = dM[i];274 secfilt[i].Mchisq = Mchisq[i];275 secfilt[i].flags = flags[i];276 secfilt[i].Ncode = Ncode[i];277 secfilt[i].Nused = Nused[i];278 secfilt[i].M_20 = M_20[i];279 secfilt[i].M_80 = M_80[i];272 secfilt[i].MpsfChp = M[i]; 273 secfilt[i].dMpsfChp = dM[i]; 274 secfilt[i].Mchisq = Mchisq[i]; 275 secfilt[i].flags = flags[i]; 276 secfilt[i].Ncode = Ncode[i]; 277 secfilt[i].Nused = Nused[i]; 278 secfilt[i].M_20 = M_20[i]; 279 secfilt[i].M_80 = M_80[i]; 280 280 } 281 281 fprintf (stderr, "loaded data for %lld averages\n", (long long) Nrow); … … 652 652 SecFilt *secfilt = catalog->secfilt; 653 653 for (i = 0; i < Nsec; i++) { 654 M [i] = secfilt[i].M ;655 dM [i] = secfilt[i].dM ;656 Mchisq[i] = secfilt[i].Mchisq ;657 flags [i] = secfilt[i].flags ;658 Ncode [i] = secfilt[i].Ncode ;659 Nused [i] = secfilt[i].Nused ;660 M_20 [i] = secfilt[i].M_20 ;661 M_80 [i] = secfilt[i].M_80 ;654 M [i] = secfilt[i].MpsfChp ; 655 dM [i] = secfilt[i].dMpsfChp; 656 Mchisq[i] = secfilt[i].Mchisq ; 657 flags [i] = secfilt[i].flags ; 658 Ncode [i] = secfilt[i].Ncode ; 659 Nused [i] = secfilt[i].Nused ; 660 M_20 [i] = secfilt[i].M_20 ; 661 M_80 [i] = secfilt[i].M_80 ; 662 662 } 663 663 -
branches/eam_branches/ohana.20170822/src/delstar/src/gimages.c
r39457 r40212 88 88 89 89 /* secz is in units milli-airmass */ 90 image[0].Mcal = ALPHA*(image[0].secz - 1.000); 91 image[0].Xm = NAN_S_SHORT; 90 image[0].McalPSF = ALPHA*(image[0].secz - 1.000); 91 image[0].McalAPER = ALPHA*(image[0].secz - 1.000); 92 image[0].McalChiSq = NAN_S_SHORT; 92 93 93 94 free (header.buffer); -
branches/eam_branches/ohana.20170822/src/dvomerge/src/merge_catalogs_old.c
r39926 r40212 367 367 // secfilt tables of input and output are the same 368 368 for (k = 0; k < NsecfiltIn; k++) { 369 if ( isfinite(output[0].secfilt[n*NsecfiltIn+k].M )) continue;370 if (!isfinite( input[0].secfilt[N*NsecfiltIn+k].M )) continue;369 if ( isfinite(output[0].secfilt[n*NsecfiltIn+k].MpsfChp)) continue; 370 if (!isfinite( input[0].secfilt[N*NsecfiltIn+k].MpsfChp)) continue; 371 371 output[0].secfilt[n*NsecfiltIn+k] = input[0].secfilt[N*NsecfiltIn+k]; 372 372 } … … 378 378 int outputIndex = n * NsecfiltOut + secfiltMap[k]; 379 379 380 if ( isfinite(output[0].secfilt[outputIndex].M )) continue;381 if (!isfinite( input[0].secfilt[N*NsecfiltIn+k].M )) continue;380 if ( isfinite(output[0].secfilt[outputIndex].MpsfChp)) continue; 381 if (!isfinite( input[0].secfilt[N*NsecfiltIn+k].MpsfChp)) continue; 382 382 output[0].secfilt[outputIndex] = input[0].secfilt[N*NsecfiltIn+k]; 383 383 } … … 489 489 } 490 490 491 if (isfinite(input[0].secfilt[N*NsecfiltIn+j].M )) {491 if (isfinite(input[0].secfilt[N*NsecfiltIn+j].MpsfChp)) { 492 492 output[0].secfilt[outputIndex] = input[0].secfilt[N*NsecfiltIn+j]; 493 493 } -
branches/eam_branches/ohana.20170822/src/dvopsps/src/insert_objects_dvopsps_catalog.c
r39650 r40212 372 372 float meanPSFMagMin = NAN; 373 373 float meanPSFMagMax = NAN; 374 if (isfinite(secfilt->dM ) && isfinite(secfilt->M)) {375 meanPSFMag = secfilt->M ;376 meanPSFMagErr = secfilt->dM ;377 meanPSFMagStd = secfilt-> Mstdev;374 if (isfinite(secfilt->dMpsfChp) && isfinite(secfilt->MpsfChp)) { 375 meanPSFMag = secfilt->MpsfChp; 376 meanPSFMagErr = secfilt->dMpsfChp; 377 meanPSFMagStd = secfilt->sMpsfChp; 378 378 meanPSFMagMin = secfilt->Mmin; 379 379 meanPSFMagMax = secfilt->Mmax; … … 383 383 float meanKronMagErr = NAN; 384 384 float meanKronMagStd = NAN; 385 if (isfinite(secfilt->dMkron ) && isfinite(secfilt->Mkron) && (secfilt->dMkron< 0.333)) {386 meanKronMag = secfilt->Mkron ;387 meanKronMagErr = secfilt->dMkron ;388 meanKronMagStd = secfilt->sMkron ;385 if (isfinite(secfilt->dMkronChp) && isfinite(secfilt->MkronChp) && (secfilt->dMkronChp < 0.333)) { 386 meanKronMag = secfilt->MkronChp; 387 meanKronMagErr = secfilt->dMkronChp; 388 meanKronMagStd = secfilt->sMkronChp; 389 389 } 390 390 … … 392 392 float meanApMagErr = NAN; 393 393 float meanApMagStd = NAN; 394 if (isfinite(secfilt->dMap ) && isfinite(secfilt->Map)) {395 meanApMag = secfilt->Map ;396 meanApMagErr = secfilt->dMap ;397 meanApMagStd = secfilt->sMap ;394 if (isfinite(secfilt->dMapChp) && isfinite(secfilt->MapChp)) { 395 meanApMag = secfilt->MapChp; 396 meanApMagErr = secfilt->dMapChp; 397 meanApMagStd = secfilt->sMapChp; 398 398 } 399 399 -
branches/eam_branches/ohana.20170822/src/fakeastro/src/insert_fakestar.c
r38469 r40212 93 93 94 94 // I need a photcode for r-band 95 catalog[0].secfilt[Nave*Nsecfilt+0].M = m_g;96 catalog[0].secfilt[Nave*Nsecfilt+1].M = m_r;97 catalog[0].secfilt[Nave*Nsecfilt+2].M = m_i;98 catalog[0].secfilt[Nave*Nsecfilt+3].M = m_z;99 catalog[0].secfilt[Nave*Nsecfilt+4].M = m_y;95 catalog[0].secfilt[Nave*Nsecfilt+0].MpsfChp = m_g; 96 catalog[0].secfilt[Nave*Nsecfilt+1].MpsfChp = m_r; 97 catalog[0].secfilt[Nave*Nsecfilt+2].MpsfChp = m_i; 98 catalog[0].secfilt[Nave*Nsecfilt+3].MpsfChp = m_z; 99 catalog[0].secfilt[Nave*Nsecfilt+4].MpsfChp = m_y; 100 100 101 101 catalog[0].starpar[Nstarpar] = stars[i].starpar; -
branches/eam_branches/ohana.20170822/src/fakeastro/src/load_template_images.c
r38441 r40212 61 61 62 62 refimage[Nrefimage].secz = childImage->secz; 63 refimage[Nrefimage].Mcal = childImage->Mcal; 63 refimage[Nrefimage].McalPSF = childImage->McalPSF; 64 refimage[Nrefimage].McalAPER = childImage->McalAPER; 64 65 refimage[Nrefimage].dMcal = childImage->dMcal; 65 66 refimage[Nrefimage].exptime = childImage->exptime; -
branches/eam_branches/ohana.20170822/src/fakeastro/src/make_2mass_measures.c
r39248 r40212 44 44 45 45 // make a crude JHK color for now: 46 double J_PS1 = secfilt[i*Nsecfilt + Nsec].M - 1.0; // make all stars have y-J = 1.046 double J_PS1 = secfilt[i*Nsecfilt + Nsec].MpsfChp - 1.0; // make all stars have y-J = 1.0 47 47 if (J_PS1 > MAX_MAG_2MASS) continue; // only generate 2MASS detections for objects with J_PS1 < 16.0 48 48 49 if (isnan(secfilt[i*Nsecfilt + Nsec].M )) {49 if (isnan(secfilt[i*Nsecfilt + Nsec].MpsfChp)) { 50 50 // look for a non-NAN secfilt mag and just use that (it is not super important) 51 51 int ns; 52 52 for (ns = 0; ns < Nsecfilt; ns++) { 53 if (!isnan(secfilt[i*Nsecfilt + ns].M )) break;53 if (!isnan(secfilt[i*Nsecfilt + ns].MpsfChp)) break; 54 54 } 55 55 if (ns == Nsecfilt) continue; // no non-nan 56 56 57 J_PS1 = secfilt[i*Nsecfilt + ns].M ; // pretend secfilt.M= J57 J_PS1 = secfilt[i*Nsecfilt + ns].MpsfChp; // pretend secfilt.MpsfChp = J 58 58 if (J_PS1 > MAX_MAG_2MASS) continue; // only generate 2MASS detections for objects with J_PS1 < 16.0 59 59 } -
branches/eam_branches/ohana.20170822/src/fakeastro/src/make_fake_stars_catalog.c
r39926 r40212 42 42 43 43 // XXX put in airmass? 44 float ZP = SCALE*code->C - image->Mcal + Mtime;45 float ZPo = 25.0 - image->Mcal + Mtime;44 float ZP = SCALE*code->C - image->McalPSF + Mtime; 45 float ZPo = 25.0 - image->McalPSF + Mtime; 46 46 // float ZP = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - measure[0].Mcal; 47 47 … … 79 79 // float Minst = Msky - SCALE*code->C - measure[0].dt 80 80 81 double Minst = secfilt[i*Nsecfilt + Nsec].M - ZP;81 double Minst = secfilt[i*Nsecfilt + Nsec].MpsfChp - ZP; 82 82 double Counts = pow(10.0, -0.4*Minst); 83 83 double SkyCts = sky[Nsec]; … … 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->Mcal ;177 stars[Nstars].measure.Mcal = image->McalPSF; 178 178 stars[Nstars].measure.t = image->tzero + 1e-4*stars[Nstars].measure.Yccd*image->trate; // trate is in 0.1 msec / row 179 179 stars[Nstars].measure.dt = Mtime; -
branches/eam_branches/ohana.20170822/src/fakeastro/src/make_gaia_measures.c
r39926 r40212 42 42 43 43 // make a crude G-i color for now: 44 double G_PS1 = secfilt[i*Nsecfilt + Nsec].M ; // make all stars have G-i = 1.044 double G_PS1 = secfilt[i*Nsecfilt + Nsec].MpsfChp; // make all stars have G-i = 1.0 45 45 if (G_PS1 > MAX_MAG_GAIA) continue; // only generate GAIA detections for objects with G_PS1 < 21.0 46 46 47 if (isnan(secfilt[i*Nsecfilt + Nsec].M )) {47 if (isnan(secfilt[i*Nsecfilt + Nsec].MpsfChp)) { 48 48 // look for a non-NAN secfilt mag and just use that (it is not super important) 49 49 int ns; 50 50 for (ns = 0; ns < Nsecfilt; ns++) { 51 if (!isnan(secfilt[i*Nsecfilt + ns].M )) break;51 if (!isnan(secfilt[i*Nsecfilt + ns].MpsfChp)) break; 52 52 } 53 53 if (ns == Nsecfilt) continue; // no non-nan 54 54 55 G_PS1 = secfilt[i*Nsecfilt + ns].M ; // pretend secfilt.M = G55 G_PS1 = secfilt[i*Nsecfilt + ns].MpsfChp; // pretend secfilt.M = G 56 56 if (G_PS1 > MAX_MAG_GAIA) continue; // only generate GAIA detections for objects with G_PS1 < 21.0 57 57 } -
branches/eam_branches/ohana.20170822/src/getstar/src/ReadImageHeader.c
r39998 r40212 127 127 128 128 /* secz is in units milli-airmass */ 129 image[0].Mcal = 0.0; 130 image[0].Xm = NAN_S_SHORT; 129 image[0].McalPSF = 0.0; 130 image[0].McalAPER = 0.0; 131 image[0].McalChiSq = NAN; 131 132 image[0].flags = 0; 132 133 -
branches/eam_branches/ohana.20170822/src/getstar/src/select_by_region.c
r38441 r40212 78 78 } 79 79 } else { 80 mag = catalog[0].secfilt[i*Nsecfilt + Nsec].M ;80 mag = catalog[0].secfilt[i*Nsecfilt + Nsec].MpsfChp; 81 81 } 82 82 if (isnan(mag)) continue; … … 131 131 } 132 132 } else { 133 mag = catalog[0].secfilt[i*Nsecfilt + Nsec].M ;133 mag = catalog[0].secfilt[i*Nsecfilt + Nsec].MpsfChp; 134 134 } 135 135 if (isnan(mag) || (mag > MagLimitValue)) continue; -
branches/eam_branches/ohana.20170822/src/getstar/src/write_getstar_ps1_dev_0.c
r38441 r40212 55 55 // find primary magnitude 56 56 if (Nsec_c0 != -1) { 57 output[i].mag = secfilt[i*Nsecfilt + Nsec_c0].M ;57 output[i].mag = secfilt[i*Nsecfilt + Nsec_c0].MpsfChp; 58 58 } else { 59 59 output[i].mag = NAN; … … 69 69 // find color term 1 70 70 if (Nsec_c1 != -1) { 71 output[i].c1 = secfilt[i*Nsecfilt + Nsec_c1].M ;71 output[i].c1 = secfilt[i*Nsecfilt + Nsec_c1].MpsfChp; 72 72 } else { 73 73 output[i].c1 = NAN; … … 83 83 // find color term 2 84 84 if (Nsec_c2 != -1) { 85 output[i].c2 = secfilt[i*Nsecfilt + Nsec_c2].M ;85 output[i].c2 = secfilt[i*Nsecfilt + Nsec_c2].MpsfChp; 86 86 } else { 87 87 output[i].c2 = NAN; -
branches/eam_branches/ohana.20170822/src/getstar/src/write_getstar_ps1_dev_1.c
r38441 r40212 58 58 // find primary magnitude 59 59 if (Nsec_c0 != -1) { 60 output[i].mag = secfilt[i*Nsecfilt + Nsec_c0].M ;60 output[i].mag = secfilt[i*Nsecfilt + Nsec_c0].MpsfChp; 61 61 } else { 62 62 output[i].mag = NAN; … … 72 72 // find color term 1 73 73 if (Nsec_c1 != -1) { 74 output[i].c1 = secfilt[i*Nsecfilt + Nsec_c1].M ;74 output[i].c1 = secfilt[i*Nsecfilt + Nsec_c1].MpsfChp; 75 75 } else { 76 76 output[i].c1 = NAN; … … 86 86 // find color term 2 87 87 if (Nsec_c2 != -1) { 88 output[i].c2 = secfilt[i*Nsecfilt + Nsec_c2].M ;88 output[i].c2 = secfilt[i*Nsecfilt + Nsec_c2].MpsfChp; 89 89 } else { 90 90 output[i].c2 = NAN; -
branches/eam_branches/ohana.20170822/src/getstar/src/write_getstar_ps1_dev_2.c
r38441 r40212 64 64 // find primary magnitude 65 65 if (Nsec_c0 != -1) { 66 output[i].mag = secfilt[i*Nsecfilt + Nsec_c0].M ;66 output[i].mag = secfilt[i*Nsecfilt + Nsec_c0].MpsfChp; 67 67 } else { 68 68 output[i].mag = NAN; … … 78 78 // find color term 1 79 79 if (Nsec_c1 != -1) { 80 output[i].c1 = secfilt[i*Nsecfilt + Nsec_c1].M ;80 output[i].c1 = secfilt[i*Nsecfilt + Nsec_c1].MpsfChp; 81 81 } else { 82 82 output[i].c1 = NAN; … … 92 92 // find color term 2 93 93 if (Nsec_c2 != -1) { 94 output[i].c2 = secfilt[i*Nsecfilt + Nsec_c2].M ;94 output[i].c2 = secfilt[i*Nsecfilt + Nsec_c2].MpsfChp; 95 95 } else { 96 96 output[i].c2 = NAN; -
branches/eam_branches/ohana.20170822/src/imregister/imphot/dumpfits.c
r38441 r40212 114 114 startstr = ohana_sec_to_date (subset[0].tzero); 115 115 filtstr = GetPhotcodeNamebyCode (subset[0].photcode); 116 zp = subset[0].Mcal ;116 zp = subset[0].McalPSF; 117 117 dzp = subset[0].dMcal; 118 118 XY_to_RD (&ra, &dec, 0.0, 0.0, &subset[0].coords); -
branches/eam_branches/ohana.20170822/src/imregister/imphot/output.c
r34088 r40212 37 37 38 38 fprintf (stdout, "%s %s %s %7.4f %7.4f %7.4f %5d %02x\n", image[i].name, photstr, timestr, 39 image[i].Mcal , image[i].dMcal, image[i].secz, image[i].nstar, image[i].flags);39 image[i].McalPSF, image[i].dMcal, image[i].secz, image[i].nstar, image[i].flags); 40 40 free (timestr); 41 41 } -
branches/eam_branches/ohana.20170822/src/kapa2/src/DrawObjects.c
r40125 r40212 97 97 switch (object[0].style) { 98 98 case KAPA_PLOT_CONNECT: 99 // fprintf (stderr, "plot KAPA_PLOT_CONNECT: \n"); 99 100 DrawConnect (graphic, graph, object); 100 101 break; 101 102 case KAPA_PLOT_HISTOGRAM: 103 // fprintf (stderr, "plot KAPA_PLOT_HISTOGRAM:\n"); 102 104 DrawHistogram (graphic, graph, object); 103 105 break; 104 106 case KAPA_PLOT_BARS_SOLID: 107 // fprintf (stderr, "plot KAPA_PLOT_BARS_SOLID:\n"); 105 108 DrawBars (graphic, graph, object, KAPA_PLOT_BARS_SOLID); 106 109 break; 107 110 case KAPA_PLOT_BARS_OUTLINE: 111 // fprintf (stderr, "plot KAPA_PLOT_BARS_OUTLINE:\n"); 108 112 DrawBars (graphic, graph, object, KAPA_PLOT_BARS_OUTLINE); 109 113 break; 110 114 case KAPA_PLOT_BARS_OUTFILL: 115 // fprintf (stderr, "plot KAPA_PLOT_BARS_OUTFILL:\n"); 111 116 DrawBars (graphic, graph, object, KAPA_PLOT_BARS_OUTFILL); 112 117 break; 113 118 case KAPA_PLOT_POINTS: 114 119 default: 120 // fprintf (stderr, "plot KAPA_PLOT_POINTS:\n"); 115 121 DrawPoints (graphic, graph, object); 116 122 break; -
branches/eam_branches/ohana.20170822/src/libautocode/def/secfilt.d
r37246 r40212 5 5 DESCRIPTION DVO SecFilt : Secondary Filter Data 6 6 7 ## 2017.11.22 : To clarify the parallel structures, I am explicitly renaming M,Map,Mkron to MpsfChp, MapChp, MkronChp 8 7 9 ## *** this section is for per-exposure mean values *** (unlabled values are implicitly PSF values) 8 FIELD M, MAG, float, average mag in this band, mags 9 FIELD dM, MAG_ERR, float, formal error on average mag, mags 10 FIELD Map, MAG_AP, float, average mag in this band, mags 11 FIELD dMap, MAG_AP_ERR, float, formal error on average mag, mags 12 FIELD sMap, MAG_AP_STDEV, float, standard deviation of ap mags, mags 13 FIELD Mkron, MAG_KRON, float, ave kron mag in this band, mags 14 FIELD dMkron, MAG_KRON_ERR, float, formal error on average kron mag, mags 15 FIELD sMkron, MAG_KRON_STDEV, float, standard deviation of kron mags, mags 10 FIELD MpsfChp, MAG, float, average mag in this band, mags 11 FIELD dMpsfChp, MAG_ERR, float, formal error on average mag, mags 12 FIELD sMpsfChp, MAG_STDEV, float, standard deviation of measurements, mags 13 14 FIELD MapChp, MAG_AP, float, average mag in this band, mags 15 FIELD dMapChp, MAG_AP_ERR, float, formal error on average mag, mags 16 FIELD sMapChp, MAG_AP_STDEV, float, standard deviation of ap mags, mags 17 18 FIELD MkronChp, MAG_KRON, float, ave kron mag in this band, mags 19 FIELD dMkronChp, MAG_KRON_ERR, float, formal error on average kron mag, mags 20 FIELD sMkronChp, MAG_KRON_STDEV, float, standard deviation of kron mags, mags 16 21 17 22 # XXX I could add these fields to secfilt or calculate in dvopsps? … … 20 25 21 26 # these statistics are PSF-specific 22 FIELD Mstdev, MAG_STDEV, float, standard deviation of measurements, mags23 27 FIELD Mmin, MAG_MIN, float, minimum accepted mag, mags 24 28 FIELD Mmax, MAG_MAX, float, maximum accepted mag, mags -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_catalog.c
r40211 r40212 235 235 236 236 if (mode & SECFILT_RESET_CHIP) { 237 secfilt->M = NAN; 238 secfilt->dM = NAN; 239 secfilt->Map = NAN; 240 secfilt->dMap = NAN; 241 secfilt->sMap = NAN; 242 secfilt->Mkron = NAN; 243 secfilt->dMkron = NAN; 244 secfilt->sMkron = NAN; 237 secfilt->MpsfChp = NAN; 238 secfilt->dMpsfChp = NAN; 239 secfilt->sMpsfChp = NAN; 240 secfilt->MapChp = NAN; 241 secfilt->dMapChp = NAN; 242 secfilt->sMapChp = NAN; 243 secfilt->MkronChp = NAN; 244 secfilt->dMkronChp = NAN; 245 secfilt->sMkronChp = NAN; 245 246 246 247 secfilt->psfQfMax = NAN; 247 248 secfilt->psfQfPerfMax = NAN; 248 249 249 secfilt->Mstdev = NAN;250 250 secfilt->Mmin = NAN; 251 251 secfilt->Mmax = NAN; … … 923 923 for (in = out = i = 0; i < catalog[0].Naverage; i++) { 924 924 for (j = 0; j < catalog[0].Nsecfilt; j++, in++, out++) { 925 outsec[out].M = insec[in].M;926 outsec[out].dM = insec[in].dM;927 outsec[out].Mchisq = insec[in].Mchisq;925 outsec[out].MpsfChp = insec[in].MpsfChp; 926 outsec[out].dMpsfChp = insec[in].dMpsfChp; 927 outsec[out].Mchisq = insec[in].Mchisq; 928 928 } 929 929 for (j = 0; j < Nextra; j++, out++) { 930 outsec[out].M = NAN;931 outsec[out].dM = NAN;932 outsec[out].Mchisq = NAN;930 outsec[out].MpsfChp = NAN; 931 outsec[out].dMpsfChp = NAN; 932 outsec[out].Mchisq = NAN; 933 933 } 934 934 } -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_PS1_DEV_1.c
r40210 r40212 182 182 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 183 183 184 out[i].M = in[i].M; 185 out[i].dM = in[i].dM; 184 out[i].MpsfChp = in[i].M; 185 out[i].dMpsfChp = in[i].dM; 186 186 187 out[i].Mchisq= pow (10.0, 0.01*in[i].Xm); 187 188 out[i].Ncode = in[i].Ncode; … … 199 200 200 201 for (i = 0; i < Nvalues; i++) { 201 out[i].M = in[i].M; 202 out[i].dM = in[i].dM; 202 out[i].M = in[i].MpsfChp; 203 out[i].dM = in[i].dMpsfChp; 204 203 205 out[i].Xm = 100.0*log10(in[i].Mchisq); 204 206 out[i].Ncode = in[i].Ncode; -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_PS1_DEV_2.c
r40210 r40212 177 177 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 178 178 179 out[i].M = in[i].M; 180 out[i].dM = in[i].dM; 179 out[i].MpsfChp = in[i].M; 180 out[i].dMpsfChp = in[i].dM; 181 181 182 out[i].Mchisq= pow (10.0, 0.01*in[i].Xm); 182 183 out[i].Ncode = in[i].Ncode; … … 194 195 195 196 for (i = 0; i < Nvalues; i++) { 196 out[i].M = in[i].M; 197 out[i].dM = in[i].dM; 197 out[i].M = in[i].MpsfChp; 198 out[i].dM = in[i].dMpsfChp; 199 198 200 out[i].Xm = 100.0*log10(in[i].Mchisq); 199 201 out[i].Ncode = in[i].Ncode; -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_PS1_REF.c
r40210 r40212 114 114 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 115 115 116 out[i].M = in[i].M;117 out[i].dM = in[i].dM;116 out[i].MpsfChp = in[i].M; 117 out[i].dMpsfChp = in[i].dM; 118 118 } 119 119 return (out); … … 128 128 129 129 for (i = 0; i < Nvalues; i++) { 130 out[i].M = in[i].M;131 out[i].dM = in[i].dM;130 out[i].M = in[i].MpsfChp; 131 out[i].dM = in[i].dMpsfChp; 132 132 } 133 133 return (out); -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_PS1_SIM.c
r40210 r40212 199 199 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 200 200 201 out[i].M = in[i].M; 202 out[i].dM = in[i].dM; 201 out[i].MpsfChp = in[i].M; 202 out[i].dMpsfChp = in[i].dM; 203 203 204 out[i].Ncode = in[i].Ncode; 204 205 out[i].Nused = in[i].Nused; … … 217 218 for (i = 0; i < Nvalues; i++) { 218 219 219 out[i].M = in[i].M; 220 out[i].dM = in[i].dM; 220 out[i].M = in[i].MpsfChp; 221 out[i].dM = in[i].dMpsfChp; 222 221 223 out[i].Ncode = in[i].Ncode; 222 224 out[i].Nused = in[i].Nused; -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_PS1_V1.c
r40210 r40212 197 197 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 198 198 199 out[i].M = in[i].M; 200 out[i].dM = in[i].dM; 199 out[i].MpsfChp = in[i].M; 200 out[i].dMpsfChp = in[i].dM; 201 201 202 out[i].Mchisq= in[i].Mchisq; 202 203 out[i].Ncode = in[i].Ncode; … … 216 217 217 218 for (i = 0; i < Nvalues; i++) { 218 out[i].M = in[i].M; 219 out[i].dM = in[i].dM; 219 out[i].M = in[i].MpsfChp; 220 out[i].dM = in[i].dMpsfChp; 221 220 222 out[i].Mchisq= in[i].Mchisq; 221 223 out[i].Ncode = in[i].Ncode; -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_PS1_V2.c
r40210 r40212 206 206 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 207 207 208 out[i].M = in[i].M; 209 out[i].dM = in[i].dM; 208 out[i].MpsfChp = in[i].M; 209 out[i].dMpsfChp = in[i].dM; 210 210 211 out[i].Mchisq= in[i].Mchisq; 211 212 out[i].flags = in[i].flags; … … 226 227 227 228 for (i = 0; i < Nvalues; i++) { 228 out[i].M = in[i].M; 229 out[i].dM = in[i].dM; 229 out[i].M = in[i].MpsfChp; 230 out[i].dM = in[i].dMpsfChp; 231 230 232 out[i].Mchisq= in[i].Mchisq; 231 233 out[i].flags = in[i].flags; -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_PS1_V3.c
r40210 r40212 210 210 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 211 211 212 out[i].M = in[i].M; 213 out[i].Map = in[i].Map; 214 out[i].dM = in[i].dM; 212 out[i].MpsfChp = in[i].M; 213 out[i].sMpsfChp = in[i].Mstdev; 214 out[i].dMpsfChp = in[i].dM; 215 out[i].MapChp = in[i].Map; 216 215 217 out[i].Mchisq = in[i].Mchisq; 216 218 out[i].flags = in[i].flags; … … 219 221 out[i].Mmin = in[i].M_20*0.001; 220 222 out[i].Mmax = in[i].M_80*0.001; 221 out[i].Mstdev = in[i].Mstdev;222 223 out[i].ubercalDist = in[i].ubercalDist; 223 224 } … … 233 234 234 235 for (i = 0; i < Nvalues; i++) { 235 out[i].M = in[i].M; 236 out[i].Map = in[i].Map; 237 out[i].dM = in[i].dM; 236 out[i].M = in[i].MpsfChp; 237 out[i].dM = in[i].dMpsfChp; 238 out[i].Mstdev = in[i].sMpsfChp; 239 out[i].Map = in[i].MapChp; 240 238 241 out[i].Mchisq = in[i].Mchisq; 239 242 out[i].flags = in[i].flags; … … 242 245 out[i].M_20 = in[i].Mmin*1000.0; 243 246 out[i].M_80 = in[i].Mmax*1000.0; 244 out[i].Mstdev = in[i].Mstdev;245 247 out[i].ubercalDist = in[i].ubercalDist; 246 248 } -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_PS1_V4.c
r40210 r40212 234 234 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 235 235 236 out[i].M = in[i].M; 237 out[i].Map = in[i].Map; 238 out[i].Mkron = in[i].Mkron; 239 out[i].dMkron = in[i].dMkron; 240 out[i].dM = in[i].dM; 236 out[i].MpsfChp = in[i].M; 237 out[i].sMpsfChp = in[i].Mstdev; 238 out[i].dMpsfChp = in[i].dM; 239 out[i].MapChp = in[i].Map; 240 out[i].MkronChp = in[i].Mkron; 241 241 242 out[i].Mchisq = in[i].Mchisq; 242 243 out[i].FpsfStk = in[i].FluxPSF; … … 249 250 out[i].Mmin = in[i].M_20*0.001; 250 251 out[i].Mmax = in[i].M_80*0.001; 251 out[i].Mstdev = in[i].Mstdev;252 252 out[i].ubercalDist = in[i].ubercalDist; 253 253 out[i].stackPrmryOff = in[i].stackPrmryOff; … … 265 265 266 266 for (i = 0; i < Nvalues; i++) { 267 out[i].M = in[i].M; 268 out[i].Map = in[i].Map; 269 out[i].Mkron = in[i].Mkron; 270 out[i].dMkron = in[i].dMkron; 271 out[i].dM = in[i].dM; 267 out[i].M = in[i].MpsfChp; 268 out[i].dM = in[i].dMpsfChp; 269 out[i].Mstdev = in[i].sMpsfChp; 270 out[i].Map = in[i].MapChp; 271 out[i].Mkron = in[i].MkronChp; 272 272 273 out[i].Mchisq = in[i].Mchisq; 273 274 out[i].FluxPSF = in[i].FpsfStk; … … 280 281 out[i].M_20 = in[i].Mmin*1000.0; 281 282 out[i].M_80 = in[i].Mmax*1000.0; 282 out[i].Mstdev = in[i].Mstdev;283 283 out[i].ubercalDist = in[i].ubercalDist; 284 284 out[i].stackPrmryOff = in[i].stackPrmryOff; -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_PS1_V5.c
r40210 r40212 311 311 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 312 312 313 out[i].M = in[i].M; 314 out[i].dM = in[i].dM; 315 out[i].Map = in[i].Map; 316 out[i].dMap = in[i].dMap; 317 out[i].sMap = in[i].sMap; 318 out[i].Mkron = in[i].Mkron; 319 out[i].dMkron = in[i].dMkron; 320 out[i].sMkron = in[i].sMkron; 313 out[i].MpsfChp = in[i].M; 314 out[i].sMpsfChp = in[i].Mstdev; 315 out[i].dMpsfChp = in[i].dM; 316 out[i].MapChp = in[i].Map; 317 out[i].dMapChp = in[i].dMap; 318 out[i].sMapChp = in[i].sMap; 319 out[i].MkronChp = in[i].Mkron; 320 out[i].dMkronChp = in[i].dMkron; 321 out[i].sMkronChp = in[i].sMkron; 321 322 322 323 out[i].psfQfMax = in[i].psfQfMax; 323 324 out[i].psfQfPerfMax = in[i].psfQfPerfMax; 324 325 325 out[i].Mstdev = in[i].Mstdev;326 326 out[i].Mmin = in[i].Mmin; 327 327 out[i].Mmax = in[i].Mmax; … … 389 389 for (i = 0; i < Nvalues; i++) { 390 390 391 out[i].M = in[i].M; 392 out[i].dM = in[i].dM; 393 out[i].Map = in[i].Map; 394 out[i].dMap = in[i].dMap; 395 out[i].sMap = in[i].sMap; 396 out[i].Mkron = in[i].Mkron; 397 out[i].dMkron = in[i].dMkron; 398 out[i].sMkron = in[i].sMkron; 391 out[i].M = in[i].MpsfChp; 392 out[i].dM = in[i].dMpsfChp; 393 out[i].Mstdev = in[i].sMpsfChp; 394 out[i].Map = in[i].MapChp; 395 out[i].dMap = in[i].dMapChp; 396 out[i].sMap = in[i].sMapChp; 397 out[i].Mkron = in[i].MkronChp; 398 out[i].dMkron = in[i].dMkronChp; 399 out[i].sMkron = in[i].sMkronChp; 399 400 400 401 out[i].psfQfMax = in[i].psfQfMax; 401 402 out[i].psfQfPerfMax = in[i].psfQfPerfMax; 402 403 403 out[i].Mstdev = in[i].Mstdev;404 404 out[i].Mmin = in[i].Mmin; 405 405 out[i].Mmax = in[i].Mmax; … … 1500 1500 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 1501 1501 1502 out[i].M = in[i].M; 1503 out[i].dM = in[i].dM; 1504 out[i].Map = in[i].Map; 1505 out[i].dMap = in[i].dMap; 1506 out[i].sMap = in[i].sMap; 1507 out[i].Mkron = in[i].Mkron; 1508 out[i].dMkron = in[i].dMkron; 1509 1510 out[i].Mstdev = in[i].Mstdev; 1502 out[i].MpsfChp = in[i].M; 1503 out[i].dMpsfChp = in[i].dM; 1504 out[i].sMpsfChp = in[i].Mstdev; 1505 out[i].MapChp = in[i].Map; 1506 out[i].dMapChp = in[i].dMap; 1507 out[i].sMapChp = in[i].sMap; 1508 out[i].MkronChp = in[i].Mkron; 1509 out[i].dMkronChp = in[i].dMkron; 1510 out[i].sMkronChp = in[i].sMkron; 1511 1511 1512 out[i].Mmin = in[i].Mmin; 1512 1513 out[i].Mmax = in[i].Mmax; -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_PS1_V5_LOAD.c
r40210 r40212 221 221 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 222 222 223 out[i].M = in[i].M;223 out[i].MpsfChp = in[i].M; 224 224 out[i].Ncode = in[i].Ncode; 225 225 out[i].Nused = in[i].Nused; … … 237 237 for (i = 0; i < Nvalues; i++) { 238 238 239 out[i].M = in[i].M ;239 out[i].M = in[i].MpsfChp; 240 240 out[i].Ncode = in[i].Ncode; 241 241 out[i].Nused = in[i].Nused; -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_PS1_V6.c
r40210 r40212 311 311 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 312 312 313 out[i].M = in[i].M; 314 out[i].dM = in[i].dM; 315 out[i].Map = in[i].Map; 316 out[i].dMap = in[i].dMap; 317 out[i].sMap = in[i].sMap; 318 out[i].Mkron = in[i].Mkron; 319 out[i].dMkron = in[i].dMkron; 320 out[i].sMkron = in[i].sMkron; 313 out[i].MpsfChp = in[i].M; 314 out[i].sMpsfChp = in[i].Mstdev; 315 out[i].dMpsfChp = in[i].dM; 316 out[i].MapChp = in[i].Map; 317 out[i].dMapChp = in[i].dMap; 318 out[i].sMapChp = in[i].sMap; 319 out[i].MkronChp = in[i].Mkron; 320 out[i].dMkronChp = in[i].dMkron; 321 out[i].sMkronChp = in[i].sMkron; 321 322 322 323 out[i].psfQfMax = in[i].psfQfMax; 323 324 out[i].psfQfPerfMax = in[i].psfQfPerfMax; 324 325 325 out[i].Mstdev = in[i].Mstdev;326 326 out[i].Mmin = in[i].Mmin; 327 327 out[i].Mmax = in[i].Mmax; … … 389 389 for (i = 0; i < Nvalues; i++) { 390 390 391 out[i].M = in[i].M; 392 out[i].dM = in[i].dM; 393 out[i].Map = in[i].Map; 394 out[i].dMap = in[i].dMap; 395 out[i].sMap = in[i].sMap; 396 out[i].Mkron = in[i].Mkron; 397 out[i].dMkron = in[i].dMkron; 398 out[i].sMkron = in[i].sMkron; 391 out[i].M = in[i].MpsfChp; 392 out[i].dM = in[i].dMpsfChp; 393 out[i].Mstdev = in[i].sMpsfChp; 394 out[i].Map = in[i].MapChp; 395 out[i].dMap = in[i].dMapChp; 396 out[i].sMap = in[i].sMapChp; 397 out[i].Mkron = in[i].MkronChp; 398 out[i].dMkron = in[i].dMkronChp; 399 out[i].sMkron = in[i].sMkronChp; 399 400 400 401 out[i].psfQfMax = in[i].psfQfMax; 401 402 out[i].psfQfPerfMax = in[i].psfQfPerfMax; 402 403 403 out[i].Mstdev = in[i].Mstdev;404 404 out[i].Mmin = in[i].Mmin; 405 405 out[i].Mmax = in[i].Mmax; -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_elixir.c
r40210 r40212 109 109 110 110 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 111 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001;112 primary[0][i].dM = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001;111 primary[0][i].MpsfChp = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 112 primary[0][i].dMpsfChp = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001; 113 113 primary[0][i].Mchisq= pow (10.0, 0.01*in[i].Xm); 114 114 … … 142 142 143 143 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 144 out[i].M = isnan(primary[i].M ) ? NAN_S_SHORT : primary[i].M* 1000.0;145 out[i].dM = isnan(primary[i].dM ) ? NAN_S_SHORT : primary[i].dM* 1000.0;144 out[i].M = isnan(primary[i].MpsfChp) ? NAN_S_SHORT : primary[i].MpsfChp * 1000.0; 145 out[i].dM = isnan(primary[i].dMpsfChp) ? NAN_S_SHORT : primary[i].dMpsfChp * 1000.0; 146 146 out[i].Xm = 100.0*log10(primary[i].Mchisq); 147 147 … … 172 172 173 173 // added or changed for PANSTARRS_DEV_0 174 out[i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001;175 out[i].dM = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001;174 out[i].MpsfChp = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 175 out[i].dMpsfChp = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001; 176 176 } 177 177 return (out); … … 190 190 191 191 // added or changed for PANSTARRS_DEV_0 192 out[i].M = isnan(in[i].M ) ? NAN_S_SHORT : in[i].M* 1000.0;193 out[i].dM = isnan(in[i].dM ) ? NAN_S_SHORT : in[i].dM* 1000.0;192 out[i].M = isnan(in[i].MpsfChp) ? NAN_S_SHORT : in[i].MpsfChp * 1000.0; 193 out[i].dM = isnan(in[i].dMpsfChp) ? NAN_S_SHORT : in[i].dMpsfChp * 1000.0; 194 194 } 195 195 return (out); -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_loneos.c
r40210 r40212 89 89 90 90 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 91 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001;92 primary[0][i].Mchisq = pow (10.0, 0.01*in[i].Xm);91 primary[0][i].MpsfChp = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 92 primary[0][i].Mchisq = pow (10.0, 0.01*in[i].Xm); 93 93 94 94 // added for PANSTARRS_DEV_0 … … 123 123 124 124 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 125 out[i].M = isnan(primary[i].M ) ? NAN_S_SHORT : primary[i].M* 1000.0;125 out[i].M = isnan(primary[i].MpsfChp) ? NAN_S_SHORT : primary[i].MpsfChp * 1000.0; 126 126 out[i].Xm = 100.0*log10(primary[i].Mchisq); 127 127 … … 152 152 153 153 // added or changed for PANSTARRS_DEV_0 154 out[i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001;154 out[i].MpsfChp = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 155 155 } 156 156 return (out); … … 169 169 170 170 // added or changed for PANSTARRS_DEV_0 171 out[i].M = isnan(in[i].M ) ? NAN_S_SHORT : in[i].M* 1000.0;171 out[i].M = isnan(in[i].MpsfChp) ? NAN_S_SHORT : in[i].MpsfChp * 1000.0; 172 172 } 173 173 return (out); -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c
r40210 r40212 188 188 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 189 189 190 out[i].M = in[i].M; 191 out[i].dM = in[i].dM; 190 out[i].MpsfChp = in[i].M; 191 out[i].dMpsfChp = in[i].dM; 192 192 193 out[i].Mchisq= pow (10.0, 0.01*in[i].Xm); 193 194 out[i].Ncode = in[i].Ncode; … … 206 207 207 208 for (i = 0; i < Nvalues; i++) { 208 out[i].M = in[i].M; 209 out[i].dM = in[i].dM; 209 out[i].M = in[i].MpsfChp; 210 out[i].dM = in[i].dMpsfChp; 211 210 212 out[i].Xm = 100.0*log10(in[i].Mchisq); 211 213 out[i].Ncode = in[i].Ncode; -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c
r40210 r40212 188 188 dvo_secfilt_init (&out[i], SECFILT_RESET_ALL); 189 189 190 out[i].M = in[i].M; 191 out[i].dM = in[i].dM; 190 out[i].MpsfChp = in[i].M; 191 out[i].dMpsfChp = in[i].dM; 192 192 193 out[i].Mchisq= pow (10.0, 0.01*in[i].Xm); 193 194 out[i].Ncode = in[i].Ncode; … … 206 207 207 208 for (i = 0; i < Nvalues; i++) { 208 out[i].M = in[i].M; 209 out[i].dM = in[i].dM; 209 out[i].M = in[i].MpsfChp; 210 out[i].dM = in[i].dMpsfChp; 211 210 212 out[i].Xm = 100.0*log10(in[i].Mchisq); 211 213 out[i].Ncode = in[i].Ncode; -
branches/eam_branches/ohana.20170822/src/libdvo/src/dvo_photcode_ops.c
r39670 r40212 479 479 switch (class) { 480 480 case MAG_CLASS_PSF: 481 Mave = secfilt[Ns].M ;481 Mave = secfilt[Ns].MpsfChp; 482 482 break; 483 483 case MAG_CLASS_KRON: 484 Mave = secfilt[Ns].Mkron ;484 Mave = secfilt[Ns].MkronChp; 485 485 break; 486 486 case MAG_CLASS_APER: 487 Mave = secfilt[Ns].Map ;487 Mave = secfilt[Ns].MapChp; 488 488 break; 489 489 default: … … 592 592 switch (class) { 593 593 case MAG_CLASS_PSF: 594 dMave = secfilt[Ns].dM ;594 dMave = secfilt[Ns].dMpsfChp; 595 595 break; 596 596 case MAG_CLASS_KRON: 597 dMave = secfilt[Ns].dMkron ;597 dMave = secfilt[Ns].dMkronChp; 598 598 break; 599 599 case MAG_CLASS_APER: 600 dMave = secfilt[Ns].dMap ;600 dMave = secfilt[Ns].dMapChp; 601 601 break; 602 602 default: … … 677 677 Ns2 = photcodes[0].hashNsec[code[0].c2]; 678 678 679 m1 = (Ns1 == -1) ? NAN : secfilt[Ns1].M ;680 m2 = (Ns2 == -1) ? NAN : secfilt[Ns2].M ;679 m1 = (Ns1 == -1) ? NAN : secfilt[Ns1].MpsfChp; 680 m2 = (Ns2 == -1) ? NAN : secfilt[Ns2].MpsfChp; 681 681 mc = (isnan(m1) || isnan(m2)) ? NAN : (m1 - m2); 682 682 return (mc); … … 694 694 } else { 695 695 Ns = photcodes[0].hashNsec[color[0].code]; 696 m1 = (Ns == -1) ? NAN : secfilt[Ns].M ;696 m1 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp; 697 697 } 698 698 … … 708 708 } else { 709 709 Ns = photcodes[0].hashNsec[color[0].code]; 710 m2 = (Ns == -1) ? NAN : secfilt[Ns].M ;710 m2 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp; 711 711 } 712 712 mc = (isnan(m1) || isnan(m2)) ? NAN : (m1 - m2); … … 727 727 switch (class) { 728 728 case MAG_CLASS_PSF: 729 Mstdev = secfilt[Ns]. Mstdev;729 Mstdev = secfilt[Ns].sMpsfChp; 730 730 break; 731 731 case MAG_CLASS_KRON: 732 Mstdev = secfilt[Ns].sMkron ;732 Mstdev = secfilt[Ns].sMkronChp; 733 733 break; 734 734 case MAG_CLASS_APER: 735 Mstdev = secfilt[Ns].sMap ;735 Mstdev = secfilt[Ns].sMapChp; 736 736 break; 737 737 default: … … 1040 1040 } else { 1041 1041 Ns = photcodes[0].hashNsec[code[0].code]; 1042 M1 = (Ns == -1) ? NAN : secfilt[Ns].M ;1042 M1 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp; 1043 1043 } 1044 1044 … … 1056 1056 } else { 1057 1057 Ns = photcodes[0].hashNsec[code[0].code]; 1058 M2 = (Ns == -1) ? NAN : secfilt[Ns].M ;1058 M2 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp; 1059 1059 } 1060 1060 … … 1289 1289 switch (class) { 1290 1290 case MAG_CLASS_PSF: 1291 Fave = MagToFlux(secfilt[Ns].M - 8.9);1291 Fave = MagToFlux(secfilt[Ns].MpsfChp - 8.9); 1292 1292 break; 1293 1293 case MAG_CLASS_KRON: 1294 Fave = MagToFlux(secfilt[Ns].Mkron - 8.9);1294 Fave = MagToFlux(secfilt[Ns].MkronChp - 8.9); 1295 1295 break; 1296 1296 case MAG_CLASS_APER: 1297 Fave = MagToFlux(secfilt[Ns].Map - 8.9);1297 Fave = MagToFlux(secfilt[Ns].MapChp - 8.9); 1298 1298 break; 1299 1299 default: … … 1350 1350 switch (class) { 1351 1351 case MAG_CLASS_PSF: 1352 dFave = secfilt[Ns].dM * MagToFlux(secfilt[Ns].M- 8.9);1352 dFave = secfilt[Ns].dMpsfChp * MagToFlux(secfilt[Ns].MpsfChp - 8.9); 1353 1353 break; 1354 1354 case MAG_CLASS_KRON: 1355 dFave = secfilt[Ns].dMkron * MagToFlux(secfilt[Ns].Mkron- 8.9);1355 dFave = secfilt[Ns].dMkronChp * MagToFlux(secfilt[Ns].MkronChp - 8.9); 1356 1356 break; 1357 1357 case MAG_CLASS_APER: 1358 dFave = secfilt[Ns].dMap * MagToFlux(secfilt[Ns].Map - 8.9);1358 dFave = secfilt[Ns].dMapChp * MagToFlux(secfilt[Ns].MapChp - 8.9); 1359 1359 break; 1360 1360 default: … … 1840 1840 switch (class) { 1841 1841 case MAG_CLASS_PSF: 1842 Mave = secfilt[Ns].M ;1842 Mave = secfilt[Ns].MpsfChp; 1843 1843 break; 1844 1844 case MAG_CLASS_KRON: 1845 Mave = secfilt[Ns].Mkron ;1845 Mave = secfilt[Ns].MkronChp; 1846 1846 break; 1847 1847 case MAG_CLASS_APER: 1848 Mave = secfilt[Ns].Map ;1848 Mave = secfilt[Ns].MapChp; 1849 1849 break; 1850 1850 default: … … 1927 1927 Ns2 = photcodes[0].hashNsec[code[0].c2]; 1928 1928 1929 m1 = (Ns1 == -1) ? NAN : secfilt[Ns1].M ;1930 m2 = (Ns2 == -1) ? NAN : secfilt[Ns2].M ;1929 m1 = (Ns1 == -1) ? NAN : secfilt[Ns1].MpsfChp; 1930 m2 = (Ns2 == -1) ? NAN : secfilt[Ns2].MpsfChp; 1931 1931 mc = (isnan(m1) || isnan(m2)) ? NAN : (m1 - m2); 1932 1932 return (mc); … … 1944 1944 } else { 1945 1945 Ns = photcodes[0].hashNsec[color[0].code]; 1946 m1 = (Ns == -1) ? NAN : secfilt[Ns].M ;1946 m1 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp; 1947 1947 } 1948 1948 … … 1958 1958 } else { 1959 1959 Ns = photcodes[0].hashNsec[color[0].code]; 1960 m2 = (Ns == -1) ? NAN : secfilt[Ns].M ;1960 m2 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp; 1961 1961 } 1962 1962 mc = (isnan(m1) || isnan(m2)) ? NAN : (m1 - m2); … … 1973 1973 1974 1974 Ns = photcodes[0].hashNsec[code[0].code]; 1975 dM = (Ns == -1) ? NAN : secfilt[Ns].dM ;1975 dM = (Ns == -1) ? NAN : secfilt[Ns].dMpsfChp; 1976 1976 return (dM); 1977 1977 } … … 2010 2010 } else { 2011 2011 Ns = photcodes[0].hashNsec[code[0].code]; 2012 M1 = (Ns == -1) ? NAN : secfilt[Ns].M ;2012 M1 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp; 2013 2013 } 2014 2014 … … 2026 2026 } else { 2027 2027 Ns = photcodes[0].hashNsec[code[0].code]; 2028 M2 = (Ns == -1) ? NAN : secfilt[Ns].M ;2028 M2 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp; 2029 2029 } 2030 2030 -
branches/eam_branches/ohana.20170822/src/opihi/dvo/gimages.c
r39347 r40212 214 214 if (PixelCoords) { 215 215 gprint (GP_LOG, "%3d %5d %s %6.1f %6.1f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x %7d\n", 216 Nfound, (int) i, image[i].name, X, Y, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal , image[i].dMcal, image[i].exptime, image[i].flags, image[i].imageID);216 Nfound, (int) i, image[i].name, X, Y, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].McalPSF, image[i].dMcal, image[i].exptime, image[i].flags, image[i].imageID); 217 217 } else { 218 218 XY_to_RD (&ra, &dec, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords); 219 219 gprint (GP_LOG, "%3d %5d %s %8.4f %8.4f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x %7d\n", 220 Nfound, (int) i, image[i].name, ra, dec, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal , image[i].dMcal, image[i].exptime, image[i].flags, image[i].imageID);220 Nfound, (int) i, image[i].name, ra, dec, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].McalPSF, image[i].dMcal, image[i].exptime, image[i].flags, image[i].imageID); 221 221 } 222 222 sprintf (name, "IMAGEx:%d", Nfound); -
branches/eam_branches/ohana.20170822/src/opihi/dvo/gstar.c
r39634 r40212 960 960 print_double (NAN); 961 961 } else { 962 print_double_exp (secfilt[seq]. Mstdev);962 print_double_exp (secfilt[seq].sMpsfChp); 963 963 } 964 964 break; … … 1023 1023 print_double (NAN); 1024 1024 } else { 1025 print_double (secfilt[seq].M );1025 print_double (secfilt[seq].MpsfChp); 1026 1026 } 1027 1027 break; … … 1031 1031 print_double (NAN); 1032 1032 } else { 1033 print_double (secfilt[seq].dM );1033 print_double (secfilt[seq].dMpsfChp); 1034 1034 } 1035 1035 break; … … 1039 1039 print_double (NAN); 1040 1040 } else { 1041 print_double (secfilt[seq].Map );1041 print_double (secfilt[seq].MapChp); 1042 1042 } 1043 1043 break; … … 1047 1047 print_double (NAN); 1048 1048 } else { 1049 print_double (secfilt[seq].dMap );1049 print_double (secfilt[seq].dMapChp); 1050 1050 } 1051 1051 break; … … 1055 1055 print_double (NAN); 1056 1056 } else { 1057 print_double_exp (secfilt[seq].sMap );1057 print_double_exp (secfilt[seq].sMapChp); 1058 1058 } 1059 1059 break; … … 1063 1063 print_double (NAN); 1064 1064 } else { 1065 print_double_exp (secfilt[seq].dMap );1065 print_double_exp (secfilt[seq].dMapChp); 1066 1066 } 1067 1067 break; … … 1071 1071 print_double (NAN); 1072 1072 } else { 1073 print_double (secfilt[seq].Mkron );1073 print_double (secfilt[seq].MkronChp); 1074 1074 } 1075 1075 break; … … 1079 1079 print_double (NAN); 1080 1080 } else { 1081 print_double (secfilt[seq].dMkron );1081 print_double (secfilt[seq].dMkronChp); 1082 1082 } 1083 1083 break; … … 1087 1087 print_double (NAN); 1088 1088 } else { 1089 print_double_exp (secfilt[seq].sMkron );1089 print_double_exp (secfilt[seq].sMkronChp); 1090 1090 } 1091 1091 break; … … 1095 1095 print_double (NAN); 1096 1096 } else { 1097 print_double_exp (secfilt[seq].dMkron );1097 print_double_exp (secfilt[seq].dMkronChp); 1098 1098 } 1099 1099 break; -
branches/eam_branches/ohana.20170822/src/opihi/dvo/imlist.c
r39310 r40212 141 141 if (VERBOSE) { 142 142 gprint (GP_LOG, "%3lld %s %8lld %8.4f %8.4f %f %5d %2d %4.2f %5.3f %5.3f", 143 (long long) i, image[i].name, (long long) image[i].imageID, r, d, t, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal , image[i].dMcal);143 (long long) i, image[i].name, (long long) image[i].imageID, r, d, t, image[i].nstar, image[i].photcode, image[i].secz, image[i].McalPSF, image[i].dMcal); 144 144 145 145 if (showUR) { -
branches/eam_branches/ohana.20170822/src/opihi/dvo/imphot.c
r39233 r40212 64 64 for (x = 0; x < 100; x+=1.0, p++) { 65 65 // *p = applyMcal (&image[subset[0]], (fx*x), (fy*y)); 66 *p = image[subset[0]].Mcal ;66 *p = image[subset[0]].McalPSF; 67 67 } 68 68 } … … 71 71 for (j = 0; j < Nsubset; j++) { 72 72 i = subset[j]; 73 gprint (GP_ERR, "%s: %f\n", image[i].name, image[i].Mcal );73 gprint (GP_ERR, "%s: %f\n", image[i].name, image[i].McalPSF); 74 74 75 75 // XXX old code when we had the option of a 2D zero point model … … 77 77 switch (image[i].order) { 78 78 case 0: 79 gprint (GP_ERR, "%s: %d - %f\n", image[i].name, image[i].order, image[i].Mcal );79 gprint (GP_ERR, "%s: %d - %f\n", image[i].name, image[i].order, image[i].McalPSF); 80 80 break; 81 81 case 1: 82 gprint (GP_ERR, "%s: %d - %f, %d %d\n", image[i].name, image[i].order, image[i].Mcal , image[i].Mx, image[i].My);82 gprint (GP_ERR, "%s: %d - %f, %d %d\n", image[i].name, image[i].order, image[i].McalPSF, image[i].Mx, image[i].My); 83 83 break; 84 84 case 2: 85 gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d\n", image[i].name, image[i].order, image[i].Mcal , image[i].Mx, image[i].My, image[i].Mxx, image[i].Mxy, image[i].Myy);85 gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d\n", image[i].name, image[i].order, image[i].McalPSF, image[i].Mx, image[i].My, image[i].Mxx, image[i].Mxy, image[i].Myy); 86 86 break; 87 87 case 3: 88 gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d, %d %d %d %d\n", image[i].name, image[i].order, image[i].Mcal , image[i].Mx, image[i].My,88 gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d, %d %d %d %d\n", image[i].name, image[i].order, image[i].McalPSF, image[i].Mx, image[i].My, 89 89 image[i].Mxx, image[i].Mxy, image[i].Myy, image[i].Mxxx, image[i].Mxxy, image[i].Mxyy, image[i].Myyy); 90 90 break; 91 91 case 4: 92 gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d, %d %d %d %d, %d %d %d %d %d\n", image[i].name, image[i].order, image[i].Mcal , image[i].Mx, image[i].My,92 gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d, %d %d %d %d, %d %d %d %d %d\n", image[i].name, image[i].order, image[i].McalPSF, image[i].Mx, image[i].My, 93 93 image[i].Mxx, image[i].Mxy, image[i].Myy, image[i].Mxxx, image[i].Mxxy, image[i].Mxyy, image[i].Myyy, 94 94 image[i].Mxxxx, image[i].Mxxxy, image[i].Mxxyy, image[i].Mxyyy, image[i].Myyyy); -
branches/eam_branches/ohana.20170822/src/opihi/dvo/imstats.c
r40156 r40212 41 41 Xvec.elements.Flt[i] = image[i].secz; 42 42 if (Mcal) 43 Yvec.elements.Flt[i] = image[i].Mcal ;43 Yvec.elements.Flt[i] = image[i].McalPSF; 44 44 else 45 45 Yvec.elements.Flt[i] = image[i].dMcal; … … 47 47 gprint (GP_ERR, "%d %8.4f %8.4f %10d %6d %5.3f %6.3f %6.3f\n", 48 48 i, r, d, image[i].tzero, image[i].nstar, Xvec.elements.Flt[i], 49 image[i].Mcal , image[i].dMcal);49 image[i].McalPSF, image[i].dMcal); 50 50 } 51 51 if (AutoLimits) SetLimits (&Xvec, &Yvec, &graphmode); -
branches/eam_branches/ohana.20170822/src/opihi/dvo/objectcoverage.c
r39457 r40212 203 203 if (catalog.secfilt[j*Nsecfilt+Nsec].Ncode < 2) { continue; } 204 204 205 invalid = ((catalog.secfilt[j*Nsecfilt + Nsec].M < 1.0) || (isnan(catalog.secfilt[j*Nsecfilt + Nsec].M)));205 invalid = ((catalog.secfilt[j*Nsecfilt + Nsec].MpsfChp < 1.0) || (isnan(catalog.secfilt[j*Nsecfilt + Nsec].MpsfChp))); 206 206 if (invalid) continue; 207 207 -
branches/eam_branches/ohana.20170822/src/opihi/dvo/paverage.c
r40156 r40212 125 125 while (average[i].R > Rmax) average[i].R -= 360.0; 126 126 127 mag = secfilt[i*Nsecfilt+Nsec].M ;127 mag = secfilt[i*Nsecfilt+Nsec].MpsfChp; 128 128 Zvec[Npts] = MIN (1.0, MAX (0.01, (mag - Mz) / Mr)); 129 129 if (LimExclude && (Zvec[Npts] > 0.99)) continue; -
branches/eam_branches/ohana.20170822/src/opihi/dvo/skycoverage.c
r39233 r40212 330 330 break; 331 331 case MIN_MCAL: 332 V[ys*Nx + xs] = MIN(V[ys*Nx + xs], image[i].Mcal );332 V[ys*Nx + xs] = MIN(V[ys*Nx + xs], image[i].McalPSF); 333 333 break; 334 334 case MAX_MCAL: 335 V[ys*Nx + xs] = MAX(V[ys*Nx + xs], image[i].Mcal );335 V[ys*Nx + xs] = MAX(V[ys*Nx + xs], image[i].McalPSF); 336 336 break; 337 337 case MIN_TIME: { -
branches/eam_branches/ohana.20170822/src/opihi/lib.shell/evaluate_stack.c
r40168 r40212 188 188 snprintf (line, 512, "syntax error: invalid operand for binary operation: %s or %s\n", stack[i-1].name, stack[i-2].name); 189 189 push_error (line); 190 if (strchr(stack[i-1].name, ':') || strchr(stack[i-2].name, ':')) { 191 snprintf (line, 512, "syntax error: invalid operand for binary operation: %s or %s\n(Note that the : in a trinary operation must be protected by spaces)\n", stack[i-1].name, stack[i-2].name); 192 push_error (line); 193 } 190 194 clear_stack (&tmp_stack); 191 195 return (FALSE); -
branches/eam_branches/ohana.20170822/src/photdbc/src/get_mags.c
r37045 r40212 20 20 Nlist = MAX (Nlist, catalog[0].average[i].Nm); 21 21 for (j = 0; j < Nsecfilt; j++) { 22 catalog[0].secfilt[i*Nsecfilt+j].M = NAN;23 catalog[0].secfilt[i*Nsecfilt+j].dM = NAN;24 catalog[0].secfilt[i*Nsecfilt+j].Mchisq = NAN;22 catalog[0].secfilt[i*Nsecfilt+j].MpsfChp = NAN; 23 catalog[0].secfilt[i*Nsecfilt+j].dMpsfChp = NAN; 24 catalog[0].secfilt[i*Nsecfilt+j].Mchisq = NAN; 25 25 } 26 26 } … … 52 52 if (N < 1) continue; 53 53 54 Mval = (Nsec == -1) ? &catalog[0].average[i].M : &catalog[0].secfilt[i*Nsecfilt+Nsec].M ;54 Mval = (Nsec == -1) ? &catalog[0].average[i].M : &catalog[0].secfilt[i*Nsecfilt+Nsec].MpsfChp; 55 55 *Mval = stats.mean; 56 Mval = (Nsec == -1) ? &catalog[0].average[i].dM : &catalog[0].secfilt[i*Nsecfilt+Nsec].dM ;56 Mval = (Nsec == -1) ? &catalog[0].average[i].dM : &catalog[0].secfilt[i*Nsecfilt+Nsec].dMpsfChp; 57 57 *Mval = stats.sigma; 58 58 Mval = (Nsec == -1) ? &catalog[0].average[i].Mchisq : &catalog[0].secfilt[i*Nsecfilt+Nsec].Mchisq; -
branches/eam_branches/ohana.20170822/src/photdbc/src/join_stars.c
r38441 r40212 87 87 88 88 // require base star to meet certain conditions: 89 if (isnan(secfilt[Ni*Nsecfilt + baseNsec].M )) {89 if (isnan(secfilt[Ni*Nsecfilt + baseNsec].MpsfChp)) { 90 90 i++; 91 91 continue; -
branches/eam_branches/ohana.20170822/src/photdbc/src/make_subcatalog.c
r39926 r40212 63 63 keep = FALSE; 64 64 for (j = 0; !keep && (j < Nsecfilt); j++) { 65 if (catalog[0].secfilt[Nsecfilt*i+j].dM < AVE_SIGMA_LIM) {65 if (catalog[0].secfilt[Nsecfilt*i+j].dMpsfChp < AVE_SIGMA_LIM) { 66 66 keep = TRUE; 67 67 } -
branches/eam_branches/ohana.20170822/src/relastro/include/relastro.h
r39926 r40212 215 215 unsigned int stop; 216 216 off_t myImage; 217 float Mcal; 217 float McalPSF; 218 float McalAPER; 218 219 float dMcal; 219 short Xm;220 float McalChiSq; 220 221 float secz; 221 222 char flags; -
branches/eam_branches/ohana.20170822/src/relastro/src/BrightCatalog.c
r39995 r40212 285 285 ALLOCATE (secfilt, SecFilt, Nrow); 286 286 for (i = 0; i < Nrow; i++) { 287 secfilt[i].M = M[i];288 secfilt[i].dM = dM[i];289 secfilt[i].Mchisq = Mchisq[i];290 secfilt[i].flags = flags[i];291 secfilt[i].Ncode = Ncode[i];292 secfilt[i].Nused = Nused[i];293 secfilt[i].Mmin = Mmin[i];294 secfilt[i].Mmax = Mmax[i];287 secfilt[i].MpsfChp = M[i]; 288 secfilt[i].dMpsfChp = dM[i]; 289 secfilt[i].Mchisq = Mchisq[i]; 290 secfilt[i].flags = flags[i]; 291 secfilt[i].Ncode = Ncode[i]; 292 secfilt[i].Nused = Nused[i]; 293 secfilt[i].Mmin = Mmin[i]; 294 secfilt[i].Mmax = Mmax[i]; 295 295 } 296 296 // fprintf (stderr, "loaded data for %lld secfilt\n", (long long) Nrow); … … 694 694 SecFilt *secfilt = catalog->secfilt; 695 695 for (i = 0; i < Nsec; i++) { 696 M [i] = secfilt[i].M ;697 dM [i] = secfilt[i].dM ;698 Mchisq[i] = secfilt[i].Mchisq ;699 flags [i] = secfilt[i].flags ;700 Ncode [i] = secfilt[i].Ncode ;701 Nused [i] = secfilt[i].Nused ;702 Mmin [i] = secfilt[i].Mmin ;703 Mmax [i] = secfilt[i].Mmax ;696 M [i] = secfilt[i].MpsfChp ; 697 dM [i] = secfilt[i].dMpsfChp; 698 Mchisq[i] = secfilt[i].Mchisq ; 699 flags [i] = secfilt[i].flags ; 700 Ncode [i] = secfilt[i].Ncode ; 701 Nused [i] = secfilt[i].Nused ; 702 Mmin [i] = secfilt[i].Mmin ; 703 Mmax [i] = secfilt[i].Mmax ; 704 704 } 705 705 -
branches/eam_branches/ohana.20170822/src/relastro/src/ImageOps.c
r39926 r40212 431 431 /**** dMcal vs airmass ****/ 432 432 for (i = 0; i < Nimage; i++) { 433 Mlist[i] = image[i].Mcal ;433 Mlist[i] = image[i].McalPSF; 434 434 dlist[i] = image[i].dMcal; 435 435 xlist[i] = image[i].secz; … … 819 819 820 820 if ((DCR_BLUE_NSEC_POS >= 0) && (DCR_BLUE_NSEC_NEG >= -1)) { 821 ref[i].ColorBlue = catalog[c].secfilt[n*Nsecfilt + DCR_BLUE_NSEC_POS].M - catalog[c].secfilt[n*Nsecfilt + DCR_BLUE_NSEC_NEG].M;821 ref[i].ColorBlue = catalog[c].secfilt[n*Nsecfilt + DCR_BLUE_NSEC_POS].MpsfChp - catalog[c].secfilt[n*Nsecfilt + DCR_BLUE_NSEC_NEG].MpsfChp; 822 822 } 823 823 if ((DCR_RED_NSEC_POS >= 0) && (DCR_RED_NSEC_NEG >= -1)) { 824 ref[i].ColorRed = catalog[c].secfilt[n*Nsecfilt + DCR_RED_NSEC_POS].M - catalog[c].secfilt[n*Nsecfilt + DCR_RED_NSEC_NEG].M;824 ref[i].ColorRed = catalog[c].secfilt[n*Nsecfilt + DCR_RED_NSEC_POS].MpsfChp - catalog[c].secfilt[n*Nsecfilt + DCR_RED_NSEC_NEG].MpsfChp; 825 825 } 826 826 -
branches/eam_branches/ohana.20170822/src/relastro/src/MosaicOps.c
r39457 r40212 97 97 98 98 /* a new mosaic, define ranges */ 99 mosaic[Nmosaic].start = start; 100 mosaic[Nmosaic].stop = stop; 101 mosaic[Nmosaic].Mcal = 0.0; 102 mosaic[Nmosaic].dMcal = 0.0; 103 mosaic[Nmosaic].Xm = 0.0; 104 mosaic[Nmosaic].flags = image[i].flags; 105 mosaic[Nmosaic].secz = image[i].secz; 106 mosaic[Nmosaic].coords = image[i].coords; 107 mosaic[Nmosaic].myImage = i; 99 mosaic[Nmosaic].start = start; 100 mosaic[Nmosaic].stop = stop; 101 mosaic[Nmosaic].McalPSF = 0.0; 102 mosaic[Nmosaic].McalAPER = 0.0; 103 mosaic[Nmosaic].dMcal = 0.0; 104 mosaic[Nmosaic].McalChiSq = 0.0; 105 mosaic[Nmosaic].flags = image[i].flags; 106 mosaic[Nmosaic].secz = image[i].secz; 107 mosaic[Nmosaic].coords = image[i].coords; 108 mosaic[Nmosaic].myImage = i; 108 109 109 110 // init the mosaic_own_images array data -
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; -
branches/eam_branches/ohana.20170822/src/uniphot/include/setphot.h
r39926 r40212 11 11 12 12 typedef struct { 13 float Mcal; 13 float McalPSF; 14 float McalAPER; 14 15 float dMcal; 15 16 unsigned int imageID; -
branches/eam_branches/ohana.20170822/src/uniphot/src/ImageSubset.c
r37043 r40212 56 56 char type[16]; 57 57 58 GET_COLUMN (Mcal, "MCAL", float); 59 GET_COLUMN (dMcal, "MCAL_ERR", float); 60 GET_COLUMN (imageID, "IMAGE_ID", int); 61 GET_COLUMN (map, "PHOTOM_MAP", int); 62 GET_COLUMN (flags, "FLAGS", int); 58 GET_COLUMN (McalPSF, "MCAL_PSF", float); 59 GET_COLUMN (McalAPER, "MCAL_APER", float); 60 GET_COLUMN (dMcal, "MCAL_ERR", float); 61 GET_COLUMN (imageID, "IMAGE_ID", int); 62 GET_COLUMN (map, "PHOTOM_MAP", int); 63 GET_COLUMN (flags, "FLAGS", int); 63 64 64 65 // XXX free the fits table data here … … 69 70 image[i].photom_map_id = map[i]; 70 71 image[i].flags = flags[i]; 71 image[i].Mcal = Mcal[i]; 72 image[i].McalPSF = McalPSF[i]; 73 image[i].McalAPER = McalAPER[i]; 72 74 image[i].dMcal = dMcal[i]; 73 75 } 74 76 fprintf (stderr, "loaded data for %lld images\n", (long long) Nrow); 75 77 76 free (Mcal); 78 free (McalPSF); 79 free (McalAPER); 77 80 free (dMcal); 78 81 free (imageID); … … 108 111 gfits_create_table (&theader, &ftable); 109 112 110 float *Mcal, *dMcal;111 unsigned int *imageID, *map, *flags;112 113 113 // create intermediate storage arrays 114 ALLOCATE (Mcal, float, Nimage); 115 ALLOCATE (dMcal, float, Nimage); 116 ALLOCATE (imageID, unsigned int, Nimage); 117 ALLOCATE (map, unsigned int, Nimage); 118 ALLOCATE (flags, unsigned int, Nimage); 114 ALLOCATE_PTR (McalPSF, float, Nimage); 115 ALLOCATE_PTR (McalAPER, float, Nimage); 116 ALLOCATE_PTR (dMcal, float, Nimage); 117 ALLOCATE_PTR (imageID, unsigned int, Nimage); 118 ALLOCATE_PTR (map, unsigned int, Nimage); 119 ALLOCATE_PTR (flags, unsigned int, Nimage); 119 120 120 121 // assign the storage arrays 121 122 for (i = 0; i < Nimage; i++) { 122 imageID[i] = image[i].imageID; 123 map[i] = image[i].photom_map_id; 124 flags[i] = image[i].flags; 125 Mcal[i] = image[i].Mcal; 126 dMcal[i] = image[i].dMcal; 123 imageID[i] = image[i].imageID; 124 map[i] = image[i].photom_map_id; 125 flags[i] = image[i].flags; 126 McalPSF[i] = image[i].McalPSF; 127 McalAPER[i] = image[i].McalAPER; 128 dMcal[i] = image[i].dMcal; 127 129 } 128 130 129 131 // add the columns to the output array 130 gfits_set_bintable_column (&theader, &ftable, "MCAL", Mcal, Nimage); 131 gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR", dMcal, Nimage); 132 gfits_set_bintable_column (&theader, &ftable, "IMAGE_ID", imageID, Nimage); 133 gfits_set_bintable_column (&theader, &ftable, "PHOTOM_MAP", map, Nimage); 134 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags, Nimage); 132 gfits_set_bintable_column (&theader, &ftable, "MCAL_PSF", McalPSF, Nimage); 133 gfits_set_bintable_column (&theader, &ftable, "MCAL_APER", McalAPER, Nimage); 134 gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR", dMcal, Nimage); 135 gfits_set_bintable_column (&theader, &ftable, "IMAGE_ID", imageID, Nimage); 136 gfits_set_bintable_column (&theader, &ftable, "PHOTOM_MAP", map, Nimage); 137 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags, Nimage); 135 138 136 free (Mcal); 139 free (McalPSF); 140 free (McalAPER); 137 141 free (dMcal); 138 142 free (imageID); … … 174 178 image[i].photom_map_id = subset[i].photom_map_id; 175 179 image[i].flags = subset[i].flags ; 176 image[i].Mcal = subset[i].Mcal ; 180 image[i].McalPSF = subset[i].McalPSF ; 181 image[i].McalAPER = subset[i].McalAPER ; 177 182 image[i].dMcal = subset[i].dMcal ; 178 183 } -
branches/eam_branches/ohana.20170822/src/uniphot/src/dumpresult.c
r31160 r40212 2 2 3 3 void dumpresult () { 4 short Mcal, Mgrp, Mset;4 float Mcal, Mgrp, Mset; 5 5 FILE *f; 6 6 char outfile[64]; … … 13 13 if (sgroup[i].image[j][0].code & IMAGE_BAD) continue; 14 14 tgrp = (Group *) sgroup[i].imlink[j][0].tgroup; 15 Mcal = sgroup[i].image[j][0].Mcal ;15 Mcal = sgroup[i].image[j][0].McalPSF; 16 16 Mset = sgroup[i].M; 17 17 Mgrp = tgrp[0].M; -
branches/eam_branches/ohana.20170822/src/uniphot/src/fit_groups.c
r31160 r40212 18 18 if (tgroup[i].image[j][0].flags & IMAGE_BAD) continue; 19 19 sgroup = (Group *) tgroup[i].imlink[j][0].sgroup; 20 Mcal = tgroup[i].image[j][0].Mcal ;20 Mcal = tgroup[i].image[j][0].McalPSF; 21 21 Mgrp = sgroup[0].M; 22 22 mlist[Nlist] = (Mcal - Mgrp); … … 58 58 if (sgroup[i].image[j][0].flags & IMAGE_BAD) continue; 59 59 tgroup = (Group *) sgroup[i].imlink[j][0].tgroup; 60 Mcal = sgroup[i].image[j][0].Mcal ;60 Mcal = sgroup[i].image[j][0].McalPSF; 61 61 Mgrp = tgroup[0].M; 62 62 mlist[Nlist] = (Mcal - Mgrp); -
branches/eam_branches/ohana.20170822/src/uniphot/src/match_zpts_to_images.c
r37807 r40212 41 41 if (RESET) { 42 42 for (i = 0; i < Nimage; i++) { 43 image[i].Mcal = 0.0; 44 image[i].dMcal = NAN; 45 image[i].flags &= ~ID_IMAGE_PHOTOM_NOCAL; // clear the NOCAL flag 43 image[i].McalPSF = 0.0; 44 image[i].McalAPER = 0.0; 45 image[i].dMcal = NAN; 46 image[i].flags &= ~ID_IMAGE_PHOTOM_NOCAL; // clear the NOCAL flag 46 47 if (UBERCAL) { 47 48 image[i].flags &= ~ID_IMAGE_PHOTOM_UBERCAL; // clear the UBERCAL flag … … 107 108 // UBERCAL includes 2.5log(exptime) + K*airmass in the zero point 108 109 if (UBERCAL) { 109 image[Ni].Mcal = SCALE*code[0].C - zpts[Nz].zpt + 2.5*log10(image[Ni].exptime) + code[0].K*(image[Ni].secz - 1.000); 110 myAssert (isfinite(image[Ni].Mcal), "oops, ubercal made a nan image"); 110 image[Ni].McalPSF = SCALE*code[0].C - zpts[Nz].zpt + 2.5*log10(image[Ni].exptime) + code[0].K*(image[Ni].secz - 1.000); 111 image[Ni].McalAPER = SCALE*code[0].C - zpts[Nz].zpt + 2.5*log10(image[Ni].exptime) + code[0].K*(image[Ni].secz - 1.000); 112 myAssert (isfinite(image[Ni].McalPSF), "oops, ubercal made a nan image"); 111 113 } else { 112 image[Ni].Mcal = SCALE*code[0].C - zpts[Nz].zpt; 114 image[Ni].McalPSF = SCALE*code[0].C - zpts[Nz].zpt; 115 image[Ni].McalAPER = SCALE*code[0].C - zpts[Nz].zpt; 113 116 } 114 117 … … 116 119 float offset = apply_zpt_offset (code[0].equiv); 117 120 assert (isfinite(offset)); 118 image[Ni].Mcal += offset; 121 image[Ni].McalPSF += offset; 122 image[Ni].McalAPER += offset; 119 123 120 124 image[Ni].dMcal = zpts[Nz].zpt_err; -
branches/eam_branches/ohana.20170822/src/uniphot/src/update_catalog_setastrom.c
r39288 r40212 153 153 case 101: 154 154 case 102: { 155 float gmag = secfilt[Nsec_g].M ;156 float imag = secfilt[Nsec_i].M ;155 float gmag = secfilt[Nsec_g].MpsfChp; 156 float imag = secfilt[Nsec_i].MpsfChp; 157 157 dColor = average->refColorBlue - (gmag - imag); 158 158 break; … … 160 160 case 103: 161 161 case 104: { 162 float zmag = secfilt[Nsec_z].M ;163 float ymag = secfilt[Nsec_y].M ;162 float zmag = secfilt[Nsec_z].MpsfChp; 163 float ymag = secfilt[Nsec_y].MpsfChp; 164 164 dColor = average->refColorRed - (zmag - ymag); 165 165 break; -
branches/eam_branches/ohana.20170822/src/uniphot/src/update_catalog_setphot.c
r39926 r40212 39 39 if (id < 0) continue; 40 40 41 float Mcal = image[id].Mcal;41 float Mcal = image[id].McalPSF; 42 42 float dMcal = image[id].dMcal; 43 43 float Mflat = 0.0; -
branches/eam_branches/ohana.20170822/src/uniphot/src/update_catalog_uniphot.c
r33654 r40212 14 14 for (i = 0; i < catalog[0].Naverage; i++) { 15 15 16 if (!isnan(catalog[0].secfilt[i*Nsecfilt+Nsec].M )) {17 catalog[0].secfilt[i*Nsecfilt+Nsec].M += sgroup[0].M;16 if (!isnan(catalog[0].secfilt[i*Nsecfilt+Nsec].MpsfChp)) { 17 catalog[0].secfilt[i*Nsecfilt+Nsec].MpsfChp += sgroup[0].M; 18 18 } 19 19 -
branches/eam_branches/ohana.20170822/src/uniphot/src/update_dvo_uniphot.c
r38986 r40212 37 37 for (i = 0; i < Nsgroup; i++) { 38 38 for (j = 0; j < sgroup[i].Nimage; j++) { 39 sgroup[i].image[j][0].Mcal -= sgroup[i].M; 39 sgroup[i].image[j][0].McalPSF -= sgroup[i].M; 40 sgroup[i].image[j][0].McalAPER -= sgroup[i].M; 40 41 } 41 42 }
Note:
See TracChangeset
for help on using the changeset viewer.
