Changeset 36975
- Timestamp:
- Jul 7, 2014, 10:48:43 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src
- Files:
-
- 14 edited
-
LoadPhotcodesText.c (modified) (1 diff)
-
dvo_catalog.c (modified) (2 diffs)
-
dvo_convert_PS1_DEV_1.c (modified) (2 diffs)
-
dvo_convert_PS1_DEV_2.c (modified) (2 diffs)
-
dvo_convert_PS1_V1.c (modified) (2 diffs)
-
dvo_convert_PS1_V2.c (modified) (2 diffs)
-
dvo_convert_PS1_V3.c (modified) (2 diffs)
-
dvo_convert_PS1_V4.c (modified) (2 diffs)
-
dvo_convert_PS1_V5.c (modified) (2 diffs)
-
dvo_convert_elixir.c (modified) (4 diffs)
-
dvo_convert_loneos.c (modified) (4 diffs)
-
dvo_convert_panstarrs_DEV_0.c (modified) (2 diffs)
-
dvo_convert_panstarrs_DEV_1.c (modified) (2 diffs)
-
dvo_photcode_ops.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/LoadPhotcodesText.c
r36908 r36975 142 142 photcode[Ncode].photomErrSys = atof (photomErrSys); 143 143 144 photcode[Ncode].astromPoorMask = strtol (astromPoorMask, NULL, 0);145 photcode[Ncode].astromBadMask = strtol (astromBadMask, NULL, 0);146 photcode[Ncode].photomPoorMask = strtol (photomPoorMask, NULL, 0);147 photcode[Ncode].photomBadMask = strtol (photomBadMask, NULL, 0);144 photcode[Ncode].astromPoorMask = strtoll (astromPoorMask, NULL, 0); 145 photcode[Ncode].astromBadMask = strtoll (astromBadMask, NULL, 0); 146 photcode[Ncode].photomPoorMask = strtoll (photomPoorMask, NULL, 0); 147 photcode[Ncode].photomBadMask = strtoll (photomBadMask, NULL, 0); 148 148 149 149 switch (photcode[Ncode].type) { -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_catalog.c
r36946 r36975 174 174 secfilt->Mmin = NAN; 175 175 secfilt->Mmax = NAN; 176 secfilt-> Xm= NAN;176 secfilt->Mchisq = NAN; 177 177 178 178 secfilt->Ncode = 0; … … 770 770 for (in = out = i = 0; i < catalog[0].Naverage; i++) { 771 771 for (j = 0; j < catalog[0].Nsecfilt; j++, in++, out++) { 772 outsec[out].M = insec[in].M;773 outsec[out].dM = insec[in].dM;774 outsec[out]. Xm = insec[in].Xm;772 outsec[out].M = insec[in].M; 773 outsec[out].dM = insec[in].dM; 774 outsec[out].Mchisq = insec[in].Mchisq; 775 775 } 776 776 for (j = 0; j < Nextra; j++, out++) { 777 outsec[out].M = NAN;778 outsec[out].dM = NAN;779 outsec[out]. Xm = NAN_S_SHORT;777 outsec[out].M = NAN; 778 outsec[out].dM = NAN; 779 outsec[out].Mchisq = NAN; 780 780 } 781 781 } -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c
r36898 r36975 184 184 out[i].M = in[i].M; 185 185 out[i].dM = in[i].dM; 186 out[i]. Xm = in[i].Xm;186 out[i].Mchisq= pow (10.0, 0.01*in[i].Xm); 187 187 out[i].Ncode = in[i].Ncode; 188 188 out[i].Nused = in[i].Nused; … … 201 201 out[i].M = in[i].M; 202 202 out[i].dM = in[i].dM; 203 out[i].Xm = in[i].Xm;203 out[i].Xm = 100.0*log10(in[i].Mchisq); 204 204 out[i].Ncode = in[i].Ncode; 205 205 out[i].Nused = in[i].Nused; -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c
r36898 r36975 179 179 out[i].M = in[i].M; 180 180 out[i].dM = in[i].dM; 181 out[i]. Xm = in[i].Xm;181 out[i].Mchisq= pow (10.0, 0.01*in[i].Xm); 182 182 out[i].Ncode = in[i].Ncode; 183 183 out[i].Nused = in[i].Nused; … … 196 196 out[i].M = in[i].M; 197 197 out[i].dM = in[i].dM; 198 out[i].Xm = in[i].Xm;198 out[i].Xm = 100.0*log10(in[i].Mchisq); 199 199 out[i].Ncode = in[i].Ncode; 200 200 out[i].Nused = in[i].Nused; -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c
r36898 r36975 199 199 out[i].M = in[i].M; 200 200 out[i].dM = in[i].dM; 201 out[i]. Xm = in[i].Xm;201 out[i].Mchisq= in[i].Mchisq; 202 202 out[i].Ncode = in[i].Ncode; 203 203 out[i].Nused = in[i].Nused; … … 218 218 out[i].M = in[i].M; 219 219 out[i].dM = in[i].dM; 220 out[i]. Xm = in[i].Xm;220 out[i].Mchisq= in[i].Mchisq; 221 221 out[i].Ncode = in[i].Ncode; 222 222 out[i].Nused = in[i].Nused; -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c
r36898 r36975 208 208 out[i].M = in[i].M; 209 209 out[i].dM = in[i].dM; 210 out[i]. Xm = in[i].Xm;210 out[i].Mchisq= in[i].Mchisq; 211 211 out[i].flags = in[i].flags; 212 212 out[i].Ncode = in[i].Ncode; … … 228 228 out[i].M = in[i].M; 229 229 out[i].dM = in[i].dM; 230 out[i]. Xm = in[i].Xm;230 out[i].Mchisq= in[i].Mchisq; 231 231 out[i].flags = in[i].flags; 232 232 out[i].Ncode = in[i].Ncode; -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c
r36898 r36975 213 213 out[i].Map = in[i].Map; 214 214 out[i].dM = in[i].dM; 215 out[i]. Xm = in[i].Xm;215 out[i].Mchisq = in[i].Mchisq; 216 216 out[i].flags = in[i].flags; 217 217 out[i].Ncode = in[i].Ncode; … … 236 236 out[i].Map = in[i].Map; 237 237 out[i].dM = in[i].dM; 238 out[i]. Xm = in[i].Xm;238 out[i].Mchisq = in[i].Mchisq; 239 239 out[i].flags = in[i].flags; 240 240 out[i].Ncode = in[i].Ncode; -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c
r36898 r36975 239 239 out[i].dMkron = in[i].dMkron; 240 240 out[i].dM = in[i].dM; 241 out[i]. Xm = in[i].Xm;241 out[i].Mchisq = in[i].Mchisq; 242 242 out[i].FpsfStk = in[i].FluxPSF; 243 243 out[i].dFpsfStk = in[i].dFluxPSF; … … 269 269 out[i].dMkron = in[i].dMkron; 270 270 out[i].dM = in[i].dM; 271 out[i]. Xm = in[i].Xm;271 out[i].Mchisq = in[i].Mchisq; 272 272 out[i].FluxPSF = in[i].FpsfStk; 273 273 out[i].dFluxPSF = in[i].dFpsfStk; -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
r36921 r36975 292 292 out[i].Mmin = in[i].Mmin; 293 293 out[i].Mmax = in[i].Mmax; 294 out[i]. Xm = in[i].Xm;294 out[i].Mchisq = in[i].Mchisq; 295 295 296 296 out[i].Ncode = in[i].Ncode; … … 360 360 out[i].Mmin = in[i].Mmin; 361 361 out[i].Mmax = in[i].Mmax; 362 out[i]. Xm = in[i].Xm;362 out[i].Mchisq = in[i].Mchisq; 363 363 364 364 out[i].Ncode = in[i].Ncode; -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_elixir.c
r36898 r36975 111 111 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 112 112 primary[0][i].dM = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001; 113 primary[0][i]. Xm = in[i].Xm;113 primary[0][i].Mchisq= pow (10.0, 0.01*in[i].Xm); 114 114 115 115 // added for PANSTARRS_DEV_0 … … 144 144 out[i].M = isnan(primary[i].M) ? NAN_S_SHORT : primary[i].M * 1000.0; 145 145 out[i].dM = isnan(primary[i].dM) ? NAN_S_SHORT : primary[i].dM * 1000.0; 146 out[i].Xm = primary[i].Xm;146 out[i].Xm = 100.0*log10(primary[i].Mchisq); 147 147 148 148 // changed or added for PS1_DEV_2 … … 169 169 dvo_secfilt_init (&out[i]); 170 170 171 out[i]. Xm = in[i].Xm;171 out[i].Mchisq = pow (10.0, 0.01*in[i].Xm); 172 172 173 173 // added or changed for PANSTARRS_DEV_0 … … 187 187 188 188 for (i = 0; i < Nvalues; i++) { 189 out[i].Xm = in[i].Xm;189 out[i].Xm = 100.0*log10(in[i].Mchisq); 190 190 191 191 // added or changed for PANSTARRS_DEV_0 -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_loneos.c
r36898 r36975 90 90 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 91 91 primary[0][i].M = (in[i].M == NAN_S_SHORT) ? NAN : in[i].M * 0.001; 92 primary[0][i]. Xm = in[i].Xm;92 primary[0][i].Mchisq= pow (10.0, 0.01*in[i].Xm); 93 93 94 94 // added for PANSTARRS_DEV_0 … … 124 124 // changed for PANSTARRS_DEV_0 (moved from Average to Measure) 125 125 out[i].M = isnan(primary[i].M) ? NAN_S_SHORT : primary[i].M * 1000.0; 126 out[i].Xm = primary[i].Xm;126 out[i].Xm = 100.0*log10(primary[i].Mchisq); 127 127 128 128 // changed or added for PS1_DEV_2 … … 149 149 dvo_secfilt_init (&out[i]); 150 150 151 out[i]. Xm = in[i].Xm;151 out[i].Mchisq= pow (10.0, 0.01*in[i].Xm); 152 152 153 153 // added or changed for PANSTARRS_DEV_0 … … 166 166 167 167 for (i = 0; i < Nvalues; i++) { 168 out[i].Xm = in[i].Xm;168 out[i].Xm = 100.0*log10(in[i].Mchisq); 169 169 170 170 // added or changed for PANSTARRS_DEV_0 -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c
r36898 r36975 188 188 out[i].M = in[i].M; 189 189 out[i].dM = in[i].dM; 190 out[i]. Xm = in[i].Xm;190 out[i].Mchisq= pow (10.0, 0.01*in[i].Xm); 191 191 out[i].Ncode = in[i].Ncode; 192 192 out[i].Nused = in[i].Nused; … … 206 206 out[i].M = in[i].M; 207 207 out[i].dM = in[i].dM; 208 out[i].Xm = in[i].Xm;208 out[i].Xm = 100.0*log10(in[i].Mchisq); 209 209 out[i].Ncode = in[i].Ncode; 210 210 out[i].Nused = in[i].Nused; -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c
r36898 r36975 188 188 out[i].M = in[i].M; 189 189 out[i].dM = in[i].dM; 190 out[i]. Xm = in[i].Xm;190 out[i].Mchisq= pow (10.0, 0.01*in[i].Xm); 191 191 out[i].Ncode = in[i].Ncode; 192 192 out[i].Nused = in[i].Nused; … … 206 206 out[i].M = in[i].M; 207 207 out[i].dM = in[i].dM; 208 out[i].Xm = in[i].Xm;208 out[i].Xm = 100.0*log10(in[i].Mchisq); 209 209 out[i].Ncode = in[i].Ncode; 210 210 out[i].Nused = in[i].Nused; -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_photcode_ops.c
r36912 r36975 795 795 } 796 796 797 // X XX return NAN or NAN_S_SHORT? (secfilt->Xm is short)797 // Xm is now (2014.07.03) stored as the chisq except in dvo formats which use as short 798 798 float PhotXm (PhotCode *code, Average *average, SecFilt *secfilt) { 799 799 800 800 int Ns; 801 short Mi;802 801 float Xm; 803 802 … … 805 804 806 805 Ns = photcodes[0].hashNsec[code[0].code]; 807 Mi = (Ns == -1) ? NAN : secfilt[Ns].Xm; 808 Xm = (isnan(Mi)) ? -1.0 : pow (10.0, 0.01*Mi); 806 Xm = (Ns == -1) ? NAN : secfilt[Ns].Mchisq; 809 807 return (Xm); 810 808 } … … 889 887 PhotCode *code = &photcodes[0].code[Np]; 890 888 889 // mag_AB = -2.5 log (flux_cgs) - 48.6 (by definition) [~Vega flux in V-band] 890 // flux_Jy = flux_cgs * 10^23 891 // -2.5 log (flux_cgs) = -2.5 log (flux_Jy * 10^-23) = -2.5 log (flux_Jy) + 2.5*23 892 893 // from these we get: 894 // mag_AB = -2.5 log (flux_Jy) + 8.9 895 // log (flux_Jy) = -0.4*mag_AB + 3.56 896 897 // mag_AB = mag_inst + ZP 898 899 // log(flux_Jy) = -0.4*mag_inst -0.4*ZP + 3.56 900 // mag_inst = -2.5 log (flux_Jy) - ZP + 8.9 901 902 // log (flux_Jy) = -0.4*(mag_inst + ZP - 8.9) 903 904 // -2.5 log (flux_inst) = -2.5 log (flux_Jy) - ZP + 8.9 905 // log (flux_inst) = log (flux_Jy) + 0.4 ZP - 3.56 906 // flux_inst = flux_Jy * 10^(0.4*ZP - 3.56) 907 // flux_Jy = flux_inst * 10^(3.56 - 0.4*ZP) = flux_inst * zpFactor 908 // flux_Jy = flux_inst * 3630.8 * 10^(-0.4*ZP) 909 891 910 // measure.M has the static ZERO_POINT (25.0) applied, but not measure.Flux 892 911 float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C; 893 float Moff = Mcal - ZERO_POINT ;894 float Foff = MagToFlux(Mcal);912 float Moff = Mcal - ZERO_POINT + 8.9; 913 float Foff = 3630.8 * MagToFlux(Mcal); 895 914 float Fcat = NAN; 896 915 switch (class) { … … 919 938 // measure.M has the static ZERO_POINT (25.0) applied, but not measure.Flux 920 939 float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C; 921 float Moff = Mcal - ZERO_POINT ;922 float Foff = MagToFlux(Mcal);940 float Moff = Mcal - ZERO_POINT + 8.9; 941 float Foff = 3630.8 * MagToFlux(Mcal); 923 942 float Fcat = NAN; 924 943 switch (class) { … … 964 983 // measure.M has the static ZERO_POINT (25.0) applied, but not measure.Flux 965 984 float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - measure[0].Mcal; 966 float Moff = Mcal - ZERO_POINT ;967 float Foff = MagToFlux(Mcal);985 float Moff = Mcal - ZERO_POINT + 8.9; 986 float Foff = 3630.8 * MagToFlux(Mcal); 968 987 float Fcat = NAN; 969 988 switch (class) { … … 1168 1187 // measure.M has the static ZERO_POINT (25.0) applied, but not measure.Flux 1169 1188 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);1189 float Moff = Mcal - ZERO_POINT + 8.9; 1190 float Foff = 3630.8 * MagToFlux(Mcal); 1172 1191 1173 1192 // use dFlux if we can, but use dMag if we must: … … 1544 1563 } 1545 1564 1546 // X XX return NAN or NAN_S_SHORT? (secfilt->Xm is short)1565 // Xm is now (2014.07.03) stored as the chisq except in dvo formats which use as short 1547 1566 float PhotXmTiny (PhotCode *code, AverageTiny *average, SecFilt *secfilt) { 1548 1567 1549 1568 int Ns; 1550 short Mi;1551 1569 float Xm; 1552 1570 … … 1554 1572 1555 1573 Ns = photcodes[0].hashNsec[code[0].code]; 1556 Mi = (Ns == -1) ? NAN : secfilt[Ns].Xm; 1557 Xm = (isnan(Mi)) ? -1.0 : pow (10.0, 0.01*Mi); 1574 Xm = (Ns == -1) ? NAN : secfilt[Ns].Mchisq; 1558 1575 return (Xm); 1559 1576 }
Note:
See TracChangeset
for help on using the changeset viewer.
