Changeset 4865
- Timestamp:
- Aug 24, 2005, 8:51:56 AM (21 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 2 added
- 44 edited
-
addstar/src/calibrate.c (modified) (5 diffs)
-
addstar/src/find_matches.c (modified) (5 diffs)
-
addstar/src/find_matches_refstars.c (modified) (5 diffs)
-
addstar/src/gcatalog.c (modified) (1 diff)
-
addstar/src/replace_match.c (modified) (1 diff)
-
delstar/src/gcatalog.c (modified) (1 diff)
-
gastro/src/gptolemy.c (modified) (2 diffs)
-
gastro2/src/gptolemy2.c (modified) (1 diff)
-
libautocode/Makefile (modified) (2 diffs)
-
libautocode/def/average-elixir.d (modified) (1 diff)
-
libautocode/def/average-panstarrs.d (modified) (2 diffs)
-
libautocode/def/average.d (modified) (2 diffs)
-
libautocode/def/measure-panstarrs.d (modified) (1 diff)
-
libautocode/def/measure.d (modified) (1 diff)
-
libautocode/def/secfilt-elixir.d (added)
-
libautocode/def/secfilt-panstarrs.d (added)
-
libautocode/def/secfilt.d (modified) (1 diff)
-
libohana/Makefile (modified) (1 diff)
-
libohana/include/dvo.h (modified) (2 diffs)
-
libohana/src/LoadPhotcodes.c (modified) (22 diffs)
-
libohana/src/dvo_convert_elixir.c (modified) (8 diffs)
-
libohana/src/dvo_convert_loneos.c (modified) (6 diffs)
-
libohana/src/dvo_convert_panstarrs.c (modified) (7 diffs)
-
mosastro/src/gptolemy.c (modified) (1 diff)
-
opihi/dvo/calextract.c (modified) (1 diff)
-
opihi/dvo/calmextract.c (modified) (1 diff)
-
opihi/dvo/catalog.c (modified) (7 diffs)
-
opihi/dvo/compare.c (modified) (1 diff)
-
opihi/dvo/dmt.c (modified) (1 diff)
-
opihi/dvo/gstar.c (modified) (3 diffs)
-
opihi/dvo/imdata.c (modified) (4 diffs)
-
opihi/dvo/lcurve.c (modified) (1 diff)
-
opihi/dvo/lightcurve.c (modified) (1 diff)
-
opihi/dvo/photometry.c (modified) (6 diffs)
-
relphot/include/relphot.h (modified) (2 diffs)
-
relphot/src/ConfigInit.c (modified) (1 diff)
-
relphot/src/GridOps.v2.c (modified) (9 diffs)
-
relphot/src/ImageOps.c (modified) (5 diffs)
-
relphot/src/MosaicOps.c (modified) (5 diffs)
-
relphot/src/StarOps.c (modified) (19 diffs)
-
relphot/src/args.c (modified) (2 diffs)
-
relphot/src/bcatalog.c (modified) (4 diffs)
-
relphot/src/plot_scatter.c (modified) (2 diffs)
-
relphot/src/setMrelFinal.c (modified) (5 diffs)
-
uniphot/include/uniphot.h (modified) (1 diff)
-
uniphot/src/update_catalog.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/calibrate.c
r3361 r4865 60 60 if (measure[0].source == CalC0) { 61 61 found0 = TRUE; 62 CalM0 = measure[i].M ;63 dCalM = measure[i].dM ;62 CalM0 = measure[i].M_PS; 63 dCalM = measure[i].dM_PS; 64 64 } 65 65 if (measure[i].source == CalC1) { 66 66 found1 = TRUE; 67 CalM1 = measure[i].M ;67 CalM1 = measure[i].M_PS; 68 68 } 69 69 if (measure[i].source == CalC2) { 70 70 found2 = TRUE; 71 CalM2 = measure[i].M ;71 CalM2 = measure[i].M_PS; 72 72 } 73 73 if (found0 && found1 && found2) { 74 SaveCalibration (new[0].M , new[0].dM, CalM0, dCalM, CalM1-CalM2, new[0].airmass, Nstar);74 SaveCalibration (new[0].M_PS, new[0].dM_PS, CalM0, dCalM, CalM1-CalM2, new[0].airmass_PS, Nstar); 75 75 return; 76 76 } … … 83 83 84 84 int i, MaxN, *Nlist, Nkeep; 85 short int Mint;85 float Mint; 86 86 float N, M1, M2, Klam, Clam, Xlam, Mabs, *Dmag, *dDmag; 87 87 float dMo, dMr, Mw, Dmed, W1, W2, NSigma; … … 110 110 ALLOCATE (dDmag, float, Ncal); 111 111 Nkeep = 0; 112 Clam = thiscode[0].C*0.001; 112 113 Klam = thiscode[0].K; 113 Clam = thiscode[0].C;114 114 Xlam = thiscode[0].X[0]; 115 115 for (i = 0; i < Ncal; i++) { 116 116 /* if this entry has too many (or two few?) matches, skip it */ 117 117 if (Nlist[Nstar[i]] != 1) continue; 118 Mint = Clam + Mobs[i] + Xlam*Cref[i] + Klam*(Airm[i] - 1 000);119 Mabs = 0.001*Mint - ZeroPt;118 Mint = Clam + Mobs[i] + Xlam*Cref[i] + Klam*(Airm[i] - 1.000); 119 Mabs = Mint - ZeroPt; 120 120 /* note: subpix correction is applied in gstars */ 121 121 … … 126 126 } 127 127 128 dMr = MAX (0.005, 0.001*dMref[i]); 129 dMo = MAX (0.005, 0.001*dMobs[i]); 128 /* XXX EAM: note the artificial 0.005 dmag here */ 129 dMr = MAX (0.005, dMref[i]); 130 dMo = MAX (0.005, dMobs[i]); 130 131 131 Dmag[Nkeep] = (Mabs - 0.001*Mref[i]);132 Dmag[Nkeep] = (Mabs - Mref[i]); 132 133 dDmag[Nkeep] = (dMr*dMr + dMo*dMo); 133 134 Nkeep ++; … … 178 179 } 179 180 } 181 182 /*** image.Mcal is still in millimags ***/ -
trunk/Ohana/src/addstar/src/find_matches.c
r4825 r4865 13 13 Coords tcoords; 14 14 int Nsecfilt, Nsec, MTIME; 15 short int Mcat, *Mval;15 float Mcat, *Mval; 16 16 17 17 /* photcode data - must by of type DEP, (PRI, SEC) - probably should restrict to DEP */ … … 103 103 /* correct instrumental mags for exposure time */ 104 104 if (image[0].exptime > 0) { 105 MTIME = 2 500*log10(image[0].exptime);105 MTIME = 2.500*log10(image[0].exptime); 106 106 } else { 107 107 MTIME = 0; … … 149 149 catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R_PS - stars[N].R); 150 150 catalog[0].measure[Nmeas].dD_PS = 3600.0*(catalog[0].average[n].D_PS - stars[N].D); 151 catalog[0].measure[Nmeas].M = MIN (1000*stars[N].M + MTIME, NO_MAG);152 catalog[0].measure[Nmeas].dM = MIN (1000*stars[N].dM, NO_ERR); /* error in input files stored in thousandths of mag */153 catalog[0].measure[Nmeas].Mcal = image[0].Mcal;154 catalog[0].measure[Nmeas].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */155 catalog[0].measure[Nmeas].averef = n;156 catalog[0].measure[Nmeas].source = stars[N].code; /* photcode */157 catalog[0].measure[Nmeas].dophot = stars[N].dophot;158 catalog[0].measure[Nmeas].flags = 0;159 catalog[0].measure[Nmeas].dt = MTIME;160 catalog[0].measure[Nmeas].airmass = secz;161 162 catalog[0].measure[Nmeas].Mgal = MIN (1000*stars[N].Mgal + MTIME, NO_MAG);163 catalog[0].measure[Nmeas].FWx = MIN (100*stars[N].fx, NO_MAG);164 catalog[0].measure[Nmeas]. fwy = MIN (100*(stars[N].fy / stars[N].fx), NO_ERR);165 catalog[0].measure[Nmeas].theta = MIN ((255/360)*stars[N].df, NO_ERR);151 catalog[0].measure[Nmeas].M_PS = MIN (stars[N].M + MTIME, NO_MAG); 152 catalog[0].measure[Nmeas].dM_PS = MIN (stars[N].dM, NO_ERR); /* error in input files stored in thousandths of mag */ 153 catalog[0].measure[Nmeas].Mcal_PS = 0.001*image[0].Mcal; /* XXX image.Mcal still millimags */ 154 catalog[0].measure[Nmeas].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */ 155 catalog[0].measure[Nmeas].averef = n; 156 catalog[0].measure[Nmeas].source = stars[N].code; /* photcode */ 157 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 158 catalog[0].measure[Nmeas].flags = 0; 159 catalog[0].measure[Nmeas].dt_PS = MTIME; 160 catalog[0].measure[Nmeas].airmass_PS = secz; 161 162 catalog[0].measure[Nmeas].Mgal_PS = MIN (stars[N].Mgal + MTIME, NO_MAG); 163 catalog[0].measure[Nmeas].FWx = MIN (100*stars[N].fx, NO_MAG); 164 catalog[0].measure[Nmeas].FWy = MIN (100*stars[N].fy, NO_MAG); 165 catalog[0].measure[Nmeas].theta = MIN ((255/360)*stars[N].df, NO_ERR); 166 166 167 167 /* it is not valid to pass PRI/SEC/REF photcodes to this routine */ 168 168 /* check for entries in the secfilt lists */ 169 Mcat = iPhotCat (&catalog[0].measure[Nmeas]);170 Mval = (Nsec == -1) ? &catalog[0].average[n].M : &catalog[0].secfilt[n*Nsecfilt+Nsec].M;169 Mcat = PhotCat (&catalog[0].measure[Nmeas]); 170 Mval = (Nsec == -1) ? &catalog[0].average[n].M_PS : &catalog[0].secfilt[n*Nsecfilt+Nsec].M_PS; 171 171 if (*Mval == NO_MAG) *Mval = Mcat; 172 172 … … 254 254 secz = airmass (image[0].secz, stars[N].R, stars[N].D, SiderealTime, Latitude); 255 255 256 catalog[0].average[Nave].R_PS = stars[N].R;257 catalog[0].average[Nave].D_PS = stars[N].D;258 catalog[0].average[Nave].M = NO_MAG;259 catalog[0].average[Nave].dM = NO_MAG;256 catalog[0].average[Nave].R_PS = stars[N].R; 257 catalog[0].average[Nave].D_PS = stars[N].D; 258 catalog[0].average[Nave].M_PS = NO_MAG; 259 catalog[0].average[Nave].dM_PS = NO_MAG; 260 260 catalog[0].average[Nave].Nm = 1; 261 261 catalog[0].average[Nave].Nn = 0; … … 268 268 269 269 for (j = 0; j < Nsecfilt; j++) { 270 catalog[0].secfilt[Nave*Nsecfilt+j].M = NO_MAG;271 catalog[0].secfilt[Nave*Nsecfilt+j]. Xm= NO_MAG;272 catalog[0].secfilt[Nave*Nsecfilt+j]. dM= NO_MAG;270 catalog[0].secfilt[Nave*Nsecfilt+j].M_PS = NO_MAG; 271 catalog[0].secfilt[Nave*Nsecfilt+j].dM_PS = NO_MAG; 272 catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NO_MAG; 273 273 } 274 274 275 275 catalog[0].measure[Nmeas].dR_PS = 0.0; 276 276 catalog[0].measure[Nmeas].dD_PS = 0.0; 277 catalog[0].measure[Nmeas].M = MIN (1000*stars[N].M + MTIME, NO_MAG);278 catalog[0].measure[Nmeas].dM = MIN (1000*stars[N].dM, NO_ERR);279 catalog[0].measure[Nmeas].Mcal =image[0].Mcal;280 catalog[0].measure[Nmeas].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */281 catalog[0].measure[Nmeas].averef = Nave;282 catalog[0].measure[Nmeas].source = stars[N].code; /* photcode */283 catalog[0].measure[Nmeas].dophot = stars[N].dophot;284 catalog[0].measure[Nmeas].flags = 0;285 catalog[0].measure[Nmeas].dt = MTIME;286 catalog[0].measure[Nmeas].airmass = secz;287 288 catalog[0].measure[Nmeas].Mgal = MIN (1000*stars[N].Mgal + MTIME, NO_MAG);289 catalog[0].measure[Nmeas].FWx = MIN (100*stars[N].fx, NO_MAG);290 catalog[0].measure[Nmeas]. fwy = MIN (100*(stars[N].fy / stars[N].fx), NO_ERR);291 catalog[0].measure[Nmeas].theta = MIN ((255/360)*stars[N].df, NO_ERR);292 293 Mcat = iPhotCat (&catalog[0].measure[Nmeas]);294 Mval = (Nsec == -1) ? &catalog[0].average[Nave].M : &catalog[0].secfilt[Nave*Nsecfilt+Nsec].M;277 catalog[0].measure[Nmeas].M_PS = MIN (stars[N].M + MTIME, NO_MAG); 278 catalog[0].measure[Nmeas].dM_PS = MIN (stars[N].dM, NO_ERR); 279 catalog[0].measure[Nmeas].Mcal_PS = 0.001*image[0].Mcal; 280 catalog[0].measure[Nmeas].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */ 281 catalog[0].measure[Nmeas].averef = Nave; 282 catalog[0].measure[Nmeas].source = stars[N].code; /* photcode */ 283 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 284 catalog[0].measure[Nmeas].flags = 0; 285 catalog[0].measure[Nmeas].dt_PS = MTIME; 286 catalog[0].measure[Nmeas].airmass_PS = secz; 287 288 catalog[0].measure[Nmeas].Mgal_PS = MIN (stars[N].Mgal + MTIME, NO_MAG); 289 catalog[0].measure[Nmeas].FWx = MIN (100*stars[N].fx, NO_MAG); 290 catalog[0].measure[Nmeas].FWy = MIN (100*stars[N].fy, NO_MAG); 291 catalog[0].measure[Nmeas].theta = MIN ((255/360)*stars[N].df, NO_ERR); 292 293 Mcat = PhotCat (&catalog[0].measure[Nmeas]); 294 Mval = (Nsec == -1) ? &catalog[0].average[Nave].M_PS : &catalog[0].secfilt[Nave*Nsecfilt+Nsec].M_PS; 295 295 if (*Mval == NO_MAG) *Mval = Mcat; 296 296 -
trunk/Ohana/src/addstar/src/find_matches_refstars.c
r4800 r4865 130 130 catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R_PS - stars[N][0].R); 131 131 catalog[0].measure[Nmeas].dD_PS = 3600.0*(catalog[0].average[n].D_PS - stars[N][0].D); 132 catalog[0].measure[Nmeas].M = MIN (1000*stars[N][0].M, NO_MAG);133 catalog[0].measure[Nmeas].dM = MIN (1000*stars[N][0].dM, NO_ERR);134 catalog[0].measure[Nmeas].Mcal = 0;132 catalog[0].measure[Nmeas].M_PS = MIN (stars[N][0].M, NO_MAG); 133 catalog[0].measure[Nmeas].dM_PS = MIN (stars[N][0].dM, NO_ERR); 134 catalog[0].measure[Nmeas].Mcal_PS = 0; 135 135 catalog[0].measure[Nmeas].t = (TIMEREF == 0) ? stars[N][0].t : TIMEREF; /** careful : time_t vs e_time **/ 136 136 catalog[0].measure[Nmeas].averef = n; … … 138 138 catalog[0].measure[Nmeas].dophot = 0; 139 139 catalog[0].measure[Nmeas].flags = 0; 140 catalog[0].measure[Nmeas].dt = 0xffff;141 142 catalog[0].measure[Nmeas].Mgal = NO_MAG;143 catalog[0].measure[Nmeas].airmass = 0;144 catalog[0].measure[Nmeas].FWx = NO_MAG;145 catalog[0].measure[Nmeas]. fwy = 0xff;146 catalog[0].measure[Nmeas].theta = 0xff;140 catalog[0].measure[Nmeas].dt_PS = 0xffff; 141 142 catalog[0].measure[Nmeas].Mgal_PS = NO_MAG; 143 catalog[0].measure[Nmeas].airmass_PS = 0; 144 catalog[0].measure[Nmeas].FWx = NO_MAG; 145 catalog[0].measure[Nmeas].FWy = NO_MAG; 146 catalog[0].measure[Nmeas].theta = NO_ERR; 147 147 148 148 /** don't update average / secfilt values for REF photcodes **/ … … 195 195 catalog[0].average[Nave].R_PS = stars[N][0].R; 196 196 catalog[0].average[Nave].D_PS = stars[N][0].D; 197 catalog[0].average[Nave].M = NO_MAG;198 catalog[0].average[Nave].dM = NO_MAG;197 catalog[0].average[Nave].M_PS = NO_MAG; 198 catalog[0].average[Nave].dM_PS = NO_MAG; 199 199 catalog[0].average[Nave].Nm = 1; 200 200 catalog[0].average[Nave].Nn = 0; … … 207 207 208 208 for (j = 0; j < Nsecfilt; j++) { 209 catalog[0].secfilt[Nave*Nsecfilt+j].M = NO_MAG;210 catalog[0].secfilt[Nave*Nsecfilt+j]. Xm= NO_MAG;211 catalog[0].secfilt[Nave*Nsecfilt+j]. dM= NO_MAG;209 catalog[0].secfilt[Nave*Nsecfilt+j].M_PS = NO_MAG; 210 catalog[0].secfilt[Nave*Nsecfilt+j].dM_PS = NO_MAG; 211 catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NO_MAG; 212 212 } 213 213 214 214 catalog[0].measure[Nmeas].dR_PS = 0.0; 215 215 catalog[0].measure[Nmeas].dD_PS = 0.0; 216 catalog[0].measure[Nmeas].M = MIN (1000*stars[N][0].M, NO_MAG);217 catalog[0].measure[Nmeas].dM = MIN (1000*stars[N][0].dM, NO_ERR);218 catalog[0].measure[Nmeas].Mcal = 0;216 catalog[0].measure[Nmeas].M_PS = MIN (stars[N][0].M, NO_MAG); 217 catalog[0].measure[Nmeas].dM_PS = MIN (stars[N][0].dM, NO_ERR); 218 catalog[0].measure[Nmeas].Mcal_PS = 0; 219 219 catalog[0].measure[Nmeas].t = (stars[N][0].t == 0) ? TIMEREF : stars[N][0].t; /** careful : time_t vs e_time **/ 220 220 catalog[0].measure[Nmeas].averef = Nave; … … 222 222 catalog[0].measure[Nmeas].dophot = 0; 223 223 catalog[0].measure[Nmeas].flags = 0; 224 catalog[0].measure[Nmeas].dt = 0xffff;225 226 catalog[0].measure[Nmeas].Mgal = NO_MAG;227 catalog[0].measure[Nmeas].airmass = 0;228 catalog[0].measure[Nmeas].FWx = NO_MAG;229 catalog[0].measure[Nmeas]. fwy = 0xff;230 catalog[0].measure[Nmeas].theta = 0xff;224 catalog[0].measure[Nmeas].dt_PS = 0xffff; 225 226 catalog[0].measure[Nmeas].Mgal_PS = NO_MAG; 227 catalog[0].measure[Nmeas].airmass_PS = 0; 228 catalog[0].measure[Nmeas].FWx = NO_MAG; 229 catalog[0].measure[Nmeas].FWy = NO_ERR; 230 catalog[0].measure[Nmeas].theta = NO_ERR; 231 231 232 232 stars[N][0].found = Nmeas; -
trunk/Ohana/src/addstar/src/gcatalog.c
r4826 r4865 28 28 for (in = out = i = 0; i < catalog[0].Naverage; i++) { 29 29 for (j = 0; j < catalog[0].Nsecfilt; j++, in++, out++) { 30 outsec[out].M = insec[in].M; 30 outsec[out].M_PS = insec[in].M_PS; 31 outsec[out].dM_PS = insec[in].dM_PS; 31 32 outsec[out].Xm = insec[in].Xm; 32 outsec[out].dM = insec[in].dM;33 33 } 34 34 for (j = 0; j < Nextra; j++, out++) { 35 outsec[out].M = NO_MAG;36 outsec[out]. Xm= NO_MAG;37 outsec[out]. dM= NO_MAG;35 outsec[out].M_PS = NO_MAG; 36 outsec[out].dM_PS = NO_MAG; 37 outsec[out].Xm = NO_MAG; 38 38 } 39 39 } -
trunk/Ohana/src/addstar/src/replace_match.c
r4800 r4865 12 12 measure[i].dR_PS = 3600.0*(average[0].R_PS - star[0].R); 13 13 measure[i].dD_PS = 3600.0*(average[0].D_PS - star[0].D); 14 measure[i].M = MIN (1000*star[0].M, NO_MAG);15 measure[i].dM = MIN (1000*star[0].dM, NO_ERR);14 measure[i].M_PS = MIN (star[0].M, NO_MAG); 15 measure[i].dM_PS = MIN (star[0].dM, NO_ERR); 16 16 star[0].found = average[0].offset + i; 17 17 return (TRUE); -
trunk/Ohana/src/delstar/src/gcatalog.c
r4832 r4865 28 28 for (in = out = i = 0; i < catalog[0].Naverage; i++) { 29 29 for (j = 0; j < catalog[0].Nsecfilt; j++, in++, out++) { 30 outsec[out].M = insec[in].M; 31 outsec[out].Xm = insec[in].Xm; 30 outsec[out].M_PS = insec[in].M_PS; 31 outsec[out].dM_PS = insec[in].dM_PS; 32 outsec[out].Xm = insec[in].Xm; 32 33 } 33 34 for (j = 0; j < Nextra; j++, out++) { 34 outsec[out].M = NO_MAG; 35 outsec[out].Xm = NO_MAG; 35 outsec[out].M_PS = NO_MAG; 36 outsec[out].dM_PS = NO_ERR; 37 outsec[out].Xm = NO_MAG; 36 38 } 37 39 } -
trunk/Ohana/src/gastro/src/gptolemy.c
r4828 r4865 45 45 stars[0][nstar].X = catalog.average[i].R_PS; 46 46 stars[0][nstar].Y = catalog.average[i].D_PS; 47 stars[0][nstar].mag = 0.001*catalog.measure[catalog.average[i].offset].M;47 stars[0][nstar].mag = catalog.measure[catalog.average[i].offset].M_PS; 48 48 } 49 49 … … 54 54 stars[0][nstar].Y = catalog.average[i].D_PS; 55 55 GotIt = FALSE; 56 if (catalog.average[i].M != NO_MAG) {57 stars[0][nstar].mag = 0.001*catalog.average[i].M;56 if (catalog.average[i].M_PS != NO_MAG) { 57 stars[0][nstar].mag = catalog.average[i].M_PS; 58 58 GotIt = TRUE; 59 59 } 60 60 for (j = 0; !GotIt && (j < Nsec); j++) { 61 if (catalog.secfilt[i*Nsec + j].M != NO_MAG) {62 stars[0][nstar].mag = 0.001*catalog.secfilt[i*Nsec + j].M;61 if (catalog.secfilt[i*Nsec + j].M_PS != NO_MAG) { 62 stars[0][nstar].mag = catalog.secfilt[i*Nsec + j].M_PS; 63 63 GotIt = TRUE; 64 64 } -
trunk/Ohana/src/gastro2/src/gptolemy2.c
r4829 r4865 43 43 stars[nstar].R = catalog.average[i].R_PS; 44 44 stars[nstar].D = catalog.average[i].D_PS; 45 stars[nstar].M = 0.001*catalog.measure[catalog.average[i].offset].M;45 stars[nstar].M = catalog.measure[catalog.average[i].offset].M_PS; 46 46 } 47 47 -
trunk/Ohana/src/libautocode/Makefile
r4832 r4865 29 29 $(SRC)/average-panstarrs.$(ARCH).o \ 30 30 $(SRC)/secfilt.$(ARCH).o \ 31 $(SRC)/secfilt-elixir.$(ARCH).o \ 32 $(SRC)/secfilt-panstarrs.$(ARCH).o \ 31 33 $(SRC)/measure.$(ARCH).o \ 32 34 $(SRC)/measure-loneos.$(ARCH).o \ … … 51 53 $(INC)/average-panstarrs.h \ 52 54 $(INC)/secfilt.h \ 55 $(INC)/secfilt-elixir.h \ 56 $(INC)/secfilt-panstarrs.h \ 53 57 $(INC)/measure.h \ 54 58 $(INC)/measure-loneos.h \ -
trunk/Ohana/src/libautocode/def/average-elixir.d
r4832 r4865 12 12 FIELD Nn, NMISS, unsigned short, number of missings 13 13 FIELD Xp, SIGMA_POS, short, position scatter, 1/100 arcsec 14 FIELD Xm, CHISQ_MAG, short, chisq for primary mag, [100 0*value] ?14 FIELD Xm, CHISQ_MAG, short, chisq for primary mag, [100*log(value)] ? 15 15 FIELD code, code, unsigned short, ID code (star, ghost, etc) 16 16 FIELD offset, offset, int, offset to first measurement 17 17 FIELD missing, missing, int, offset to first missing obs 18 FIELD dM, MAG_ERR, short, error on primary mag, [1000*log(value)] ?18 FIELD dM, MAG_ERR, short, error on primary mag, millimag 19 19 FIELD Xg, Xg, short, best chisq value -
trunk/Ohana/src/libautocode/def/average-panstarrs.d
r4501 r4865 2 2 EXTNAME DVO_AVERAGE_PANSTARRS 3 3 TYPE BINTABLE 4 SIZE 4 04 SIZE 44 5 5 6 6 # elements of data structure / FITS table … … 8 8 FIELD R, RA, double, RA, decimal degrees 9 9 FIELD D, DEC, double, DEC, decimal degrees 10 FIELD M, MAG, short, primary mag, millimag 10 FIELD M, MAG, float, primary mag, mag 11 FIELD dM, MAG_ERR, float, error on primary mag, mag 12 FIELD Xp, SIGMA_POS, short, position scatter, 1/100 arcsec 13 FIELD Xm, CHISQ_MAG, short, chisq for primary mag, [100*log(value)] 14 FIELD Xg, CHISQ_GAL, short, chisq for galaxy mag [100*log(value)] 11 15 FIELD Nm, NMEAS, unsigned short, number of measures 12 16 FIELD Nn, NMISS, unsigned short, number of missings 13 FIELD Xp, SIGMA_POS, short, position scatter, 1/100 arcsec14 FIELD Xm, CHISQ_MAG, short, chisq for primary mag, [1000*value] ?15 17 FIELD code, code, unsigned short, ID code (star, ghost, etc) 16 18 FIELD offset, offset, int, offset to first measurement 17 19 FIELD missing, missing, int, offset to first missing obs 18 FIELD dM, MAG_ERR, short, error on primary mag, [1000*log(value)] ?19 FIELD Xg, Xg, short, best chisq value -
trunk/Ohana/src/libautocode/def/average.d
r4832 r4865 2 2 EXTNAME DVO_AVERAGE 3 3 TYPE BINTABLE 4 SIZE 4 04 SIZE 44 5 5 6 6 # elements of data structure / FITS table … … 8 8 FIELD R_PS, RA, double, RA, decimal degrees 9 9 FIELD D_PS, DEC, double, DEC, decimal degrees 10 FIELD M, MAG, short, primary mag, millimag 10 FIELD M_PS, MAG, float, primary mag, mag 11 FIELD dM_PS, MAG_ERR, float, error on primary mag, mag 12 FIELD Xp, SIGMA_POS, short, position scatter, 1/100 arcsec 13 FIELD Xm, CHISQ_MAG, short, chisq for primary mag, [100*log(value)] 14 FIELD Xg, CHISQ_GAL, short, chisq for galaxy mags, [100*log(value)] 11 15 FIELD Nm, NMEAS, unsigned short, number of measures 12 16 FIELD Nn, NMISS, unsigned short, number of missings 13 FIELD Xp, SIGMA_POS, short, position scatter, 1/100 arcsec14 FIELD Xm, CHISQ_MAG, short, chisq for primary mag, [1000*value] ?15 17 FIELD code, code, unsigned short, ID code (star, ghost, etc) 16 18 FIELD offset, offset, int, offset to first measurement 17 19 FIELD missing, missing, int, offset to first missing obs 18 FIELD dM, MAG_ERR, short, error on primary mag, [1000*log(value)] ?19 FIELD Xg, Xg, short, best chisq value -
trunk/Ohana/src/libautocode/def/measure-panstarrs.d
r4832 r4865 2 2 EXTNAME DVO_MEASURE_PANSTARRS 3 3 TYPE BINTABLE 4 SIZE 324 SIZE 50 5 5 6 6 # elements of data structure / FITS table 7 7 8 FIELD dR, D_RA, short, RA offset, 1/100 arcsec 9 FIELD dD, D_DEC, short, DEC offset, 1/100 arcsec 10 FIELD M, MAG, short, catalog mag, millimag 11 FIELD Mcal, Mcal, short, image cal mag, millimag 12 FIELD Mgal, Mgal, short, galaxy mag, millimag 13 FIELD airmass, airmass, short, (airmass - 1), milliairmass 8 FIELD dR, D_RA, float, RA offset, arcsec 9 FIELD dD, D_DEC, float, DEC offset, arcsec 10 FIELD M, MAG, float, catalog mag, mag 11 FIELD dM, dM, float, mag error, mag 12 FIELD Mcal, Mcal, float, image cal mag, mag 13 FIELD Mgal, Mgal, float, galaxy mag, mag 14 FIELD airmass, airmass, float, (airmass - 1), airmass 15 FIELD dt, dt, float, exposure time, 2.5*log(exptime) 14 16 FIELD FWx, FWx, short, object fwhm major axis, 1/100 of arcsec 15 FIELD dM, dM, unsigned char, mag error, millimag 16 FIELD fwy, fwy, unsigned char, object fwhm minor/major ratio 17 FIELD FWy, FWy, short, object fwhm minor axis, 1/100 of arcsec 17 18 FIELD theta, theta, unsigned char, angle wrt ccd X dir, (0xff/360) deg 18 19 FIELD dophot, dophot, char, dophot type 19 20 FIELD source, source, unsigned short, photcode 21 FIELD flags, flags, unsigned short, flags for various uses 20 22 FIELD t, t, unsigned int, time in seconds (UNIX) 21 23 FIELD averef, averef, unsigned int, reference to average entry 22 FIELD dt, dt, short, exposure time, 2500*log(exptime)23 FIELD flags, flags, unsigned short, flags for various uses -
trunk/Ohana/src/libautocode/def/measure.d
r4863 r4865 16 16 FIELD airmass_PS, airmass, float, (airmass - 1), airmass 17 17 FIELD dt_PS, dt, float, exposure time, 2.5*log(exptime) 18 FIELD t, t, unsigned int, time in seconds (UNIX)19 18 FIELD FWx, FWx, short, object fwhm major axis, 1/100 of arcsec 20 FIELD FWy _PS,FWy, short, object fwhm minor axis, 1/100 of arcsec19 FIELD FWy, FWy, short, object fwhm minor axis, 1/100 of arcsec 21 20 FIELD theta, theta, unsigned char, angle wrt ccd X dir, (0xff/360) deg 22 21 FIELD dophot, dophot, char, dophot type 23 22 FIELD source, source, unsigned short, photcode 24 23 FIELD flags, flags, unsigned short, flags for various uses 24 FIELD t, t, unsigned int, time in seconds (UNIX) 25 25 FIELD averef, averef, unsigned int, reference to average entry -
trunk/Ohana/src/libautocode/def/secfilt.d
r4023 r4865 2 2 EXTNAME DVO_SECFILT 3 3 TYPE BINTABLE 4 SIZE 64 SIZE 10 5 5 6 6 # elements of data structure / FITS table 7 FIELD M , MAG, short, other mags, millimags8 FIELD Xm, MAG_CHI, short, chisq on mag9 FIELD dM, MAG_ERR, short, scatter on mag7 FIELD M_PS, MAG, float, other mags, mags 8 FIELD dM_PS, MAG_ERR, float, scatter on mag mags 9 FIELD Xm, MAG_CHI, short, chisq on mag [100*log(value)] -
trunk/Ohana/src/libohana/Makefile
r4864 r4865 63 63 $(ASRC)/average-panstarrs.$(ARCH).o \ 64 64 $(ASRC)/secfilt.$(ARCH).o \ 65 $(ASRC)/secfilt-elixir.$(ARCH).o \ 66 $(ASRC)/secfilt-panstarrs.$(ARCH).o \ 65 67 $(ASRC)/measure.$(ARCH).o \ 66 68 $(ASRC)/measure-loneos.$(ARCH).o \ -
trunk/Ohana/src/libohana/include/dvo.h
r4864 r4865 187 187 char *GetPhotcodeNamebyCode (int code); 188 188 189 double PhotInst (Measure *measure); 190 double PhotCat (Measure *measure); 191 double PhotSys (Measure *measure, Average *average, SecFilt *secfilt); 192 double PhotRel (Measure *measure, Average *average, SecFilt *secfilt); 193 double PhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code); 194 double PhotAve (PhotCode *code, Average *average, SecFilt *secfilt); 195 double PhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure); 196 double PhotXm (PhotCode *code, Average *average, SecFilt *secfilt); 197 double PhotdM (PhotCode *code, Average *average, SecFilt *secfilt); 198 189 float PhotInst (Measure *measure); 190 float PhotCat (Measure *measure); 191 float PhotSys (Measure *measure, Average *average, SecFilt *secfilt); 192 float PhotRel (Measure *measure, Average *average, SecFilt *secfilt); 193 float PhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code); 194 float PhotAve (PhotCode *code, Average *average, SecFilt *secfilt); 195 float PhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure); 196 float PhotXm (PhotCode *code, Average *average, SecFilt *secfilt); 197 float PhotdM (PhotCode *code, Average *average, SecFilt *secfilt); 198 199 # if (0) 199 200 short iPhotInst (Measure *measure); 200 201 short iPhotAbs (Measure *measure); … … 207 208 short iPhotXm (PhotCode *code, Average *average, SecFilt *secfilt); 208 209 short iPhotdM (PhotCode *code, Average *average, SecFilt *secfilt); 209 210 short iPhotColor (Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code); 210 # endif 211 212 float iPhotColor (Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code); 211 213 int PhotColor (Average *average, SecFilt *secfilt, Measure *measure, int c1, int c2, double *color); 212 214 -
trunk/Ohana/src/libohana/src/LoadPhotcodes.c
r3466 r4865 3 3 4 4 # define NCTERMS 4 5 # define F_PS 0.001 6 # define NO_MAG_PS 100.0 5 7 6 8 static PhotCodeData *photcodes = NULL; 7 9 static double ZERO_POINT; 8 static short int iZERO_POINT;9 10 static short int Nseclist[0x10000]; 11 12 /* static short int iZERO_POINT; */ 10 13 11 14 void SetZeroPoint (double ZP) { 12 15 ZERO_POINT = ZP; 13 iZERO_POINT = 1000 * ZP;16 /* iZERO_POINT = 1000 * ZP; */ 14 17 } 15 18 … … 375 378 } 376 379 380 /**** conversion to INTERNAL vs TABLE types makes the iPhot versions irrelevant ****/ 381 # if (0) 377 382 /******** photometry conversions *********/ 378 383 double PhotInst (Measure *measure) { … … 474 479 } 475 480 481 # endif 482 476 483 /******** internal photometry conversions (keeps values in short int millimags) *********/ 477 short iPhotInst (Measure *measure) {484 float PhotInst (Measure *measure) { 478 485 479 486 int Np; … … 481 488 482 489 Np = photcodes[0].hashcode[measure[0].source]; 483 if (Np == -1) return (NO_MAG );490 if (Np == -1) return (NO_MAG_PS); 484 491 485 492 if (photcodes[0].code[Np].type == PHOT_REF) { 486 M = measure[0].M ;493 M = measure[0].M_PS; 487 494 return (M); 488 495 } 489 496 490 M = measure[0].M - measure[0].dt - iZERO_POINT;497 M = measure[0].M_PS - measure[0].dt_PS - ZERO_POINT; 491 498 492 499 return (M); … … 494 501 } 495 502 496 short iPhotCat (Measure *measure) {503 float PhotCat (Measure *measure) { 497 504 498 505 int Np; 499 short Mcat;506 float Mcat; 500 507 PhotCode *code; 501 508 502 509 Np = photcodes[0].hashcode[measure[0].source]; 503 if (Np == -1) return (NO_MAG );510 if (Np == -1) return (NO_MAG_PS); 504 511 505 512 if (photcodes[0].code[Np].type == PHOT_REF) { 506 Mcat = measure[0].M ;513 Mcat = measure[0].M_PS; 507 514 return (Mcat); 508 515 } 509 516 code = &photcodes[0].code[Np]; 510 Mcat = measure[0].M - iZERO_POINT + code[0].K*(measure[0].airmass - 1000) +code[0].C;517 Mcat = measure[0].M_PS - ZERO_POINT + code[0].K*(measure[0].airmass_PS - 1.000) + F_PS*code[0].C; 511 518 512 519 return (Mcat); 513 520 } 514 521 515 short iPhotSys (Measure *measure, Average *average, SecFilt *secfilt) {522 float PhotSys (Measure *measure, Average *average, SecFilt *secfilt) { 516 523 517 524 int i, Np; 518 short Mcat, Mcol, Msys, mc; 519 double Mc; 525 float Mcat, Mcol, Msys, mc, Mc; 520 526 PhotCode *code; 521 527 522 528 Np = photcodes[0].hashcode[measure[0].source]; 523 if (Np == -1) return (NO_MAG );529 if (Np == -1) return (NO_MAG_PS); 524 530 525 531 if (photcodes[0].code[Np].type == PHOT_REF) { 526 Msys = measure[0].M ;532 Msys = measure[0].M_PS; 527 533 return (Msys); 528 534 } 529 535 code = &photcodes[0].code[Np]; 530 Mcat = measure[0].M - iZERO_POINT + code[0].K*(measure[0].airmass - 1000.0) +code[0].C;536 Mcat = measure[0].M_PS - ZERO_POINT + code[0].K*(measure[0].airmass_PS - 1.000) + F_PS*code[0].C; 531 537 532 538 /* for DEP, color must be made of PRI/SEC */ 533 539 mc = iPhotColor (average, secfilt, NULL, code); 534 if (mc == NO_MAG ) return (Mcat);535 mc = mc - code[0].dX;540 if (mc == NO_MAG_PS) return (Mcat); 541 mc = mc - F_PS*code[0].dX; 536 542 537 543 Mc = mc; … … 539 545 for (i = 0; i < code[0].Nc; i++) { 540 546 Mcol += code[0].X[i]*Mc; 541 Mc *= mc * 0.001; /* the 0.001 is needed for higher order terms to keep the units mag = mag^n */547 Mc *= mc; 542 548 } 543 549 Msys = Mcat + Mcol; … … 545 551 } 546 552 547 short iPhotRel (Measure *measure, Average *average, SecFilt *secfilt) {553 float PhotRel (Measure *measure, Average *average, SecFilt *secfilt) { 548 554 549 555 int i, Np; 550 short Mcat, Mcol, Mrel, mc; 551 double Mc; 556 float Mcat, Mcol, Mrel, mc, Mc; 552 557 PhotCode *code; 553 558 554 559 Np = photcodes[0].hashcode[measure[0].source]; 555 if (Np == -1) return (NO_MAG );560 if (Np == -1) return (NO_MAG_PS); 556 561 557 562 if (photcodes[0].code[Np].type == PHOT_REF) { 558 Mcat = measure[0].M ;563 Mcat = measure[0].M_PS; 559 564 return (Mcat); 560 565 } 561 566 code = &photcodes[0].code[Np]; 562 Mrel = measure[0].M - iZERO_POINT + code[0].K*(measure[0].airmass - 1000.0) + code[0].C - measure[0].Mcal;567 Mrel = measure[0].M_PS - ZERO_POINT + code[0].K*(measure[0].airmass_PS - 1.000) + F_PS*code[0].C - measure[0].Mcal_PS; 563 568 564 569 /* for DEP, color must be made of PRI/SEC */ 565 570 mc = iPhotColor (average, secfilt, NULL, code); 566 if (mc == NO_MAG ) return (Mrel);567 mc = mc - code[0].dX;571 if (mc == NO_MAG_PS) return (Mrel); 572 mc = mc - F_PS*code[0].dX; 568 573 569 574 Mc = mc; … … 571 576 for (i = 0; i < code[0].Nc; i++) { 572 577 Mcol += code[0].X[i]*Mc; 573 Mc *= mc * 0.001; /* the 0.001 is needed for higher order terms to keep the units mag = mag^n */578 Mc *= mc; /* the 0.001 is needed for higher order terms to keep the units mag = mag^n */ 574 579 } 575 580 Mrel += Mcol; … … 578 583 579 584 /* return calibrated magnitude from measure for given photcode */ 580 short iPhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code) {585 float PhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code) { 581 586 582 587 int i, Np; 583 short Mcal, Mrel, Mcol, mc; 584 double Mc; 588 float Mcal, Mrel, Mcol, mc, Mc; 585 589 586 590 /* code must be the matching PRI/SEC code for this measurement or an equivalent ALT */ 587 591 Np = photcodes[0].hashcode[thisone[0].source]; 588 592 if (Np == -1) { 589 return (NO_MAG );593 return (NO_MAG_PS); 590 594 } 591 595 592 596 if (photcodes[0].code[Np].type == PHOT_REF) { 593 Mrel = thisone[0].M ;597 Mrel = thisone[0].M_PS; 594 598 return (Mrel); 595 599 } 596 600 if (code[0].code != photcodes[0].code[Np].equiv) { 597 return (NO_MAG );598 } 599 600 Mcal = iPhotRel (thisone, average, secfilt) +code[0].C;601 return (NO_MAG_PS); 602 } 603 604 Mcal = PhotRel (thisone, average, secfilt) + F_PS*code[0].C; 601 605 602 606 mc = iPhotColor (average, secfilt, measure, code); 603 if (mc == NO_MAG ) return (Mcal);604 mc = mc - code[0].dX;607 if (mc == NO_MAG_PS) return (Mcal); 608 mc = mc - F_PS*code[0].dX; 605 609 606 610 Mc = mc; … … 608 612 for (i = 0; i < code[0].Nc; i++) { 609 613 Mcol += code[0].X[i]*Mc; 610 Mc *= mc * 0.001; /* the 0.001 is needed for higher order terms to keep the units mag = mag^n */614 Mc *= mc; 611 615 } 612 616 Mcal += Mcol; … … 615 619 616 620 /* color term may not use DEP magnitude */ 617 short iPhotColor (Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code) {621 float iPhotColor (Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code) { 618 622 619 623 int i, Ns1, Ns2, Ns; 620 short m1, m2, mc;624 float m1, m2, mc; 621 625 PhotCode *color; 622 626 623 m1 = m2 = NO_MAG ;627 m1 = m2 = NO_MAG_PS; 624 628 625 629 if (measure == NULL) { … … 627 631 Ns2 = photcodes[0].hashNsec[code[0].c2]; 628 632 629 m1 = (Ns1 == -1) ? average[0].M : secfilt[Ns1].M;630 m2 = (Ns2 == -1) ? average[0].M : secfilt[Ns2].M;631 mc = ((m1 == NO_MAG ) || (m2 == NO_MAG)) ? NO_MAG: (m1 - m2);633 m1 = (Ns1 == -1) ? average[0].M_PS : secfilt[Ns1].M_PS; 634 m2 = (Ns2 == -1) ? average[0].M_PS : secfilt[Ns2].M_PS; 635 mc = ((m1 == NO_MAG_PS) || (m2 == NO_MAG_PS)) ? NO_MAG_PS : (m1 - m2); 632 636 return (mc); 633 637 } … … 635 639 /* find magnitude matching first color term */ 636 640 color = GetPhotcodebyCode (code[0].c1); 637 if (color == NULL) return (NO_MAG );641 if (color == NULL) return (NO_MAG_PS); 638 642 if (color[0].type == PHOT_REF) { 639 for (i = 0; (i < average[0].Nm) && (m1 == NO_MAG ); i++) {643 for (i = 0; (i < average[0].Nm) && (m1 == NO_MAG_PS); i++) { 640 644 if (measure[i].source == color[0].code) { 641 m1 = measure[i].M ;645 m1 = measure[i].M_PS; 642 646 } 643 647 } 644 648 } else { 645 649 Ns = photcodes[0].hashNsec[color[0].code]; 646 m1 = (Ns == -1) ? average[0].M : secfilt[Ns].M;650 m1 = (Ns == -1) ? average[0].M_PS : secfilt[Ns].M_PS; 647 651 } 648 652 649 653 /* find magnitude matching second color term */ 650 654 color = GetPhotcodebyCode (code[0].c2); 651 if (color == NULL) return (NO_MAG );655 if (color == NULL) return (NO_MAG_PS); 652 656 if (color[0].type == PHOT_REF) { 653 for (i = 0; (i < average[0].Nm) && (m2 == NO_MAG ); i++) {657 for (i = 0; (i < average[0].Nm) && (m2 == NO_MAG_PS); i++) { 654 658 if (measure[i].source == color[0].code) { 655 m2 = measure[i].M ;659 m2 = measure[i].M_PS; 656 660 } 657 661 } 658 662 } else { 659 663 Ns = photcodes[0].hashNsec[color[0].code]; 660 m2 = (Ns == -1) ? average[0].M : secfilt[Ns].M;664 m2 = (Ns == -1) ? average[0].M_PS : secfilt[Ns].M_PS; 661 665 } 662 mc = ((m1 == NO_MAG ) || (m2 == NO_MAG)) ? NO_MAG: (m1 - m2);666 mc = ((m1 == NO_MAG_PS) || (m2 == NO_MAG_PS)) ? NO_MAG_PS : (m1 - m2); 663 667 return (mc); 664 668 } 665 669 666 670 /* return calibrated magnitude from average/secfilt for given photcode */ 667 short iPhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure) {671 float PhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure) { 668 672 669 673 int i, Ns; … … 672 676 673 677 Ns = photcodes[0].hashNsec[code[0].code]; 674 Mave = (Ns == -1) ? average[0].M : secfilt[Ns].M;675 Mref = Mave + code[0].C;678 Mave = (Ns == -1) ? average[0].M_PS : secfilt[Ns].M_PS; 679 Mref = Mave + F_PS*code[0].C; 676 680 677 681 mc = iPhotColor (average, secfilt, measure, code); 678 if (mc == NO_MAG ) return (Mref);679 mc = mc - code[0].dX;682 if (mc == NO_MAG_PS) return (Mref); 683 mc = mc - F_PS*code[0].dX; 680 684 681 685 Mc = mc; … … 683 687 for (i = 0; i < code[0].Nc; i++) { 684 688 Mcol += code[0].X[i]*Mc; 685 Mc *= mc * 0.001; /* the 0.001 is needed for higher order terms to keep the units mag = mag^n */689 Mc *= mc; /* the 0.001 is needed for higher order terms to keep the units mag = mag^n */ 686 690 } 687 691 Mref += Mcol; … … 690 694 691 695 /***/ 692 short iPhotAve (PhotCode *code, Average *average, SecFilt *secfilt) {696 float PhotAve (PhotCode *code, Average *average, SecFilt *secfilt) { 693 697 694 698 int Ns; … … 696 700 697 701 Ns = photcodes[0].hashNsec[code[0].code]; 698 Mave = (Ns == -1) ? average[0].M : secfilt[Ns].M;702 Mave = (Ns == -1) ? average[0].M_PS : secfilt[Ns].M_PS; 699 703 return (Mave); 700 704 } 701 705 702 706 /*** note that this is NOT a wrapper around iPhotdM ***/ 703 short iPhotdM (PhotCode *code, Average *average, SecFilt *secfilt) {707 float PhotdM (PhotCode *code, Average *average, SecFilt *secfilt) { 704 708 705 709 int Ns; … … 707 711 708 712 Ns = photcodes[0].hashNsec[code[0].code]; 709 dM = (Ns == -1) ? average[0].dM : secfilt[Ns].dM;713 dM = (Ns == -1) ? average[0].dM_PS : secfilt[Ns].dM_PS; 710 714 return (dM); 711 715 } 712 716 713 717 /*** note that this is NOT a wrapper around iPhotXm ***/ 714 short iPhotXm (PhotCode *code, Average *average, SecFilt *secfilt) {718 float PhotXm (PhotCode *code, Average *average, SecFilt *secfilt) { 715 719 716 720 int Ns; 717 short Xm; 721 short Mi; 722 float Xm; 718 723 719 724 Ns = photcodes[0].hashNsec[code[0].code]; 720 Xm = (Ns == -1) ? average[0].Xm : secfilt[Ns].Xm; 725 Mi = (Ns == -1) ? average[0].Xm : secfilt[Ns].Xm; 726 Xm = (Mi == NO_MAG_PS) ? -1.0 : pow (10.0, 0.01*Mi); 721 727 return (Xm); 722 728 } … … 734 740 for (i = 0; i < average[0].Nm; i++) { 735 741 if (measure[i].source == c1) { 736 M1 = 0.001*measure[i].M;742 M1 = measure[i].M_PS; 737 743 goto filter1; 738 744 } … … 741 747 } else { 742 748 Ns = photcodes[0].hashNsec[code[0].code]; 743 M1 = (Ns == -1) ? 0.001*average[0].M : 0.001*secfilt[Ns].M;749 M1 = (Ns == -1) ? average[0].M_PS : secfilt[Ns].M_PS; 744 750 } 745 751 … … 750 756 for (i = 0; i < average[0].Nm; i++) { 751 757 if (measure[i].source == c2) { 752 M2 = 0.001*measure[i].M;758 M2 = measure[i].M_PS; 753 759 goto filter2; 754 760 } … … 757 763 } else { 758 764 Ns = photcodes[0].hashNsec[code[0].code]; 759 M2 = (Ns == -1) ? 0.001*average[0].M : 0.001*secfilt[Ns].M;765 M2 = (Ns == -1) ? average[0].M_PS : secfilt[Ns].M_PS; 760 766 } 761 767 -
trunk/Ohana/src/libohana/src/dvo_convert_elixir.c
r4830 r4865 13 13 out[i].dR_PS = in[i].dR * 0.01; 14 14 out[i].dD_PS = in[i].dD * 0.01; 15 out[i].M = in[i].M; 16 out[i].Mcal = in[i].Mcal; 17 out[i].Mgal = in[i].Mgal; 18 out[i].airmass = in[i].airmass; 15 out[i].M_PS = in[i].M * 0.001; 16 out[i].dM_PS = in[i].dM * 0.001; 17 out[i].dt_PS = in[i].dt * 0.001; 18 out[i].Mcal_PS = in[i].Mcal * 0.001; 19 out[i].Mgal_PS = in[i].Mgal * 0.001; 20 out[i].airmass_PS = in[i].airmass * 0.001; 19 21 out[i].FWx = in[i].FWx; 20 out[i].dM = in[i].dM; 21 out[i].fwy = in[i].fwy; 22 out[i].FWy = in[i].fwy * in[i].FWx * 0.01; 22 23 out[i].theta = in[i].theta; 23 24 out[i].dophot = in[i].dophot; … … 25 26 out[i].t = in[i].t; 26 27 out[i].averef = in[i].averef; 27 out[i].dt = in[i].dt;28 28 out[i].flags = in[i].flags; 29 29 } … … 42 42 out[i].dR = in[i].dR_PS * 100.0; 43 43 out[i].dD = in[i].dD_PS * 100.0; 44 out[i].M = in[i].M; 45 out[i].Mcal = in[i].Mcal; 46 out[i].Mgal = in[i].Mgal; 47 out[i].airmass = in[i].airmass; 44 out[i].M = in[i].M_PS * 1000.0; 45 out[i].dM = in[i].dM_PS * 1000.0; 46 out[i].dt = in[i].dt_PS * 1000.0; 47 out[i].Mcal = in[i].Mcal_PS * 1000.0; 48 out[i].Mgal = in[i].Mgal_PS * 1000.0; 49 out[i].airmass = in[i].airmass_PS * 1000.0; 48 50 out[i].FWx = in[i].FWx; 49 out[i].dM = in[i].dM; 50 out[i].fwy = in[i].fwy; 51 out[i].fwy = 100.0 * in[i].FWy / in[i].FWx; 51 52 out[i].theta = in[i].theta; 52 53 out[i].dophot = in[i].dophot; … … 54 55 out[i].t = in[i].t; 55 56 out[i].averef = in[i].averef; 56 out[i].dt = in[i].dt;57 57 out[i].flags = in[i].flags; 58 58 } … … 70 70 out[i].R_PS = in[i].R; 71 71 out[i].D_PS = in[i].D; 72 out[i].M = in[i].M; 72 out[i].M_PS = in[i].M * 0.001; 73 out[i].dM_PS = in[i].dM * 0.001; 73 74 out[i].Xp = in[i].Xp; 74 75 out[i].Xm = in[i].Xm; … … 78 79 out[i].offset = in[i].offset; 79 80 out[i].missing = in[i].missing; 80 out[i].dM = in[i].dM;81 81 out[i].Xg = in[i].Xg; 82 82 } … … 94 94 out[i].R = in[i].R_PS; 95 95 out[i].D = in[i].D_PS; 96 out[i].M = in[i].M; 96 out[i].M = in[i].M_PS * 1000.0; 97 out[i].dM = in[i].dM_PS * 1000.0; 97 98 out[i].Xp = in[i].Xp; 98 99 out[i].Xm = in[i].Xm; … … 102 103 out[i].offset = in[i].offset; 103 104 out[i].missing = in[i].missing; 104 out[i].dM = in[i].dM;105 105 out[i].Xg = in[i].Xg; 106 106 } -
trunk/Ohana/src/libohana/src/dvo_convert_loneos.c
r4830 r4865 13 13 out[i].dR_PS = in[i].dR * 0.01; 14 14 out[i].dD_PS = in[i].dD * 0.01; 15 out[i].M = in[i].M;16 out[i]. Mcal = in[i].Mcal;17 out[i]. dM = in[i].dM;15 out[i].M_PS = in[i].M * 0.001; 16 out[i].dM_PS = in[i].dM * 0.001; 17 out[i].Mcal_PS = in[i].Mcal * 0.001; 18 18 out[i].dophot = in[i].dophot; 19 19 out[i].source = in[i].source; … … 25 25 26 26 /* these values don't exist in the Loneos format */ 27 out[i].Mgal = in[i].M;28 out[i].dt = 0;29 out[i].airmass = 0;30 out[i].FWx = 0;31 out[i]. fwy= 0;32 out[i].theta = 0;27 out[i].Mgal_PS = in[i].M; 28 out[i].dt_PS = 0; 29 out[i].airmass_PS = 0; 30 out[i].FWx = 0; 31 out[i].FWy = 0; 32 out[i].theta = 0; 33 33 } 34 34 return (out); … … 46 46 out[i].dR = in[i].dR_PS * 100.0; 47 47 out[i].dD = in[i].dD_PS * 100.0; 48 out[i].M = in[i].M ;49 out[i].dM = in[i].dM ;50 out[i].Mcal = in[i].Mcal ;48 out[i].M = in[i].M_PS * 1000.0; 49 out[i].dM = in[i].dM_PS * 1000.0; 50 out[i].Mcal = in[i].Mcal_PS * 1000.0; 51 51 out[i].dophot = in[i].dophot; 52 52 out[i].source = in[i].source; … … 67 67 68 68 for (i = 0; i < Nvalues; i++) { 69 out[i].R_PS = in[i].R;70 out[i].D_PS = in[i].D;71 out[i].M = in[i].M;69 out[i].R_PS = in[i].R; 70 out[i].D_PS = in[i].D; 71 out[i].M_PS = in[i].M * 0.001; 72 72 out[i].Xp = in[i].Xp; 73 73 out[i].Xm = in[i].Xm; … … 79 79 80 80 /* these don't exist in Loneos */ 81 out[i].dM = 0xffff;81 out[i].dM_PS = 0xffff; 82 82 out[i].Xg = 0xffff; 83 83 } … … 95 95 out[i].R = in[i].R_PS; 96 96 out[i].D = in[i].D_PS; 97 out[i].M = in[i].M ;97 out[i].M = in[i].M_PS * 1000.0; 98 98 out[i].Xp = in[i].Xp; 99 99 out[i].Xm = in[i].Xm; -
trunk/Ohana/src/libohana/src/dvo_convert_panstarrs.c
r4830 r4865 8 8 Measure *out; 9 9 10 /*** note that these structures are identical ***/ 11 10 12 ALLOCATE (out, Measure, Nvalues); 11 13 12 14 for (i = 0; i < Nvalues; i++) { 13 out[i].dR_PS = in[i].dR;14 out[i].dD_PS = in[i].dD;15 out[i].M = in[i].M;16 out[i]. Mcal = in[i].Mcal;17 out[i].M gal = in[i].Mgal;18 out[i]. airmass = in[i].airmass;19 out[i]. FWx = in[i].FWx;20 out[i].d M = in[i].dM;21 out[i]. fwy = in[i].fwy;22 out[i]. theta = in[i].theta;23 out[i]. dophot = in[i].dophot;24 out[i]. source = in[i].source;25 out[i]. t = in[i].t;26 out[i]. averef = in[i].averef;27 out[i]. dt = in[i].dt;28 out[i].flags = in[i].flags;15 out[i].dR_PS = in[i].dR; 16 out[i].dD_PS = in[i].dD; 17 out[i].M_PS = in[i].M; 18 out[i].dM_PS = in[i].dM; 19 out[i].Mcal_PS = in[i].Mcal; 20 out[i].Mgal_PS = in[i].Mgal; 21 out[i].airmass_PS = in[i].airmass; 22 out[i].dt_PS = in[i].dt; 23 out[i].FWx = in[i].FWx; 24 out[i].FWy = in[i].FWy; 25 out[i].theta = in[i].theta; 26 out[i].dophot = in[i].dophot; 27 out[i].source = in[i].source; 28 out[i].t = in[i].t; 29 out[i].averef = in[i].averef; 30 out[i].flags = in[i].flags; 29 31 } 30 32 return (out); … … 42 44 out[i].dR = in[i].dR_PS; 43 45 out[i].dD = in[i].dD_PS; 44 out[i].M = in[i].M; 45 out[i].Mcal = in[i].Mcal; 46 out[i].Mgal = in[i].Mgal; 47 out[i].airmass = in[i].airmass; 46 out[i].M = in[i].M_PS; 47 out[i].dM = in[i].dM_PS; 48 out[i].Mcal = in[i].Mcal_PS; 49 out[i].Mgal = in[i].Mgal_PS; 50 out[i].airmass = in[i].airmass_PS; 51 out[i].dt = in[i].dt_PS; 48 52 out[i].FWx = in[i].FWx; 49 out[i].dM = in[i].dM; 50 out[i].fwy = in[i].fwy; 53 out[i].FWy = in[i].FWy; 51 54 out[i].theta = in[i].theta; 52 55 out[i].dophot = in[i].dophot; … … 54 57 out[i].t = in[i].t; 55 58 out[i].averef = in[i].averef; 56 out[i].dt = in[i].dt;57 59 out[i].flags = in[i].flags; 58 60 } … … 68 70 69 71 for (i = 0; i < Nvalues; i++) { 70 out[i].R_PS = in[i].R; 71 out[i].D_PS = in[i].D; 72 out[i].M = in[i].M; 72 out[i].R_PS = in[i].R; 73 out[i].D_PS = in[i].D; 74 out[i].M_PS = in[i].M; 75 out[i].dM_PS = in[i].dM; 73 76 out[i].Xp = in[i].Xp; 74 77 out[i].Xm = in[i].Xm; 78 out[i].Xg = in[i].Xg; 75 79 out[i].Nm = in[i].Nm; 76 80 out[i].Nn = in[i].Nn; … … 78 82 out[i].offset = in[i].offset; 79 83 out[i].missing = in[i].missing; 80 out[i].dM = in[i].dM;81 out[i].Xg = in[i].Xg;82 84 } 83 85 return (out); … … 94 96 out[i].R = in[i].R_PS; 95 97 out[i].D = in[i].D_PS; 96 out[i].M = in[i].M; 98 out[i].M = in[i].M_PS; 99 out[i].dM = in[i].dM_PS; 97 100 out[i].Xp = in[i].Xp; 98 101 out[i].Xm = in[i].Xm; 102 out[i].Xg = in[i].Xg; 99 103 out[i].Nm = in[i].Nm; 100 104 out[i].Nn = in[i].Nn; … … 102 106 out[i].offset = in[i].offset; 103 107 out[i].missing = in[i].missing; 104 out[i].dM = in[i].dM;105 out[i].Xg = in[i].Xg;106 108 } 107 109 return (out); -
trunk/Ohana/src/mosastro/src/gptolemy.c
r4828 r4865 34 34 stars[i].R = catalog.average[i].R_PS; 35 35 stars[i].D = catalog.average[i].D_PS; 36 stars[i].Mag = 0.001*catalog.measure[catalog.average[i].offset].M;36 stars[i].Mag = catalog.measure[catalog.average[i].offset].M_PS; 37 37 } 38 38 free (catalog.average); -
trunk/Ohana/src/opihi/dvo/calextract.c
r4834 r4865 94 94 if (catalog.measure[m+j].source != code[1][0].code) continue; 95 95 M2 = PhotCat (&catalog.measure[m+j]); 96 dM2 = 0.001*catalog.measure[m+j].dM;96 dM2 = catalog.measure[m+j].dM_PS; 97 97 } 98 98 if (M2 == NO_MAG) continue; -
trunk/Ohana/src/opihi/dvo/calmextract.c
r4834 r4865 107 107 if (catalog.measure[m+j].source != code[1][0].code) continue; 108 108 M2 = PhotCat (&catalog.measure[m+j]); 109 dM2 = 0.001*catalog.measure[m+j].dM;109 dM2 = catalog.measure[m+j].dM_PS; 110 110 } 111 111 if (M2 == NO_MAG) continue; -
trunk/Ohana/src/opihi/dvo/catalog.c
r4834 r4865 101 101 if ((Nm = get_argument (argc, argv, "-m"))) { 102 102 remove_argument (Nm, &argc, argv); 103 Mr = 1000*atof(argv[Nm]);103 Mr = atof(argv[Nm]); 104 104 remove_argument (Nm, &argc, argv); 105 Mz = 1000*atof(argv[Nm]);105 Mz = atof(argv[Nm]); 106 106 Mr = Mr - Mz; 107 107 remove_argument (Nm, &argc, argv); … … 200 200 catalog.average[nstar].R_PS = R; 201 201 catalog.average[nstar].D_PS = D; 202 catalog.average[nstar].M = M * 1000.0;202 catalog.average[nstar].M_PS = M; 203 203 nstar++; 204 204 if (nstar == NSTARS - 1) { … … 242 242 catalog.average[nstar].R_PS = R; 243 243 catalog.average[nstar].D_PS = D; 244 catalog.average[nstar].M = M * 1000.0;244 catalog.average[nstar].M_PS = M; 245 245 nstar++; 246 246 if (nstar == NSTARS - 1) { … … 292 292 catalog.average[nstar].R_PS = R; 293 293 catalog.average[nstar].D_PS = D; 294 catalog.average[nstar].M = M * 1000.0;294 catalog.average[nstar].M_PS = M; 295 295 nstar++; 296 296 if (nstar == NSTARS - 1) { … … 346 346 if (IDclip && (catalog.average[i].code != IDchoice)) 347 347 continue; 348 Zvec.elements[N] = MIN (1.0, MAX (0.01, (catalog.average[i].M - Mz) / Mr));348 Zvec.elements[N] = MIN (1.0, MAX (0.01, (catalog.average[i].M_PS - Mz) / Mr)); 349 349 if (LimExclude && (Zvec.elements[N] > 0.99)) continue; 350 350 if (Zvec.elements[N] < 0.011) continue; … … 356 356 case (NUMSCALE): 357 357 for (N = i = 0; i < catalog.Naverage; i++) { 358 if (clip && ((catalog.average[i].M > Mz) || (catalog.average[i].M< Mr+Mz)))358 if (clip && ((catalog.average[i].M_PS > Mz) || (catalog.average[i].M_PS < Mr+Mz))) 359 359 continue; 360 360 if (IDclip && (catalog.average[i].code != IDchoice)) … … 371 371 case (MISSCALE): 372 372 for (N = i = 0; i < catalog.Naverage; i++) { 373 if (clip && ((catalog.average[i].M > Mz) || (catalog.average[i].M< Mr+Mz)))373 if (clip && ((catalog.average[i].M_PS > Mz) || (catalog.average[i].M_PS < Mr+Mz))) 374 374 continue; 375 375 if (IDclip && (catalog.average[i].code != IDchoice)) -
trunk/Ohana/src/opihi/dvo/compare.c
r4800 r4865 38 38 rvec[0].elements[Nmatch] = catlog1[0].average[i].R_PS; 39 39 dvec[0].elements[Nmatch] = catlog1[0].average[i].D_PS; 40 mvec[0].elements[Nmatch] = catlog1[0].average[i].M ;40 mvec[0].elements[Nmatch] = catlog1[0].average[i].M_PS; 41 41 drvec[0].elements[Nmatch] = dX; 42 42 ddvec[0].elements[Nmatch] = dY; 43 dmvec[0].elements[Nmatch] = catlog1[0].average[i].M - catlog2[0].average[j].M;43 dmvec[0].elements[Nmatch] = catlog1[0].average[i].M_PS - catlog2[0].average[j].M_PS; 44 44 Nmatch ++; 45 45 if (Nmatch == NMATCH - 1) { -
trunk/Ohana/src/opihi/dvo/dmt.c
r4834 r4865 88 88 if (catalog.average[i].Nm != 3) continue; 89 89 m = catalog.average[i].offset; 90 M0 = (Ns == -1) ? 0.001*catalog.average[i].M : 0.001*catalog.secfilt[i*Nsec+Ns].M;90 M0 = (Ns == -1) ? catalog.average[i].M_PS : catalog.secfilt[i*Nsec+Ns].M_PS; 91 91 M1 = PhotCat (&catalog.measure[m+0]); 92 92 M2 = PhotCat (&catalog.measure[m+1]); -
trunk/Ohana/src/opihi/dvo/gstar.c
r4833 r4865 142 142 143 143 /* average mags */ 144 print_value (GetOutfile(), 0.001*catalog.average[k].M, catalog.average[k].M);145 for (j = 0; j < Nsec; j++) print_value (GetOutfile(), 0.001*catalog.secfilt[j + Nsec*k].M, catalog.secfilt[j + Nsec*k].M);144 print_value (GetOutfile(), catalog.average[k].M_PS, catalog.average[k].M_PS); 145 for (j = 0; j < Nsec; j++) print_value (GetOutfile(), catalog.secfilt[j + Nsec*k].M_PS, catalog.secfilt[j + Nsec*k].M_PS); 146 146 fprintf (GetOutfile(), "\n"); 147 147 148 148 /* average mag errors */ 149 print_value (GetOutfile(), 0.001*catalog.average[k].dM, catalog.average[k].dM);150 for (j = 0; j < Nsec; j++) print_value (GetOutfile(), 0.001*catalog.secfilt[j + Nsec*k].dM, catalog.secfilt[j + Nsec*k].dM);149 print_value (GetOutfile(), catalog.average[k].dM_PS, catalog.average[k].dM_PS); 150 for (j = 0; j < Nsec; j++) print_value (GetOutfile(), catalog.secfilt[j + Nsec*k].dM_PS, catalog.secfilt[j + Nsec*k].dM_PS); 151 151 fprintf (GetOutfile(), "\n"); 152 152 … … 166 166 date = sec_to_date (catalog.measure[m].t); 167 167 fprintf (GetOutfile(), "%6.3f %6.3f %5.3f %20s %5.2f %5.2f %2d %3x %3d %-20s\n", 168 Mcat, Mrel, 0.001*catalog.measure[m].dM,168 Mcat, Mrel, catalog.measure[m].dM_PS, 169 169 date, catalog.measure[m].dR_PS, catalog.measure[m].dD_PS, 170 170 catalog.measure[m].dophot, catalog.measure[m].flags, … … 176 176 vec1[0].elements[N] = Mcat; 177 177 vec2[0].elements[N] = catalog.measure[m].t; 178 vec3[0].elements[N] = 0.001*catalog.measure[m].airmass;178 vec3[0].elements[N] = catalog.measure[m].airmass_PS; 179 179 vec4[0].elements[N] = catalog.measure[m].source; 180 180 N ++; -
trunk/Ohana/src/opihi/dvo/imdata.c
r4834 r4865 154 154 for (i = 0; i < catalog.Nmeasure; i++) { 155 155 if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue; 156 vec[0].elements[N] = catalog.measure[i].M / 1000.0;156 vec[0].elements[N] = catalog.measure[i].M_PS; 157 157 N++; 158 158 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000); … … 162 162 for (i = 0; i < catalog.Nmeasure; i++) { 163 163 if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue; 164 vec[0].elements[N] = catalog.measure[i].dM / 1000.0;164 vec[0].elements[N] = catalog.measure[i].dM_PS; 165 165 N++; 166 166 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000); … … 170 170 for (i = 0; i < catalog.Nmeasure; i++) { 171 171 if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue; 172 vec[0].elements[N] = catalog.measure[i].Mcal / 1000.0;172 vec[0].elements[N] = catalog.measure[i].Mcal_PS; 173 173 N++; 174 174 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000); … … 179 179 if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue; 180 180 n = catalog.measure[i].averef; 181 vec[0].elements[N] = catalog.average[n].M / 1000.0;181 vec[0].elements[N] = catalog.average[n].M_PS; 182 182 N++; 183 183 } -
trunk/Ohana/src/opihi/dvo/lcurve.c
r4834 r4865 134 134 m = catalog.average[N1[i]].offset; 135 135 for (j = 0; j < catalog.average[N1[i]].Nm; j++, m++) { 136 if (ErrorBars) dYvec.elements[N] = 0.001*catalog.measure[m].dM;136 if (ErrorBars) dYvec.elements[N] = catalog.measure[m].dM_PS; 137 137 Xvec.elements[N] = TimeValue (catalog.measure[m].t, TimeReference, TimeFormat); 138 138 Yvec.elements[N] = PhotCat (&catalog.measure[m]); -
trunk/Ohana/src/opihi/dvo/lightcurve.c
r4834 r4865 123 123 124 124 tvec[0].elements[N] = TimeValue (catalog.measure[m].t, TimeReference, TimeFormat); 125 dmvec[0].elements[N] = 0.001*catalog.measure[m].dM;125 dmvec[0].elements[N] = catalog.measure[m].dM_PS; 126 126 if (RELPHOT) { 127 127 mvec[0].elements[N] = PhotCat (&catalog.measure[m]); -
trunk/Ohana/src/opihi/dvo/photometry.c
r4800 r4865 22 22 if (TimeSelect && (M.t < tzero)) continue; \ 23 23 if (TimeSelect && (M.t > tend)) continue; \ 24 if (ErrSelect && (M.dM > ErrValue)) continue; \24 if (ErrSelect && (M.dM_PS > ErrValue)) continue; \ 25 25 if (TypeSelect && (TypeValue != GetMeasureTypeCode (&M))) continue; \ 26 26 if (iMagSelect && (PhotInst (&M) < iMagMin)) continue; \ … … 432 432 if ((N = get_argument (*argc, argv, "-errorlim"))) { 433 433 remove_argument (N, argc, argv); 434 ErrValue = 1000*atof (argv[N]);434 ErrValue = atof (argv[N]); 435 435 remove_argument (N, argc, argv); 436 436 ErrSelect = TRUE; … … 622 622 for (i = 0; i < average[0].Nm; i++) { 623 623 if ((code != NULL) && (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].source))) continue; 624 if (ErrSelect && (measure[i].dM > ErrValue)) continue;624 if (ErrSelect && (measure[i].dM_PS > ErrValue)) continue; 625 625 if (FlagSelect && (measure[i].flags != FlagValue)) continue; 626 626 if (TypeSelect && (TypeValue != GetMeasureTypeCode (&measure[i]))) continue; … … 789 789 /* for ErrSelect, check average errors */ 790 790 if (ErrSelect) { 791 dM = iPhotdM (code, average, secfilt);791 dM = PhotdM (code, average, secfilt); 792 792 if (dM > ErrValue) return (NO_MAG); 793 793 } … … 847 847 average[].M is stored as 1000*mag where mag is PhotAbs 848 848 measure[].M for PHOT_REL is the same 849 XXX EAM : note that we are transitioning away from millimag internal storage 849 850 */ 850 851 … … 1063 1064 break; 1064 1065 case MEAS_dMAG: /* OK */ 1065 value = 0.001*measure[0].dM;1066 value = measure[0].dM_PS; 1066 1067 break; 1067 1068 case MEAS_AIRMASS: /* OK */ 1068 value = 0.001*measure[0].airmass;1069 value = measure[0].airmass_PS; 1069 1070 break; 1070 1071 case MEAS_EXPTIME: /* OK */ 1071 value = pow (10.0, measure[0].dt * 0.0004);1072 value = pow (10.0, measure[0].dt_PS * 0.4); 1072 1073 break; 1073 1074 case MEAS_PHOTCODE: /* OK */ -
trunk/Ohana/src/relphot/include/relphot.h
r4864 r4865 15 15 unsigned int start; 16 16 unsigned int stop; 17 short int Mcal;18 short int dMcal;19 short intXm;20 short int secz;17 float Mcal; 18 float dMcal; 19 short Xm; 20 float secz; 21 21 char code; 22 22 Coords coords; … … 133 133 int gcatalog PROTO((Catalog *catalog, int FINAL)); 134 134 Coords *getCoords PROTO((int meas, int cat)); 135 short getMcal PROTO((int meas, int cat));136 short getMgrid PROTO((int meas, int cat));137 short getMmos PROTO((int meas, int cat));138 short getMrel PROTO((Catalog *catalog, int meas, int cat));135 float getMcal PROTO((int meas, int cat)); 136 float getMgrid PROTO((int meas, int cat)); 137 float getMmos PROTO((int meas, int cat)); 138 float getMrel PROTO((Catalog *catalog, int meas, int cat)); 139 139 GSCRegion *get_regions PROTO((double minRa, double maxRa, double minDec, double maxDec, int *Nregions)); 140 140 void getfullregion PROTO((Image *image, int Nimage, GSCRegion *fullregion)); -
trunk/Ohana/src/relphot/src/ConfigInit.c
r4828 r4865 22 22 GetConfig (config, "IMAGE_SCATTER", "%lf", 0, &IMAGE_SCATTER); 23 23 GetConfig (config, "IMAGE_OFFSET", "%lf", 0, &IMAGE_OFFSET); 24 MAG_LIM *= 1000; 25 SIGMA_LIM *= 1000; 26 STAR_SCATTER *= 1000; 24 27 25 IMAGE_SCATTER *= 1000; 28 26 IMAGE_OFFSET *= 1000; -
trunk/Ohana/src/relphot/src/GridOps.v2.c
r4796 r4865 2 2 3 3 static int Ngrid; 4 static short *gridM;5 static short *gridS;4 static float *gridM; 5 static float *gridS; 6 6 static int *gridN; 7 7 static int gridX; … … 36 36 Ngrid = gridX * gridY; 37 37 38 ALLOCATE (gridM, short, Ngrid);39 ALLOCATE (gridS, short, Ngrid);38 ALLOCATE (gridM, float, Ngrid); 39 ALLOCATE (gridS, float, Ngrid); 40 40 ALLOCATE (gridN, int, Ngrid); 41 bzero (gridM, Ngrid*sizeof( short));42 bzero (gridS, Ngrid*sizeof( short));41 bzero (gridM, Ngrid*sizeof(float)); 42 bzero (gridS, Ngrid*sizeof(float)); 43 43 bzero (gridN, Ngrid*sizeof(int)); 44 44 … … 87 87 Ngrid = gridX * gridY; 88 88 89 ALLOCATE (gridM, short, Ngrid);90 ALLOCATE (gridS, short, Ngrid);89 ALLOCATE (gridM, float, Ngrid); 90 ALLOCATE (gridS, float, Ngrid); 91 91 ALLOCATE (gridN, int, Ngrid); 92 bzero (gridM, Ngrid*sizeof( short));93 bzero (gridS, Ngrid*sizeof( short));92 bzero (gridM, Ngrid*sizeof(float)); 93 bzero (gridS, Ngrid*sizeof(float)); 94 94 bzero (gridN, Ngrid*sizeof(int)); 95 95 … … 232 232 # endif 233 233 234 short getMgrid (int meas, int cat) {234 float getMgrid (int meas, int cat) { 235 235 236 236 int i; 237 short value;237 float value; 238 238 239 239 if (!USE_GRID) return (0); … … 250 250 int i, j, m, c, n, N, Nmax; 251 251 double *list, *dlist; 252 short Msys, Mrel, Mcal, Mmos;252 float Msys, Mrel, Mcal, Mmos; 253 253 StatType stats; 254 254 … … 276 276 277 277 n = catalog[c].measure[m].averef; 278 Msys = iPhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]);278 Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]); 279 279 list[N] = Msys - Mrel - Mcal - Mmos; 280 dlist[N] = MAX (catalog[c].measure[m].dM , MIN_ERROR);280 dlist[N] = MAX (catalog[c].measure[m].dM_PS, MIN_ERROR); 281 281 N++; 282 282 } … … 294 294 295 295 int i, j, m, c, n, N; 296 short Msys, Mrel, Mcal, Mmos;296 float Msys, Mrel, Mcal, Mmos; 297 297 double *xlist, *Mlist, *dlist, *ylist; 298 298 Graphdata graphdata; … … 322 322 323 323 n = catalog[c].measure[m].averef; 324 Msys = iPhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]);324 Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]); 325 325 326 326 xlist[N] = Xmeas[c][m]; … … 328 328 Mlist[N] = Msys - Mrel - Mcal - Mmos; 329 329 dlist[N] = Msys - Mrel - Mcal - Mmos - gridM[i]; 330 Mlist[N] *= 0.001;331 dlist[N] *= 0.001;332 330 N++; 333 331 } -
trunk/Ohana/src/relphot/src/ImageOps.c
r4796 r4865 136 136 } 137 137 138 short getMcal (int meas, int cat) {138 float getMcal (int meas, int cat) { 139 139 140 140 int i; 141 short value;141 float value; 142 142 143 143 i = bin[cat][meas]; … … 145 145 146 146 if (image[i].code & IMAGE_BAD) return (NO_MAG); 147 value = image[i].Mcal;147 value = 0.001*image[i].Mcal; 148 148 return (value); 149 149 } … … 162 162 163 163 int i, j, m, c, n, N, Nmax, mark, bad; 164 short Msys, Mrel, Mmos, Mgrid;164 float Msys, Mrel, Mmos, Mgrid; 165 165 double *list, *dlist; 166 166 StatType stats; … … 199 199 200 200 n = catalog[c].measure[m].averef; 201 Msys = iPhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]);201 Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]); 202 202 list[N] = Msys - Mrel - Mmos - Mgrid; 203 dlist[N] = MAX (catalog[c].measure[m].dM , MIN_ERROR);203 dlist[N] = MAX (catalog[c].measure[m].dM_PS, MIN_ERROR); 204 204 N++; 205 205 } … … 217 217 218 218 liststats (list, dlist, N, &stats); 219 image[i].Mcal = stats.mean;220 image[i].dMcal = stats.sigma;219 image[i].Mcal = 1000.0*stats.mean; 220 image[i].dMcal = 1000.0*stats.sigma; 221 221 image[i].Xm = 100.0*log10(stats.chisq); 222 222 } -
trunk/Ohana/src/relphot/src/MosaicOps.c
r4864 r4865 134 134 Dmin = MIN (Dmin, D); 135 135 Dmax = MAX (Dmax, D); 136 Mcal += image[m].Mcal;137 dMcal += image[m].dMcal;136 Mcal += 0.001*image[m].Mcal; 137 dMcal += 0.001*image[m].dMcal; 138 138 Xm += image[m].Xm; 139 139 /* we are using mosaic.Mcal, not image.Mcal. reset image.Mcal */ … … 179 179 for (j = 0; j < Nimlist[i]; j++) { 180 180 im = imlist[i][j]; 181 image[im].Mcal = mosaic[i].Mcal;182 image[im].dMcal = mosaic[i].dMcal;181 image[im].Mcal = 1000.0*mosaic[i].Mcal; 182 image[im].dMcal = 1000.0*mosaic[i].dMcal; 183 183 image[im].Xm = mosaic[i].Xm; 184 184 image[im].code |= (mosaic[i].code & ID_IMAGE_FEW); … … 292 292 } 293 293 294 short getMmos (int meas, int cat) {294 float getMmos (int meas, int cat) { 295 295 296 296 int i; 297 short value;297 float value; 298 298 299 299 if (!MOSAICNAME[0]) return (0); … … 309 309 310 310 int i, j, m, c, n, N, Nmax, mark, bad; 311 short Msys, Mrel, Mcal, Mgrid;311 float Msys, Mrel, Mcal, Mgrid; 312 312 double *list, *dlist, *Mlist, *dMlist; 313 313 StatType stats; … … 351 351 352 352 n = catalog[c].measure[m].averef; 353 Msys = iPhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]);353 Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]); 354 354 list[N] = Msys - Mrel - Mcal - Mgrid; 355 dlist[N] = MAX (catalog[c].measure[m].dM , MIN_ERROR);356 Mlist[N] = 0.001*Msys;357 dMlist[N] = 0.001*list[N];355 dlist[N] = MAX (catalog[c].measure[m].dM_PS, MIN_ERROR); 356 Mlist[N] = Msys; 357 dMlist[N] = list[N]; 358 358 N++; 359 359 } -
trunk/Ohana/src/relphot/src/StarOps.c
r4796 r4865 20 20 } 21 21 22 short getMrel (Catalog *catalog, int meas, int cat) {22 float getMrel (Catalog *catalog, int meas, int cat) { 23 23 24 24 int ave; 25 short value;25 float value; 26 26 27 27 ave = catalog[cat].measure[meas].averef; 28 28 if (catalog[cat].average[ave].code & STAR_BAD) return (NO_MAG); 29 29 30 value = PhotPrimary ? catalog[cat].average[ave].M : catalog[cat].secfilt[PhotNsec*ave+PhotSec].M;30 value = PhotPrimary ? catalog[cat].average[ave].M_PS : catalog[cat].secfilt[PhotNsec*ave+PhotSec].M_PS; 31 31 return (value); 32 32 } … … 35 35 36 36 int i, j, k, m, N; 37 short Msys, Mcal, Mmos, Mgrid;37 float Msys, Mcal, Mmos, Mgrid; 38 38 StatType stats; 39 39 … … 52 52 if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue; 53 53 54 Msys = iPhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);54 Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 55 55 list[N] = Msys - Mcal - Mmos - Mgrid; 56 dlist[N] = MAX (catalog[i].measure[m].dM , MIN_ERROR);56 dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR); 57 57 N++; 58 58 } … … 66 66 67 67 if (PhotPrimary) { 68 catalog[i].average[j].M = stats.mean;69 catalog[i].average[j].dM = stats.sigma;68 catalog[i].average[j].M_PS = stats.mean; 69 catalog[i].average[j].dM_PS = stats.sigma; 70 70 catalog[i].average[j].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG; 71 71 } else { 72 catalog[i].secfilt[PhotNsec*j+PhotSec].M = stats.mean;73 catalog[i].secfilt[PhotNsec*j+PhotSec].dM = stats.sigma;72 catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS = stats.mean; 73 catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS = stats.sigma; 74 74 catalog[i].secfilt[PhotNsec*j+PhotSec].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG; 75 75 } … … 82 82 83 83 int i, j, k, m, N, Nmax; 84 short Msys, Mcal, Mmos, Mgrid;84 float Msys, Mcal, Mmos, Mgrid; 85 85 double *list, *dlist; 86 86 StatType stats; … … 110 110 if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue; 111 111 112 Msys = iPhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);112 Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 113 113 list[N] = Msys - Mcal - Mmos - Mgrid; 114 dlist[N] = MAX (catalog[i].measure[m].dM , MIN_ERROR);114 dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR); 115 115 N++; 116 116 } … … 122 122 /* use sigma or error in dM for output? */ 123 123 if (PhotPrimary) { 124 catalog[i].average[j].M = stats.mean;125 catalog[i].average[j].dM = MAX (stats.sigma, stats.error);124 catalog[i].average[j].M_PS = stats.mean; 125 catalog[i].average[j].dM_PS = MAX (stats.sigma, stats.error); 126 126 catalog[i].average[j].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG; 127 127 } else { 128 catalog[i].secfilt[PhotNsec*j+PhotSec].M = stats.mean;129 catalog[i].secfilt[PhotNsec*j+PhotSec].dM = MAX (stats.error, stats.sigma);128 catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS = stats.mean; 129 catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS = MAX (stats.error, stats.sigma); 130 130 catalog[i].secfilt[PhotNsec*j+PhotSec].Xm = (stats.Nmeas > 1) ? 100.0*log10(stats.chisq) : NO_MAG; 131 131 } … … 142 142 143 143 int i, j, k, m; 144 short Mcal, Mmos, Mgrid;144 float Mcal, Mmos, Mgrid; 145 145 146 146 MEAS_BAD = ID_MEAS_NOCAL; … … 156 156 if ((Mmos = getMmos (m, i)) == NO_MAG) continue; 157 157 if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue; 158 catalog[i].measure[m].Mcal = Mcal + Mmos + Mgrid;158 catalog[i].measure[m].Mcal_PS = Mcal + Mmos + Mgrid; 159 159 } 160 160 } … … 166 166 167 167 int i, j, Ndel, Nave, Ntot, mark; 168 short dM, Xm;168 float dM, Xm; 169 169 double Chisq, MaxScatter, MaxChisq; 170 170 double *xlist, *slist, *dlist; … … 187 187 Chisq = pow (10.0, 0.01*Xm); 188 188 xlist[Ntot] = Chisq; 189 slist[Ntot] = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;189 slist[Ntot] = PhotPrimary ? catalog[i].average[j].dM_PS : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS; 190 190 dlist[Ntot] = 1; 191 191 Ntot ++; … … 198 198 liststats (slist, dlist, Ntot, &stats); 199 199 MaxScatter = MAX (STAR_SCATTER, 2*stats.median); 200 fprintf (stderr, "Max Scatter: %f, Max Chisq: %f\n", 0.001*MaxScatter, MaxChisq);200 fprintf (stderr, "Max Scatter: %f, Max Chisq: %f\n", MaxScatter, MaxChisq); 201 201 202 202 Ndel = Nave = 0; 203 203 for (i = 0; i < Ncatalog; i++) { 204 204 for (j = 0; j < catalog[i].Naverage; j++) { 205 dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;206 Xm = PhotPrimary ? catalog[i].average[j].Xm : catalog[i].secfilt[PhotNsec*j+PhotSec].Xm;205 dM = PhotPrimary ? catalog[i].average[j].dM_PS : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS; 206 Xm = PhotPrimary ? catalog[i].average[j].Xm : catalog[i].secfilt[PhotNsec*j+PhotSec].Xm; 207 207 Chisq = pow (10.0, 0.01*Xm); 208 208 mark = (dM > MaxScatter) || (Xm == NO_MAG) || (Chisq > MaxChisq); … … 228 228 int *ilist; 229 229 double *tlist, *list, *dlist, Ns; 230 short Msys, Mcal, Mmos, Mgrid;230 float Msys, Mcal, Mmos, Mgrid; 231 231 StatType stats; 232 232 … … 267 267 if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue; 268 268 269 Msys = iPhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);269 Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 270 270 list[N] = Msys - Mcal - Mmos - Mgrid; 271 dlist[N] = MAX (catalog[i].measure[m].dM , MIN_ERROR);271 dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR); 272 272 N++; 273 273 } … … 299 299 if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue; 300 300 301 Msys = iPhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]);301 Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 302 302 list[N] = Msys - Mcal - Mmos - Mgrid; 303 dlist[N] = MAX (catalog[i].measure[m].dM , MIN_ERROR);303 dlist[N] = MAX (catalog[i].measure[m].dM_PS, MIN_ERROR); 304 304 ilist[N] = m; 305 305 N++; … … 422 422 if (catalog[i].average[j].code & STAR_BAD) continue; 423 423 424 dM = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;425 list[n] = 0.001*dM;424 dM = PhotPrimary ? catalog[i].average[j].dM_PS : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS; 425 list[n] = dM; 426 426 dlist[n] = 1; 427 427 n++; … … 438 438 439 439 int i, j, bin; 440 short dMrel;440 float dMrel; 441 441 double *xlist, *Mlist; 442 442 Graphdata graphdata; … … 451 451 for (j = 0; j < catalog[i].Naverage; j++) { 452 452 if (catalog[i].average[j].code & STAR_BAD) continue; 453 dMrel = PhotPrimary ? catalog[i].average[j].dM : catalog[i].secfilt[PhotNsec*j+PhotSec].dM;454 bin = 0.001*dMrel / 0.0025;453 dMrel = PhotPrimary ? catalog[i].average[j].dM_PS : catalog[i].secfilt[PhotNsec*j+PhotSec].dM_PS; 454 bin = dMrel / 0.0025; 455 455 bin = MAX (0, MIN (NBIN-1, bin)); 456 456 Mlist[bin] += 1.0; … … 482 482 for (j = 0; j < catalog[i].Naverage; j++) { 483 483 if (catalog[i].average[j].code & STAR_BAD) continue; 484 xlist[N] = PhotPrimary ? 0.001*catalog[i].average[j].M : 0.001*catalog[i].secfilt[PhotNsec*j+PhotSec].M;485 value = PhotPrimary ? catalog[i].average[j].Xm : catalog[i].secfilt[PhotNsec*j+PhotSec].Xm;484 xlist[N] = PhotPrimary ? catalog[i].average[j].M_PS : catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS; 485 value = PhotPrimary ? catalog[i].average[j].Xm : catalog[i].secfilt[PhotNsec*j+PhotSec].Xm; 486 486 if (value == NO_MAG) continue; 487 487 ylist[N] = 0.01*value; -
trunk/Ohana/src/relphot/src/args.c
r4796 r4865 113 113 if ((N = get_argument (argc, argv, "-minerror"))) { 114 114 remove_argument (N, &argc, argv); 115 MIN_ERROR = 1000.0*atof (argv[N]);115 MIN_ERROR = atof (argv[N]); 116 116 remove_argument (N, &argc, argv); 117 117 /* require MIN_ERROR > 0 */ … … 135 135 if ((N = get_argument (argc, argv, "-instmag"))) { 136 136 remove_argument (N, &argc, argv); 137 ImagMin = 1000*atof (argv[N]);137 ImagMin = atof (argv[N]); 138 138 remove_argument (N, &argc, argv); 139 ImagMax = 1000*atof (argv[N]);139 ImagMax = atof (argv[N]); 140 140 remove_argument (N, &argc, argv); 141 141 ImagSelect = TRUE; -
trunk/Ohana/src/relphot/src/bcatalog.c
r4796 r4865 5 5 int i, j, offset, ecode; 6 6 int NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm; 7 int mag;7 float mag; 8 8 9 9 /* we are moving only the subset of measurements from catalog[0] to subcatalog[0] */ … … 31 31 32 32 if (RESET) { 33 short *p;34 p = (PhotPrimary) ? &subcatalog[0].average[Naverage].M : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].M;33 float *p; 34 p = (PhotPrimary) ? &subcatalog[0].average[Naverage].M_PS : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].M_PS; 35 35 *p = NO_MAG; 36 p = (PhotPrimary) ? &subcatalog[0].average[Naverage].dM : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].dM;36 p = (PhotPrimary) ? &subcatalog[0].average[Naverage].dM_PS : &subcatalog[0].secfilt[PhotNsec*Naverage+PhotSec].dM_PS; 37 37 *p = NO_MAG; 38 38 subcatalog[0].average[Naverage].code &= ~ID_STAR_FEW; … … 59 59 60 60 /* select measurements by mag limit */ 61 mag = iPhotCat (&catalog[0].measure[offset]);61 mag = PhotCat (&catalog[0].measure[offset]); 62 62 if (mag > MAG_LIM) continue; 63 63 64 64 /* select measurements by measurement error */ 65 if (catalog[0].measure[offset].dM > SIGMA_LIM) continue;65 if (catalog[0].measure[offset].dM_PS > SIGMA_LIM) continue; 66 66 67 67 /* select measurements by mag limit */ 68 68 if (ImagSelect) { 69 mag = iPhotInst (&catalog[0].measure[offset]);69 mag = PhotInst (&catalog[0].measure[offset]); 70 70 if (mag < ImagMin) continue; 71 71 if (mag > ImagMax) continue; … … 76 76 subcatalog[0].measure[Nmeasure].averef = Naverage; 77 77 if (RESET) { 78 subcatalog[0].measure[Nmeasure].Mcal = 0;78 subcatalog[0].measure[Nmeasure].Mcal_PS = 0; 79 79 subcatalog[0].measure[Nmeasure].flags &= 0xff00; 80 80 subcatalog[0].measure[Nmeasure].flags &= ~ID_MEAS_POOR; -
trunk/Ohana/src/relphot/src/plot_scatter.c
r4796 r4865 4 4 5 5 int i, j, k, m, N, Ntot; 6 short Mrel, Mcal, Mmos, Mgrid;6 float Mrel, Mcal, Mmos, Mgrid; 7 7 double *xlist, *ylist, *ilist; 8 8 Graphdata graphdata; … … 32 32 if ((Mgrid = getMgrid (m, i)) == NO_MAG) continue; 33 33 34 Mrel = PhotPrimary ? catalog[i].average[j].M : catalog[i].secfilt[PhotNsec*j+PhotSec].M;34 Mrel = PhotPrimary ? catalog[i].average[j].M_PS : catalog[i].secfilt[PhotNsec*j+PhotSec].M_PS; 35 35 xlist[N] = Mrel; 36 ylist[N] = iPhotSys(&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]) - Mcal - Mmos - Mgrid - Mrel;36 ylist[N] = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]) - Mcal - Mmos - Mgrid - Mrel; 37 37 ilist[N] = PhotInst (&catalog[i].measure[m]); 38 xlist[N] *= 0.001;39 ylist[N] *= 0.001;40 38 N++; 41 39 } -
trunk/Ohana/src/relphot/src/setMrelFinal.c
r4796 r4865 4 4 5 5 int i, j, m, ecode; 6 short *p; 6 float *p; 7 short *q; 7 8 8 9 /* if we reset the catalog, reset all the current measurements */ … … 10 11 11 12 for (i = 0; i < catalog[0].Naverage; i++) { 12 p = (PhotPrimary) ? &catalog[0].average[i].M : &catalog[0].secfilt[PhotNsec*i+PhotSec].M;13 p = (PhotPrimary) ? &catalog[0].average[i].M_PS : &catalog[0].secfilt[PhotNsec*i+PhotSec].M_PS; 13 14 *p = NO_MAG; 14 p = (PhotPrimary) ? &catalog[0].average[i].dM : &catalog[0].secfilt[PhotNsec*i+PhotSec].dM;15 p = (PhotPrimary) ? &catalog[0].average[i].dM_PS : &catalog[0].secfilt[PhotNsec*i+PhotSec].dM_PS; 15 16 *p = NO_MAG; 16 p= (PhotPrimary) ? &catalog[0].average[i].Xm : &catalog[0].secfilt[PhotNsec*i+PhotSec].Xm;17 * p= NO_MAG;17 q = (PhotPrimary) ? &catalog[0].average[i].Xm : &catalog[0].secfilt[PhotNsec*i+PhotSec].Xm; 18 *q = NO_MAG; 18 19 19 20 m = catalog[0].average[i].offset; … … 30 31 } 31 32 32 catalog[0].measure[m].Mcal = 0;33 catalog[0].measure[m].Mcal_PS = 0; 33 34 catalog[0].measure[m].flags &= 0xff00; 34 35 catalog[0].measure[m].flags &= ~ID_MEAS_POOR; … … 72 73 int i, k, m, ecode, d1, d2; 73 74 int Ntot, Ntry, Nkeep, Nskip; 74 short mag;75 float mag; 75 76 76 77 Ntot = Ntry = Nskip = Nkeep = 0; … … 114 115 /* skip measurements by inst mag limit */ 115 116 if ((pass < 4) && ImagSelect) { 116 mag = iPhotInst (&catalog[0].measure[m]);117 mag = PhotInst (&catalog[0].measure[m]); 117 118 if (mag < ImagMin) goto skip; 118 119 if (mag > ImagMax) goto skip; -
trunk/Ohana/src/uniphot/include/uniphot.h
r4864 r4865 30 30 typedef struct { 31 31 char label[64]; 32 short int M;33 short int dM;34 short int dMsub;32 float M; 33 float dM; 34 float dMsub; 35 35 double v1, v2; 36 36 Image **image; -
trunk/Ohana/src/uniphot/src/update_catalog.c
r4797 r4865 5 5 int i, j, m, found; 6 6 int Primary, Nsec, Nsecfilt; 7 short *Mp;7 float *Mp; 8 8 PhotCode *code; 9 9 … … 15 15 for (i = 0; i < catalog[0].Naverage; i++) { 16 16 17 Mp = Primary ? &catalog[0].average[i].M : &catalog[0].secfilt[i*Nsecfilt+Nsec].M;17 Mp = Primary ? &catalog[0].average[i].M_PS : &catalog[0].secfilt[i*Nsecfilt+Nsec].M_PS; 18 18 if (*Mp != NO_MAG) *Mp += sgroup[0].M; 19 19 … … 24 24 if (code[0].type != PHOT_DEP) continue; 25 25 if (code[0].equiv != photcode[0].code) continue; 26 catalog[0].measure[m].Mcal -= sgroup[0].M;26 catalog[0].measure[m].Mcal_PS -= sgroup[0].M; 27 27 found ++; 28 28 }
Note:
See TracChangeset
for help on using the changeset viewer.
