Changeset 36912
- Timestamp:
- Jun 19, 2014, 2:41:50 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140610/Ohana/src
- Files:
-
- 4 added
- 12 edited
-
addstar/src/FilterStars.c (modified) (1 diff)
-
addstar/src/MatchHeaders.c (modified) (1 diff)
-
addstar/src/ReadStarsFITS.c (modified) (6 diffs)
-
addstar/src/mkcmf.c (modified) (2 diffs)
-
addstar/test/simple.dvo (modified) (6 diffs)
-
libautocode/Makefile.Targets (modified) (2 diffs)
-
libautocode/def/cmf-ps1-dv4.d (added)
-
libautocode/def/cmf-ps1-sv3.d (added)
-
libautocode/def/cmf-ps1-v5.d (modified) (2 diffs)
-
libdvo/Makefile (modified) (2 diffs)
-
libdvo/include/cmf-ps1-v5.h (added)
-
libdvo/include/dvo.h (modified) (3 diffs)
-
libdvo/src/cmf-ps1-dv3.c (modified) (1 diff)
-
libdvo/src/cmf-ps1-v5.c (added)
-
libdvo/src/dbExtractMeasures.c (modified) (2 diffs)
-
libdvo/src/dvo_photcode_ops.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/FilterStars.c
r34260 r36912 99 99 stars[N].measure.dFluxKron /= image[0].exptime; 100 100 } 101 if (!isnan(stars[N].measure.FluxAp)) { 102 stars[N].measure.FluxAp /= image[0].exptime; 103 } 104 if (!isnan(stars[N].measure.dFluxAp)) { 105 stars[N].measure.dFluxAp /= image[0].exptime; 106 } 101 107 102 108 // the external ID is supplied, but do we trust it? -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/MatchHeaders.c
r35416 r36912 59 59 if (!strcmp (exttype, "PS1_V3")) goto keep; 60 60 if (!strcmp (exttype, "PS1_V4")) goto keep; 61 if (!strcmp (exttype, "PS1_V5")) goto keep; 61 62 if (!strcmp (exttype, "PS1_SV1")) goto keep; 62 63 if (!strcmp (exttype, "PS1_SV2")) goto keep; 63 if (!strcmp (exttype, "PS1_DV3")) { 64 if (!strcmp (exttype, "PS1_SV3")) goto keep; 65 if (!strcmp (exttype, "PS1_DV3")) goto keep; 66 if (!strcmp (exttype, "PS1_DV4")) { 64 67 goto keep; 65 68 } -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/ReadStarsFITS.c
r35416 r36912 12 12 Stars *Convert_PS1_V3 PROTO((FTable *table, unsigned int *nstars)); 13 13 Stars *Convert_PS1_V4 PROTO((FTable *table, unsigned int *nstars)); 14 Stars *Convert_PS1_V5 PROTO((FTable *table, unsigned int *nstars)); 14 15 Stars *Convert_PS1_SV1 PROTO((FTable *table, unsigned int *nstars)); 15 16 Stars *Convert_PS1_SV1_Alt PROTO((FTable *table, unsigned int *nstars)); 16 17 Stars *Convert_PS1_SV2 PROTO((FTable *table, unsigned int *nstars)); 18 Stars *Convert_PS1_SV3 PROTO((FTable *table, unsigned int *nstars)); 17 19 Stars *Convert_PS1_DV3 PROTO((FTable *table, unsigned int *nstars)); 20 Stars *Convert_PS1_DV4 PROTO((FTable *table, unsigned int *nstars)); 18 21 19 22 // given a file with the pointer at the start of the table block and the … … 73 76 stars = Convert_PS1_V4 (&table, &Nstars); 74 77 } 78 if (!strcmp (type, "PS1_V5")) { 79 stars = Convert_PS1_V5 (&table, &Nstars); 80 } 75 81 if (!strcmp (type, "PS1_SV1")) { 76 82 stars = Convert_PS1_SV1 (&table, &Nstars); … … 79 85 stars = Convert_PS1_SV2 (&table, &Nstars); 80 86 } 87 if (!strcmp (type, "PS1_SV3")) { 88 stars = Convert_PS1_SV3 (&table, &Nstars); 89 } 81 90 if (!strcmp (type, "PS1_DV3")) { 82 91 stars = Convert_PS1_DV3 (&table, &Nstars); 92 } 93 if (!strcmp (type, "PS1_DV4")) { 94 stars = Convert_PS1_DV4 (&table, &Nstars); 83 95 } 84 96 if (stars == NULL) { … … 724 736 } 725 737 738 Stars *Convert_PS1_V5 (FTable *table, unsigned int *nstars) { 739 740 off_t Nstars; 741 unsigned int i; 742 double ZeroPt; 743 Stars *stars; 744 CMF_PS1_V5 *ps1data; 745 746 ps1data = gfits_table_get_CMF_PS1_V5 (table, &Nstars, NULL); 747 if (!ps1data) { 748 fprintf (stderr, "skipping inconsistent entry\n"); 749 return (NULL); 750 } 751 ZeroPt = GetZeroPoint(); 752 753 ALLOCATE (stars, Stars, Nstars); 754 for (i = 0; i < Nstars; i++) { 755 InitStar (&stars[i]); 756 stars[i].measure.Xccd = ps1data[i].X; 757 stars[i].measure.Yccd = ps1data[i].Y; 758 stars[i].measure.dXccd = ToShortPixels(ps1data[i].dX); 759 stars[i].measure.dYccd = ToShortPixels(ps1data[i].dY); 760 761 stars[i].measure.posangle = ToShortDegrees(ps1data[i].posangle); 762 stars[i].measure.pltscale = ps1data[i].pltscale; 763 764 if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) { 765 stars[i].measure.M = NAN; 766 } else { 767 stars[i].measure.M = ps1data[i].M + ZeroPt; 768 } 769 stars[i].measure.dM = ps1data[i].dM; 770 stars[i].measure.dMcal = ps1data[i].dMcal; 771 stars[i].measure.Map = ps1data[i].Map + ZeroPt; 772 stars[i].measure.dMap = (ps1data[i].apFlux > 0.0) ? fabs(ps1data[i].apFluxErr / ps1data[i].apFlux) : NAN; 773 774 stars[i].measure.Mkron = (ps1data[i].kronFlux > 0.0) ? -2.5*log10(ps1data[i].kronFlux) + ZeroPt : NAN; 775 stars[i].measure.dMkron = (ps1data[i].kronFlux > 0.0) ? ps1data[i].kronFluxErr / ps1data[i].kronFlux : NAN; 776 777 // instrumental fluxes: these fluxes are converted from counts to counts/sec in 778 // FilterStars.c 779 stars[i].measure.FluxPSF = ps1data[i].Flux; 780 stars[i].measure.dFluxPSF = ps1data[i].dFlux; 781 stars[i].measure.FluxKron = ps1data[i].kronFlux; 782 stars[i].measure.dFluxKron = ps1data[i].kronFluxErr; 783 stars[i].measure.FluxAp = ps1data[i].apFlux; 784 stars[i].measure.dFluxAp = ps1data[i].apFluxErr; 785 786 stars[i].measure.Sky = ps1data[i].sky; 787 stars[i].measure.dSky = ps1data[i].dSky; 788 789 stars[i].measure.psfChisq = ps1data[i].psfChisq; 790 stars[i].measure.psfQF = ps1data[i].psfQF; 791 stars[i].measure.psfQFperf = ps1data[i].psfQFperf; 792 793 stars[i].measure.psfNdof = ps1data[i].psfNdof; 794 stars[i].measure.psfNpix = ps1data[i].psfNpix; 795 stars[i].measure.crNsigma = ps1data[i].crNsigma; 796 stars[i].measure.extNsigma = ps1data[i].extNsigma; 797 798 stars[i].measure.FWx = ToShortPixels(ps1data[i].fx); 799 stars[i].measure.FWy = ToShortPixels(ps1data[i].fy); 800 stars[i].measure.theta = ToShortDegrees(ps1data[i].df); 801 802 stars[i].measure.Mxx = ToShortPixels(ps1data[i].Mxx); 803 stars[i].measure.Mxy = ToShortPixels(ps1data[i].Mxy); 804 stars[i].measure.Myy = ToShortPixels(ps1data[i].Myy); 805 806 stars[i].measure.photFlags = ps1data[i].flags; 807 808 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 809 stars[i].measure.detID = ps1data[i].detID; 810 811 // the Average fields and the following Measure fields are set in FilterStars after 812 // the image metadata is in hand: dR, dD, Mcal, dt, airmass, az, t, imageID, extID. 813 814 // averef is set in find_matches 815 816 // dbFlags is zero on ingest. 817 818 // the following fields are currently not being set anywhere: t_msec 819 } 820 *nstars = Nstars; 821 return (stars); 822 } 823 726 824 Stars *Convert_PS1_SV1 (FTable *table, unsigned int *nstars) { 727 825 … … 901 999 } 902 1000 ZeroPt = GetZeroPoint(); 1001 1002 ALLOCATE (stars, Stars, Nstars); 1003 for (i = 0; i < Nstars; i++) { 1004 InitStar (&stars[i]); 1005 stars[i].measure.Xccd = ps1data[i].X; 1006 stars[i].measure.Yccd = ps1data[i].Y; 1007 stars[i].measure.dXccd = ToShortPixels(ps1data[i].dX); 1008 stars[i].measure.dYccd = ToShortPixels(ps1data[i].dY); 1009 1010 stars[i].measure.posangle = ToShortDegrees(ps1data[i].posangle); 1011 stars[i].measure.pltscale = ps1data[i].pltscale; 1012 1013 if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) { 1014 stars[i].measure.M = NAN; 1015 } else { 1016 stars[i].measure.M = ps1data[i].M + ZeroPt; 1017 } 1018 stars[i].measure.dM = ps1data[i].dM; 1019 stars[i].measure.dMcal = ps1data[i].dMcal; 1020 stars[i].measure.Map = ps1data[i].Map + ZeroPt; 1021 1022 stars[i].measure.Mkron = (ps1data[i].kronFlux > 0.0) ? -2.5*log10(ps1data[i].kronFlux) + ZeroPt : NAN; 1023 stars[i].measure.dMkron = (ps1data[i].kronFlux > 0.0) ? ps1data[i].kronFluxErr / ps1data[i].kronFlux : NAN; 1024 1025 // these fluxes are converted from counts to counts/sec in FilterStars.c 1026 stars[i].measure.FluxPSF = ps1data[i].Flux; 1027 stars[i].measure.dFluxPSF = ps1data[i].dFlux; 1028 stars[i].measure.FluxKron = ps1data[i].kronFlux; 1029 stars[i].measure.dFluxKron = ps1data[i].kronFluxErr; 1030 1031 stars[i].measure.Sky = ps1data[i].sky; 1032 stars[i].measure.dSky = ps1data[i].dSky; 1033 1034 stars[i].measure.psfChisq = ps1data[i].psfChisq; 1035 stars[i].measure.psfQF = ps1data[i].psfQF; 1036 stars[i].measure.psfQFperf = ps1data[i].psfQFperf; 1037 1038 stars[i].measure.psfNdof = ps1data[i].psfNdof; 1039 stars[i].measure.psfNpix = ps1data[i].psfNpix; 1040 stars[i].measure.crNsigma = ps1data[i].crNsigma; 1041 stars[i].measure.extNsigma = ps1data[i].extNsigma; 1042 1043 stars[i].measure.FWx = ToShortPixels(ps1data[i].fx); 1044 stars[i].measure.FWy = ToShortPixels(ps1data[i].fy); 1045 stars[i].measure.theta = ToShortDegrees(ps1data[i].df); 1046 1047 stars[i].measure.Mxx = ToShortPixels(ps1data[i].Mxx); 1048 stars[i].measure.Mxy = ToShortPixels(ps1data[i].Mxy); 1049 stars[i].measure.Myy = ToShortPixels(ps1data[i].Myy); 1050 1051 stars[i].measure.photFlags = ps1data[i].flags; 1052 1053 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 1054 stars[i].measure.detID = ps1data[i].detID; 1055 1056 // the Average fields and the following Measure fields are set in FilterStars after 1057 // the image metadata is in hand: dR, dD, Mcal, dt, airmass, az, t, imageID, extID, 1058 // averef is set in find_matches, dbFlags is zero on ingest. 1059 1060 // the following fields are currently not being set anywhere: t_msec 1061 } 1062 *nstars = Nstars; 1063 return (stars); 1064 } 1065 1066 Stars *Convert_PS1_SV3 (FTable *table, unsigned int *nstars) { 1067 1068 off_t Nstars; 1069 unsigned int i; 1070 double ZeroPt; 1071 Stars *stars; 1072 CMF_PS1_SV3 *ps1data; 1073 1074 ps1data = gfits_table_get_CMF_PS1_SV3 (table, &Nstars, NULL); 1075 if (!ps1data) { 1076 fprintf (stderr, "skipping inconsistent entry\n"); 1077 return (NULL); 1078 } 1079 ZeroPt = GetZeroPoint(); 1080 1081 fprintf (stderr, "WARNING: Convert_PS1_SV3 not yet updated to match real format\n"); 903 1082 904 1083 ALLOCATE (stars, Stars, Nstars); … … 1047 1226 } 1048 1227 1049 1050 1228 Stars *Convert_PS1_DV4 (FTable *table, unsigned int *nstars) { 1229 1230 off_t Nstars; 1231 unsigned int i; 1232 double ZeroPt; 1233 Stars *stars; 1234 CMF_PS1_DV4 *ps1data; 1235 1236 ps1data = gfits_table_get_CMF_PS1_DV4 (table, &Nstars, NULL); 1237 if (!ps1data) { 1238 fprintf (stderr, "skipping inconsistent entry\n"); 1239 return (NULL); 1240 } 1241 ZeroPt = GetZeroPoint(); 1242 1243 fprintf (stderr, "WARNING: Convert_PS1_DV4 not yet updated to match real format\n"); 1244 1245 ALLOCATE (stars, Stars, Nstars); 1246 for (i = 0; i < Nstars; i++) { 1247 InitStar (&stars[i]); 1248 stars[i].measure.Xccd = ps1data[i].X; 1249 stars[i].measure.Yccd = ps1data[i].Y; 1250 stars[i].measure.dXccd = ToShortPixels(ps1data[i].dX); 1251 stars[i].measure.dYccd = ToShortPixels(ps1data[i].dY); 1252 1253 stars[i].measure.posangle = ToShortDegrees(ps1data[i].posangle); 1254 stars[i].measure.pltscale = ps1data[i].pltscale; 1255 1256 if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) { 1257 stars[i].measure.M = NAN; 1258 } else { 1259 stars[i].measure.M = ps1data[i].M + ZeroPt; 1260 } 1261 stars[i].measure.dM = ps1data[i].dM; 1262 stars[i].measure.dMcal = ps1data[i].dMcal; 1263 stars[i].measure.Map = ps1data[i].Map + ZeroPt; 1264 1265 stars[i].measure.Mkron = (ps1data[i].kronFlux > 0.0) ? -2.5*log10(ps1data[i].kronFlux) + ZeroPt : NAN; 1266 stars[i].measure.dMkron = (ps1data[i].kronFlux > 0.0) ? ps1data[i].kronFluxErr / ps1data[i].kronFlux : NAN; 1267 1268 // these fluxes are converted from counts to counts/sec in FilterStars.c 1269 stars[i].measure.FluxPSF = ps1data[i].Flux; 1270 stars[i].measure.dFluxPSF = ps1data[i].dFlux; 1271 stars[i].measure.FluxKron = ps1data[i].kronFlux; 1272 stars[i].measure.dFluxKron = ps1data[i].kronFluxErr; 1273 1274 stars[i].measure.Sky = ps1data[i].sky; 1275 stars[i].measure.dSky = ps1data[i].dSky; 1276 1277 stars[i].measure.psfChisq = ps1data[i].psfChisq; 1278 stars[i].measure.psfQF = ps1data[i].psfQF; 1279 stars[i].measure.psfQFperf = ps1data[i].psfQFperf; 1280 stars[i].measure.psfNdof = ps1data[i].psfNdof; 1281 stars[i].measure.psfNpix = ps1data[i].psfNpix; 1282 stars[i].measure.crNsigma = ps1data[i].crNsigma; 1283 stars[i].measure.extNsigma = ps1data[i].extNsigma; 1284 1285 stars[i].measure.FWx = ToShortPixels(ps1data[i].fx); 1286 stars[i].measure.FWy = ToShortPixels(ps1data[i].fy); 1287 stars[i].measure.theta = ToShortDegrees(ps1data[i].df); 1288 1289 stars[i].measure.Mxx = ToShortPixels(ps1data[i].Mxx); 1290 stars[i].measure.Mxy = ToShortPixels(ps1data[i].Mxy); 1291 stars[i].measure.Myy = ToShortPixels(ps1data[i].Myy); 1292 1293 stars[i].measure.photFlags = ps1data[i].flags; 1294 1295 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 1296 stars[i].measure.detID = ps1data[i].detID; 1297 1298 // the Average fields and the following Measure fields are set in FilterStars after 1299 // the image metadata is in hand: dR, dD, Mcal, dt, airmass, az, t, imageID, extID. 1300 1301 // averef is set in find_matches 1302 1303 // dbFlags is zero on ingest. 1304 1305 // the following fields are currently not being set anywhere: t_msec 1306 } 1307 *nstars = Nstars; 1308 return (stars); 1309 } 1310 1311 1312 -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/mkcmf.c
r36906 r36912 811 811 stars[i].dMcal = 0.05; 812 812 813 stars[i].dMcal = 0.05;814 815 813 XY_to_RD (&stars[i].RA, &stars[i].DEC, X[i], Y[i], &coords); 816 814 stars[i].apNpix = 3.14*8.0*8.0; … … 870 868 stars[i].X += FX * fSN * rnd_gauss(0.0, 1.0); 871 869 stars[i].Y += FY * fSN * rnd_gauss(0.0, 1.0); 872 stars[i].M += fSN*rnd_gauss(0.0, 1.0); 870 float Moff = fSN*rnd_gauss(0.0, 1.0); 871 stars[i].M += Moff; 872 stars[i].Map += Moff; 873 stars[i].MapRaw += Moff; 874 stars[i].Mcalib += Moff; 873 875 } 874 876 } -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/test/simple.dvo
r36911 r36912 34 34 end 35 35 36 if (not($?NO_NOISE)) 37 $NO_NOISE = "" 38 end 39 36 40 # create a populated catdir with a single cmf -- test each field 37 41 macro test.fields … … 50 54 51 55 mkinput 52 echo mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC -type $1 53 exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC -type $1 56 echo mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC -type $1 $NO_NOISE 57 exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC -type $1 $NO_NOISE 54 58 if ($TAP_VERBOSE) 55 59 echo exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass 56 60 exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass 57 61 else 62 echo addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass 58 63 exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass >& tmp.log 59 64 end … … 113 118 114 119 # some fields require arithmetic manipulations 115 if ("$name:0" == "KRON_FLUX") 116 set v1 = -2.5*log(v1) 117 end 118 if ("$name:0" == "KRON_FLUX_ERR") 119 set v1 = KRON_FLUX_ERR / KRON_FLUX 120 ## if ("$name:0" == "KRON_FLUX") 121 ## set v1 = -2.5*log(v1) 122 ## end 123 ## if ("$name:0" == "KRON_FLUX_ERR") 124 ## set v1 = KRON_FLUX_ERR / KRON_FLUX 125 ## end 126 if (("$name:0" == "X_PSF_SIG") || ("$name:0" == "Y_PSF_SIG")) 127 set v1 = int(100*(v1)) 128 set v2 = int(100*(v2 + 0.0001)) 129 end 130 if ("$name:0" == "POSANGLE") 131 set v1 = int((0xffff/360.0)*(v1)) 132 set v2 = int((0xffff/360.0)*(v2 + 0.0028)) 120 133 end 121 134 … … 335 348 Y_PSF_SIG : yccd:err 336 349 POSANGLE : posangle 337 PLTSCALE : pl tscale350 PLTSCALE : platescale 338 351 PSF_INST_MAG : mag:inst 339 352 PSF_INST_MAG_SIG : mag:err … … 345 358 AP_FLUX : flux:aper:inst 346 359 AP_FLUX_SIG : flux:aper:inst:err 347 CAL_PSF_MAG : mag: rel348 CAL_PSF_MAG_SIG : mag: rel:err360 CAL_PSF_MAG : mag:cal 361 CAL_PSF_MAG_SIG : mag:cal:err 349 362 RA_PSF : ra 350 363 DEC_PSF : dec … … 386 399 N_FRAMES : SKIP # not ingested into DVO 387 400 end 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 -
branches/eam_branches/ipp-20140610/Ohana/src/libautocode/Makefile.Targets
r36899 r36912 80 80 $(ASRC)/cmf-ps1-v3.$(ARCH).o \ 81 81 $(ASRC)/cmf-ps1-v4.$(ARCH).o \ 82 $(ASRC)/cmf-ps1-v5.$(ARCH).o \83 82 $(ASRC)/cmf-ps1-sv1.$(ARCH).o \ 84 83 $(ASRC)/cmf-ps1-sv2.$(ARCH).o \ 84 $(ASRC)/cmf-ps1-sv3.$(ARCH).o \ 85 $(ASRC)/cmf-ps1-dv4.$(ARCH).o \ 85 86 $(ASRC)/cmf-smpdata.$(ARCH).o \ 86 87 $(ASRC)/getstar-ps1-dev-0.$(ARCH).o \ … … 176 177 $(AINC)/cmf-ps1-v3.h \ 177 178 $(AINC)/cmf-ps1-v4.h \ 178 $(AINC)/cmf-ps1-v5.h \179 179 $(AINC)/cmf-ps1-sv1.h \ 180 180 $(AINC)/cmf-ps1-sv2.h \ 181 $(AINC)/cmf-ps1-sv3.h \ 182 $(AINC)/cmf-ps1-dv4.h \ 181 183 $(AINC)/cmf-smpdata.h \ 182 184 $(AINC)/getstar-ps1-dev-0.h \ -
branches/eam_branches/ipp-20140610/Ohana/src/libautocode/def/cmf-ps1-v5.d
r36899 r36912 22 22 FIELD apFlux, AP_FLUX, float, aperture flux, counts 23 23 FIELD apFluxErr, AP_FLUX_SIG, float, error on ap flux, counts 24 FIELD apNpix, AP_NPIX, int, pixels used by aper, pixels 24 25 FIELD Mcalib, CAL_PSF_MAG, float, calibrated psf mag, mags 25 26 FIELD dMcal, CAL_PSF_MAG_SIG, float, zero point scatter, mags 27 28 # this field is in the wrong order (is between DEC and sky in cmf, but breaks byte boundary). 29 # I need to move these bytes around on read (fix PS1_V5?) 30 FIELD Mpeak, PEAK_FLUX_AS_MAG, float, peak flux as a mag, mags 26 31 27 32 # NOTE: RA & DEC (both double) need to be on an 8-byte boundary... … … 29 34 FIELD DEC, DEC_PSF, double, PSF DEC coord, degrees 30 35 31 # this field is in the wrong order (between apFluxErr and Mcalib in cmf, but breaks byte boundary).32 # I need to move these bytes around on read (fix PS1_V5?)33 FIELD apNpix, AP_NPIX, int, pixels used by aper, pixels34 35 FIELD Mpeak, PEAK_FLUX_AS_MAG, float, peak flux as a mag, mags36 36 FIELD sky, SKY, float, sky flux, cnts/sec 37 37 FIELD dSky, SKY_SIGMA, float, sky flux error, cnts/sec -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/Makefile
r36898 r36912 38 38 $(DESTINC)/ps1_v5_defs.h \ 39 39 $(DESTINC)/ps1_ref_defs.h \ 40 $(DESTINC)/cmf-ps1-dv3.h 40 $(DESTINC)/cmf-ps1-dv3.h \ 41 $(DESTINC)/cmf-ps1-v5.h 41 42 42 43 INCS = $(DEFS) $(DESTINC)/dvo.h $(DESTINC)/autocode.h $(DESTINC)/dvo_util.h $(DESTINC)/dvodb.h $(DESTINC)/libdvo_astro.h $(DESTINC)/convert.h $(DESTINC)/get_graphdata.h … … 88 89 $(SRC)/cmf-ps1-sv1-alt.$(ARCH).o \ 89 90 $(SRC)/cmf-ps1-dv3.$(ARCH).o \ 91 $(SRC)/cmf-ps1-v5.$(ARCH).o \ 90 92 $(SRC)/dvo_util.$(ARCH).o \ 91 93 $(SRC)/dbBooleanCond.$(ARCH).o \ -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/include/dvo.h
r36911 r36912 335 335 // another special case : does not match byte-boundaries 336 336 # include "cmf-ps1-dv3.h" 337 # include "cmf-ps1-v5.h" 337 338 338 339 typedef struct { … … 668 669 float PhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code, dvoMagClassType class); 669 670 float PhotErr (Measure *measure, dvoMagClassType class); 671 float PhotCalErr (Measure *measure, dvoMagClassType class); 670 672 671 673 float PhotAve (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source); … … 690 692 float PhotFluxAve (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source); 691 693 float PhotFluxRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure, dvoMagClassType class, dvoMagSourceType source); 694 695 float PhotFluxInstErr (Measure *measure, dvoMagClassType class); 696 float PhotFluxCatErr (Measure *measure, dvoMagClassType class); 692 697 693 698 float PhotXm (PhotCode *code, Average *average, SecFilt *secfilt); -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/cmf-ps1-dv3.c
r35416 r36912 2 2 3 3 /*** note : this file is derived from the autocode version, but is modified because 4 the forma does not match with structure byte boundaries ***/4 the format does not match with structure byte boundaries ***/ 5 5 6 6 /* if we are not correctly including the ohana headers, this will fail */ -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dbExtractMeasures.c
r36911 r36912 177 177 case MAG_LEVEL_SYS: 178 178 case MAG_LEVEL_REL: 179 value.Flt = PhotErr (measure, field->magClass); 180 break; 179 181 case MAG_LEVEL_CAL: 180 value.Flt = Phot Err (measure, field->magClass);182 value.Flt = PhotCalErr (measure, field->magClass); 181 183 break; 182 184 case MAG_LEVEL_AVE: … … 220 222 switch (field->magLevel) { 221 223 case MAG_LEVEL_INST: 224 value.Flt = PhotFluxInstErr (measure, field->magClass); 225 break; 222 226 case MAG_LEVEL_CAT: 227 value.Flt = PhotFluxCatErr (measure, field->magClass); 228 break; 223 229 case MAG_LEVEL_SYS: 224 230 case MAG_LEVEL_REL: -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_photcode_ops.c
r36911 r36912 549 549 } 550 550 551 float PhotCalErr (Measure *measure, dvoMagClassType class) { 552 553 float dMcal = measure[0].dMcal; 554 return (dMcal); 555 } 556 551 557 float PhotAveErr (PhotCode *code, Average *average, SecFilt *secfilt, dvoMagClassType class, dvoMagSourceType source) { 552 558 … … 1113 1119 float Foff = MagToFlux(Mcol); 1114 1120 return (Fave * Foff); 1121 } 1122 1123 float PhotFluxInstErr (Measure *measure, dvoMagClassType class) { 1124 1125 float Moff = - measure[0].dt - ZERO_POINT; 1126 1127 // use dFlux if we can, but use dMag if we must: 1128 // dFlux = Flux * dMag 1129 1130 float dFinst = NAN; 1131 switch (class) { 1132 case MAG_CLASS_PSF: 1133 if (isnan (measure[0].dFluxPSF)) { 1134 float Finst = MagToFlux(measure[0].M + Moff); 1135 dFinst = measure[0].dM * Finst; 1136 } else { 1137 dFinst = measure[0].dFluxPSF; 1138 } 1139 break; 1140 case MAG_CLASS_KRON: 1141 if (isnan (measure[0].dFluxKron)) { 1142 float Finst = MagToFlux(measure[0].Mkron + Moff); 1143 dFinst = measure[0].dMkron * Finst; 1144 } else { 1145 dFinst = measure[0].dFluxKron; 1146 } 1147 break; 1148 case MAG_CLASS_APER: 1149 if (isnan (measure[0].dFluxAp)) { 1150 float Finst = MagToFlux(measure[0].Map + Moff); 1151 dFinst = measure[0].dMap * Finst; 1152 } else { 1153 dFinst = measure[0].dFluxAp; 1154 } 1155 break; 1156 default: 1157 break; 1158 } 1159 return (dFinst); 1160 } 1161 1162 float PhotFluxCatErr (Measure *measure, dvoMagClassType class) { 1163 1164 int Np = photcodes[0].hashcode[measure[0].photcode]; 1165 if (Np == -1) return (NAN); 1166 PhotCode *code = &photcodes[0].code[Np]; 1167 1168 // measure.M has the static ZERO_POINT (25.0) applied, but not measure.Flux 1169 float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C; 1170 float Moff = Mcal - ZERO_POINT; 1171 float Foff = MagToFlux(Mcal); 1172 1173 // use dFlux if we can, but use dMag if we must: 1174 // dFlux = Flux * dMag 1175 1176 float dFcat = NAN; 1177 switch (class) { 1178 case MAG_CLASS_PSF: 1179 if (isnan (measure[0].dFluxPSF)) { 1180 float Finst = MagToFlux(measure[0].M + Moff); 1181 dFcat = measure[0].dM * Finst; 1182 } else { 1183 dFcat = measure[0].dFluxPSF * Foff; 1184 } 1185 break; 1186 case MAG_CLASS_KRON: 1187 if (isnan (measure[0].dFluxKron)) { 1188 float Finst = MagToFlux(measure[0].Mkron + Moff); 1189 dFcat = measure[0].dMkron * Finst; 1190 } else { 1191 dFcat = measure[0].dFluxKron * Foff; 1192 } 1193 break; 1194 case MAG_CLASS_APER: 1195 if (isnan (measure[0].dFluxAp)) { 1196 float Finst = MagToFlux(measure[0].Map + Moff); 1197 dFcat = measure[0].dMap * Finst; 1198 } else { 1199 dFcat = measure[0].dFluxAp * Foff; 1200 } 1201 break; 1202 default: 1203 break; 1204 } 1205 return (dFcat); 1115 1206 } 1116 1207
Note:
See TracChangeset
for help on using the changeset viewer.
