Changeset 36921 for branches/eam_branches/ipp-20140610
- Timestamp:
- Jun 20, 2014, 9:01:44 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140610/Ohana/src
- Files:
-
- 13 edited
-
addstar/include/addstar.h (modified) (1 diff)
-
addstar/src/ReadStarsFITS.c (modified) (2 diffs)
-
addstar/src/addstar.c (modified) (6 diffs)
-
addstar/src/build_links.c (modified) (1 diff)
-
addstar/src/find_matches_closest.c (modified) (12 diffs)
-
addstar/src/mkcmf.c (modified) (3 diffs)
-
libautocode/def/average-ps1-v5.d (modified) (1 diff)
-
libautocode/def/average.d (modified) (1 diff)
-
libautocode/def/lensing-ps1-v5.d (modified) (1 diff)
-
libautocode/def/lensing.d (modified) (1 diff)
-
libdvo/include/dvo.h (modified) (1 diff)
-
libdvo/src/dvo_catalog.c (modified) (3 diffs)
-
libdvo/src/dvo_convert_PS1_V5.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140610/Ohana/src/addstar/include/addstar.h
r36920 r36921 251 251 void update_coords PROTO((Average *average, Measure *measure, off_t *next)); 252 252 off_t *init_measure_links PROTO((Average *average, off_t Naverage, Measure *measure, off_t Nmeasure)); 253 off_t *init_lensing_links PROTO((Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing)); 253 254 off_t *init_missing_links PROTO((Average *average, off_t Naverage, Missing *missing, off_t Nmissing)); 254 255 off_t add_meas_link PROTO((Average *average, off_t *next_meas, off_t Nmeasure, off_t NMEASURE)); 255 256 off_t add_miss_link PROTO((Average *average, off_t *next_miss, off_t Nmissing)); 257 off_t add_lens_link PROTO((Average *average, off_t *next_lens, off_t Nlensing, off_t NLENSING)); 256 258 off_t *build_measure_links PROTO((Average *average, off_t Naverage, Measure *measure, off_t Nmeasure)); 259 off_t *build_lensing_links PROTO((Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing)); 257 260 Measure *sort_measure PROTO((Average *average, off_t Naverage, Measure *measure, off_t Nmeasure, off_t *next_meas)); 258 261 Missing *sort_missing PROTO((Average *average, off_t Naverage, Missing *missing, off_t Nmissing, off_t *next_miss)); 262 Lensing *sort_lensing PROTO((Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing, off_t *next_lens)); 259 263 int ImageOptions PROTO((AddstarClientOptions *options, Image *images, off_t Nimages)); 260 264 int GetFileMode PROTO((Header *header)); -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/ReadStarsFITS.c
r36920 r36921 78 78 } 79 79 if (!strcmp (type, "PS1_V5")) { 80 if (table.header[0].Naxis[0] == 296) {80 if (table.header[0].Naxis[0] == 312) { 81 81 stars = Convert_PS1_V5_Lensing (&table, &Nstars); 82 82 } else { … … 901 901 902 902 ALLOCATE (stars[i].lensing, Lensing, 1); 903 dvo_lensing_init (stars[i].lensing); 904 903 905 stars[i].lensing->X11_sm_obj = ps1data[i].X11_sm_obj; 904 906 stars[i].lensing->X12_sm_obj = ps1data[i].X12_sm_obj; -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/addstar.c
r34405 r36921 7 7 int Nmatch, status, loadObjects; 8 8 off_t i, Nimages; 9 off_t Naverage, Nmeasure ;9 off_t Naverage, Nmeasure, Nlensing; 10 10 Stars *stars, **subset; 11 11 Image *images; … … 100 100 101 101 /* match stars to existing catalog data (or otherwise manipulate catalog data) */ 102 Nmatch = Naverage = Nmeasure = 0;102 Nmatch = Naverage = Nmeasure = Nlensing = 0; 103 103 for (i = 0; loadObjects && (i < skylist[0].Nregions); i++) { 104 104 … … 107 107 catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 108 108 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 109 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF ;109 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF | LOAD_LENSING; 110 110 catalog.Nsecfilt = GetPhotcodeNsecfilt (); 111 111 … … 182 182 Naverage += catalog.Naverage; 183 183 Nmeasure += catalog.Nmeasure; 184 Nlensing += catalog.Nlensing; 184 185 185 186 // write out catalog, if appropriate … … 187 188 SetProtect (TRUE); 188 189 if (options.update) { 189 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF ;190 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF | LOAD_LENSING; 190 191 dvo_catalog_update (&catalog, VERBOSE); 191 192 } else { … … 231 232 gettimeofday (&stop, NULL); 232 233 dtime = DTIME (stop, start); 233 fprintf (stderr, "SUCCESS: elapsed time %9.4f sec for %5d stars (%5d matches), "OFF_T_FMT" average, "OFF_T_FMT" measure \n", dtime, Nstars, Nmatch, Naverage, Nmeasure);234 fprintf (stderr, "SUCCESS: elapsed time %9.4f sec for %5d stars (%5d matches), "OFF_T_FMT" average, "OFF_T_FMT" measure, "OFF_T_FMT" lensing\n", dtime, Nstars, Nmatch, Naverage, Nmeasure, Nlensing); 234 235 235 236 exit (0); -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/build_links.c
r27435 r36921 225 225 } 226 226 227 /*******************************************************************************************/ 228 229 /* build the initial links assuming the table is sorted, 230 not partial, and has a correct set of average[].lensingOffset,Nlensing values */ 231 off_t *init_lensing_links (Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing) { 232 233 off_t i, j, N; 234 off_t *next_lens; 235 236 N = 0; 237 238 ALLOCATE (next_lens, off_t, Nlensing); 239 for (i = 0; i < Naverage; i++, N++) { 240 for (j = 0; j < average[i].Nlensing - 1; j++, N++) { 241 next_lens[N] = N + 1; 242 if (N >= Nlensing) { 243 fprintf (stderr, "WARNING: N out of bounds (1)\n"); 244 } 245 } 246 next_lens[N] = -1; 247 if (N >= Nlensing) { 248 fprintf (stderr, "WARNING: N out of bounds (2)\n"); 249 } 250 251 if (N >= Nlensing) { 252 fprintf (stderr, "overflow in init_lensing_links\n"); 253 abort (); 254 } 255 } 256 return (next_lens); 257 } 258 259 /* construct lensing links which are valid FOR THIS LOAD 260 * - if we have a full load, we will get links which can 261 * be used by other programs (eg, relphot, etc) 262 * - if we have a partial load, the links are only valid 263 * for that partial load 264 */ 265 266 off_t *build_lensing_links (Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing) { 267 268 off_t i, m, k, Nm, averef; 269 off_t *next_lens; 270 271 ALLOCATE (next_lens, off_t, Nlensing); 272 273 /* reset the Nm, offset values for average */ 274 for (i = 0; i < Naverage; i++) { 275 average[i].lensingOffset = -1; 276 average[i].Nlensing = 0; 277 } 278 279 for (Nm = 0; Nm < Nlensing; Nm++) { 280 averef = lensing[Nm].averef; 281 m = average[averef].lensingOffset; 282 next_lens[Nm] = -1; 283 284 if (m == -1) { /* no links yet for source */ 285 average[averef].lensingOffset = Nm; 286 average[averef].Nlensing = 1; 287 continue; 288 } 289 290 for (k = 0; next_lens[m] != -1; k++) { 291 m = next_lens[m]; 292 if (m >= Nlensing) { 293 fprintf (stderr, "WARNING: m out of bounds (1)\n"); 294 } 295 } 296 297 average[averef].Nlensing = k + 2; 298 next_lens[m] = Nm; 299 if (m >= Nlensing) { 300 fprintf (stderr, "WARNING: m out of bounds (2)\n"); 301 } 302 } 303 return (next_lens); 304 } 305 306 /* average[].lensingOffset, average[].Nlensing are valid within an addstar run */ 307 off_t add_lens_link (Average *average, off_t *next_lens, off_t Nlensing, off_t NLENSING) { 308 309 off_t k, m; 310 311 /* if we have trouble, check validity of next_lens[m] : m < Nlensing */ 312 m = average[0].lensingOffset; 313 314 for (k = 0; k < average[0].Nlensing - 1; k++) { 315 m = next_lens[m]; 316 if (m >= NLENSING) { 317 fprintf (stderr, "WARNING: m out of bounds (3)\n"); 318 } 319 } 320 321 /* set up references */ 322 next_lens[Nlensing] = -1; 323 if (Nlensing >= NLENSING) { 324 fprintf (stderr, "WARNING: Nlensing out of bounds (1)\n"); 325 } 326 327 if (m == -1) { 328 average[0].lensingOffset = Nlensing; 329 } else { 330 next_lens[m] = Nlensing; 331 if (m >= NLENSING) { 332 fprintf (stderr, "WARNING: m out of bounds (4)\n"); 333 } 334 } 335 336 return (TRUE); 337 } 338 339 Lensing *sort_lensing (Average *average, off_t Naverage, Lensing *lensing, off_t Nlensing, off_t *next_lens) { 340 341 off_t i, k, n, N; 342 Lensing *tmplensing; 343 344 /* fix order of Lensing (memory intensive, but fast) */ 345 N = 0; 346 ALLOCATE (tmplensing, Lensing, Nlensing); 347 for (i = 0; i < Naverage; i++) { 348 n = average[i].lensingOffset; 349 average[i].lensingOffset = N; 350 for (k = 0; k < average[i].Nlensing; k++, N++) { 351 if (n == -1) abort(); 352 tmplensing[N] = lensing[n]; 353 if (lensing[n].averef != i) abort(); 354 tmplensing[N].averef = i; 355 n = next_lens[n]; 356 } 357 } 358 free (lensing); 359 return (tmplensing); 360 } 361 362 -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/find_matches_closest.c
r36910 r36921 7 7 double *X1, *Y1, *X2, *Y2; 8 8 double dX, dY, dR; 9 off_t *N1, *N2, *next_meas ;10 off_t Nave, NAVE, Nmeas, NMEAS, Nmatch ;9 off_t *N1, *N2, *next_meas, *next_lens; 10 off_t Nave, NAVE, Nmeas, NMEAS, Nmatch, Nlens, NLENS; 11 11 int Nsecfilt, Nsec; 12 12 unsigned int objID, catID; … … 42 42 Nmatch = 0; 43 43 NMEAS = Nmeas = catalog[0].Nmeasure; 44 NLENS = Nlens = catalog[0].Nlensing; 44 45 45 46 // current max obj ID for this catalog … … 100 101 // is sorted while processed 101 102 next_meas = init_measure_links (catalog[0].average, Nave, catalog[0].measure, Nmeas); 103 next_lens = init_lensing_links (catalog[0].average, Nave, catalog[0].lensing, Nlens); 102 104 } else { 103 105 next_meas = build_measure_links (catalog[0].average, Nave, catalog[0].measure, Nmeas); 106 next_lens = build_lensing_links (catalog[0].average, Nave, catalog[0].lensing, Nlens); 104 107 } 105 108 … … 177 180 REALLOCATE (catalog[0].measure, Measure, NMEAS); 178 181 } 182 if (Nlens >= NLENS) { 183 NLENS = Nlens + 1000; 184 // REALLOCATE (next_lens, off_t, NLENS); 185 REALLOCATE (catalog[0].lensing, Lensing, NLENS); 186 } 179 187 180 188 /* add to end of measurement list */ 181 189 add_meas_link (&catalog[0].average[n], next_meas, Nmeas, NMEAS); 190 add_lens_link (&catalog[0].average[n], next_lens, Nlens, NLENS); // ? 182 191 183 192 /** add measurements for this star **/ … … 186 195 catalog[0].measure[Nmeas] = stars[N].measure; 187 196 188 /** dR,dD now represent arcsec **/ 197 // measure now carries R,D (not dR,dD) 198 // note that ReadStarsFITS does not set measure.R,D and average.R,D 189 199 catalog[0].measure[Nmeas].R = stars[N].average.R; 190 200 catalog[0].measure[Nmeas].D = stars[N].average.D; … … 220 230 } 221 231 232 // add the lensing values if they exist 233 if (stars[N].lensing) { 234 catalog[0].lensing[Nlens] = stars[N].lensing[0]; 235 236 catalog[0].lensing[Nlens].averef = n; 237 catalog[0].lensing[Nlens].objID = catalog[0].average[n].objID; 238 catalog[0].lensing[Nlens].catID = catalog[0].catID; 239 catalog[0].average[n].Nlensing ++; 240 Nlens ++; 241 } 242 222 243 /* adds the measurement to the calibration if appropriate color terms are found */ 223 244 /* we call this before (optionally) setting the average magnitude to avoid auto-correlations */ … … 255 276 REALLOCATE (catalog[0].measure, Measure, NMEAS); 256 277 } 278 if (Nlens >= NLENS - NSTAR_GROUP) { 279 NLENS = Nlens + 1000; 280 REALLOCATE (next_lens, off_t, NLENS); 281 REALLOCATE (catalog[0].lensing, Lensing, NLENS); 282 } 257 283 if (Nave >= NAVE) { 258 284 NAVE = Nave + 1000; … … 284 310 285 311 for (j = 0; j < NSTAR_GROUP; j++) { 286 // supply the measurments from this detection 287 catalog[0].measure[Nmeas] = stars[i + j].measure; 288 289 // the following measure elements cannot be set until here: 290 catalog[0].measure[Nmeas].R = stars[i].average.R; 291 catalog[0].measure[Nmeas].D = stars[i].average.D; 292 catalog[0].measure[Nmeas].dbFlags = 0; 293 catalog[0].measure[Nmeas].averef = Nave; 294 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID; 295 catalog[0].measure[Nmeas].catID = catalog[0].catID; 296 297 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ 298 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 299 if (Nsec > -1) { 300 catalog[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas], MAG_CLASS_PSF); 301 } 302 303 /* next[Nmeas] should always be -1 in this context (it is always the only 304 measurement for the star) */ 305 stars[i+j].found = Nmeas; 306 next_meas[Nmeas] = -1; // inital value here update below 307 Nmeas ++; 312 // supply the measurments from this detection 313 dvo_measure_init (&catalog[0].measure[Nmeas]); 314 catalog[0].measure[Nmeas] = stars[i + j].measure; 315 316 // the following measure elements cannot be set until here: 317 catalog[0].measure[Nmeas].R = stars[i].average.R; 318 catalog[0].measure[Nmeas].D = stars[i].average.D; 319 catalog[0].measure[Nmeas].dbFlags = 0; 320 catalog[0].measure[Nmeas].averef = Nave; 321 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID; 322 catalog[0].measure[Nmeas].catID = catalog[0].catID; 323 324 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ 325 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 326 if (Nsec > -1) { 327 catalog[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas], MAG_CLASS_PSF); 328 } 329 330 /* next[Nmeas] should always be -1 in this context (it is always the only 331 measurement for the star) */ 332 stars[i+j].found = Nmeas; 333 next_meas[Nmeas] = -1; // inital value here update below 334 Nmeas ++; 308 335 } 309 336 for (j = 0; j < NSTAR_GROUP - 1; j++) { 310 next_meas[Nmeas - NSTAR_GROUP + j] = Nmeas - NSTAR_GROUP + j + 1; 311 } 337 next_meas[Nmeas - NSTAR_GROUP + j] = Nmeas - NSTAR_GROUP + j + 1; 338 } 339 340 // if we have lensing data, insert that as well 341 if (stars[i].lensing) { 342 catalog[0].average[Nave].Nlensing = NSTAR_GROUP; 343 catalog[0].average[Nave].lensingOffset = Nlens; 344 for (j = 0; j < NSTAR_GROUP; j++) { 345 // add the lensing values if they exist 346 if (stars[i + j].lensing) { 347 dvo_lensing_init (&catalog[0].lensing[Nlens]); 348 catalog[0].lensing[Nlens] = stars[i + j].lensing[0]; 349 350 catalog[0].lensing[Nlens].averef = Nave; 351 catalog[0].lensing[Nlens].objID = catalog[0].average[Nave].objID; 352 catalog[0].lensing[Nlens].catID = catalog[0].catID; 353 next_lens[Nlens] = -1; 354 Nlens ++; 355 } 356 } 357 for (j = 0; j < NSTAR_GROUP - 1; j++) { 358 next_lens[Nlens - NSTAR_GROUP + j] = Nlens - NSTAR_GROUP + j + 1; 359 } 360 } 361 312 362 Nave ++; 313 363 } … … 315 365 REALLOCATE (catalog[0].average, Average, Nave); 316 366 REALLOCATE (catalog[0].measure, Measure, Nmeas); 367 REALLOCATE (catalog[0].lensing, Lensing, Nlens); 317 368 318 369 if (options.nosort) { … … 321 372 catalog[0].sorted = TRUE; 322 373 catalog[0].measure = sort_measure (catalog[0].average, Nave, catalog[0].measure, Nmeas, next_meas); 374 catalog[0].lensing = sort_lensing (catalog[0].average, Nave, catalog[0].lensing, Nlens, next_lens); 323 375 } 324 376 … … 334 386 catalog[0].Naverage = Nave; 335 387 catalog[0].Nmeasure = Nmeas; 388 catalog[0].Nlensing = Nlens; 336 389 catalog[0].Nsecf_mem = Nave*Nsecfilt; 337 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas : "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n", Nstars, Nave, Nmeas,Nmatch);390 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas, Nlens: "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n", Nstars, Nave, Nmeas, Nlens, Nmatch); 338 391 339 392 free (catalog[0].found); … … 345 398 free (Y2); 346 399 free (next_meas); 400 free (next_lens); 347 401 348 402 return (Nmatch); -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/mkcmf.c
r36912 r36921 15 15 void gauss_init (int Nbin); 16 16 double rnd_gauss (double mean, double sigma); 17 void writeStars_PS1_V5_Lensing (FTable *ftable, double *X, double *Y, double *M, unsigned int *Flag, int Nstars); 17 18 void writeStars_PS1_V5 (FTable *ftable, double *X, double *Y, double *M, unsigned int *Flag, int Nstars); 18 19 void writeStars_PS1_V4 (FTable *ftable, double *X, double *Y, double *M, unsigned int *Flag, int Nstars); … … 334 335 if (!strcmp(type, "PS1_V5")) { 335 336 writeStars_PS1_V5 (&ftable, X, Y, M, Flag, Nstars); 337 found = TRUE; 338 } 339 if (!strcmp(type, "PS1_V5_Lensing")) { 340 writeStars_PS1_V5_Lensing (&ftable, X, Y, M, Flag, Nstars); 336 341 found = TRUE; 337 342 } … … 880 885 } 881 886 887 void writeStars_PS1_V5_Lensing (FTable *ftable, double *X, double *Y, double *M, unsigned int *Flag, int Nstars) { 888 889 int i; 890 CMF_PS1_V5_Lensing *stars; 891 float flux, fSN; 892 893 // XXX add gaussian-distributed noise based on counts 894 // this needs to make different output 'stars' entries depending on the desired type 895 ALLOCATE (stars, CMF_PS1_V5_Lensing, Nstars); 896 for (i = 0; i < Nstars; i++) { 897 898 flux = pow (10.0, -0.4*M[i]); 899 fSN = 1.0 / sqrt(flux); 900 901 stars[i].detID = i; 902 stars[i].X = X[i]; 903 stars[i].Y = Y[i]; 904 stars[i].dX = FX * fSN; 905 stars[i].dY = FY * fSN; 906 907 stars[i].posangle = 10.0; 908 stars[i].pltscale = 0.25; 909 910 stars[i].M = M[i]; 911 stars[i].dM = fSN; 912 913 stars[i].Flux = flux; 914 stars[i].dFlux = flux * fSN; 915 916 stars[i].Map = M[i] - 0.05; 917 stars[i].MapRaw = M[i] - 0.10; 918 919 stars[i].apRadius = 8.0; 920 921 stars[i].apFlux = pow(10.0, -0.4*stars[i].Map); 922 stars[i].apFluxErr = stars[i].apFlux * fSN; 923 924 stars[i].Mcalib = M[i] + ZERO_POINT + 2.5*log10(exptime); 925 stars[i].dMcal = 0.05; 926 927 XY_to_RD (&stars[i].RA, &stars[i].DEC, X[i], Y[i], &coords); 928 stars[i].apNpix = 3.14*8.0*8.0; 929 930 stars[i].Mpeak = M[i] + 1.0; 931 stars[i].sky = SKY; 932 stars[i].dSky = DSKY; 933 stars[i].psfChisq = PSFCHI; 934 stars[i].crNsigma = CRN; 935 stars[i].extNsigma = EXTN; 936 stars[i].fx = FX; 937 stars[i].fy = FY; 938 stars[i].df = DF; 939 940 stars[i].k = 1.0; 941 stars[i].fwhmMaj = FX*2.8; 942 stars[i].fwhmMin = FY*2.8; 943 944 // randomly give poor PSFQF values 945 if ((BAD_PSFQF_FRAC > 0.0) && (drand48() < BAD_PSFQF_FRAC)) { 946 stars[i].psfQF = 0.25; 947 stars[i].psfQFperf = 0.24; 948 } else { 949 stars[i].psfQF = PSFQUAL; 950 stars[i].psfQFperf = MAX(PSFQUAL - 0.01, 0.0); 951 } 952 953 stars[i].psfNdof = 1; 954 stars[i].psfNpix = 2; 955 956 stars[i].Mxx = FX; 957 stars[i].Mxy = 0.01; 958 stars[i].Myy = FX; 959 stars[i].M3c = FX; 960 stars[i].M3s = FX; 961 stars[i].M4c = FX; 962 stars[i].M4s = FX; 963 stars[i].Mr1 = FX; 964 stars[i].Mrh = FX; 965 966 stars[i].X11_sm_obj = FX; 967 stars[i].X12_sm_obj = FX; 968 stars[i].X22_sm_obj = FY; 969 stars[i].E1_sm_obj = FX; 970 stars[i].E2_sm_obj = FX; 971 972 stars[i].X11_sh_obj = FX; 973 stars[i].X12_sh_obj = 0.2; 974 stars[i].X22_sh_obj = FY; 975 stars[i].E1_sh_obj = FX*0.9; 976 stars[i].E2_sh_obj = FX*0.8; 977 978 stars[i].X11_sm_psf = FX; 979 stars[i].X12_sm_psf = FX; 980 stars[i].X22_sm_psf = FX; 981 stars[i].E1_sm_psf = FX; 982 stars[i].E2_sm_psf = FX; 983 984 stars[i].X11_sh_psf = FX; 985 stars[i].X12_sh_psf = FX; 986 stars[i].X22_sh_psf = FX; 987 stars[i].E1_sh_psf = FX; 988 stars[i].E2_sh_psf = FX; 989 990 stars[i].kronFlux = flux * 1.25; 991 stars[i].kronFluxErr = fSN * flux * 1.25; 992 993 stars[i].kronInner = fSN * flux * 0.9; 994 stars[i].kronOuter = fSN * flux * 1.5; 995 996 stars[i].skyLimitRad = 1; 997 stars[i].skyLimitFlux = 2; 998 stars[i].skyLimitSlope = 0.2; 999 1000 stars[i].flags = Flag[i]; 1001 stars[i].flags2 = 0x80; 1002 1003 stars[i].nFrames = 1; 1004 1005 if (ADDNOISE) { 1006 stars[i].X += FX * fSN * rnd_gauss(0.0, 1.0); 1007 stars[i].Y += FY * fSN * rnd_gauss(0.0, 1.0); 1008 float Moff = fSN*rnd_gauss(0.0, 1.0); 1009 stars[i].M += Moff; 1010 stars[i].Map += Moff; 1011 stars[i].MapRaw += Moff; 1012 stars[i].Mcalib += Moff; 1013 } 1014 } 1015 1016 gfits_table_set_CMF_PS1_V5_Lensing (ftable, stars, Nstars); 1017 gfits_modify (ftable->header, "EXTTYPE", "%s", 1, "PS1_V5"); 1018 } 1019 -
branches/eam_branches/ipp-20140610/Ohana/src/libautocode/def/average-ps1-v5.d
r36899 r36921 43 43 FIELD Nextend, NEXTEND, unsigned short, number of extended measurements 44 44 45 FIELD measureOffset, OFF_MEASURE, uint32_t, offset to first psf measurement46 FIELD missingOffset, OFF_MISSING, uint32_t, offset to first missing obs47 FIELD lensingOffset, OFF_LENSING, uint32_t, offset to first lensing obs48 FIELD lensobjOffset, OFF_LENSOBJ, uint32_t, offset to mean lensing data49 FIELD extendOffset, OFF_EXTEND, uint32_t, offset to extended object entry45 FIELD measureOffset, OFF_MEASURE, int, offset to first psf measurement 46 FIELD missingOffset, OFF_MISSING, int, offset to first missing obs 47 FIELD lensingOffset, OFF_LENSING, int, offset to first lensing obs 48 FIELD lensobjOffset, OFF_LENSOBJ, int, offset to mean lensing data 49 FIELD extendOffset, OFF_EXTEND, int, offset to extended object entry 50 50 51 51 FIELD refColor, REF_COLOR, float, color of reference stars -
branches/eam_branches/ipp-20140610/Ohana/src/libautocode/def/average.d
r36899 r36921 45 45 FIELD measureOffset, OFF_MEASURE, int, offset to first psf measurement 46 46 FIELD missingOffset, OFF_MISSING, int, offset to first missing obs 47 FIELD lensingOffset, OFF_LENSING, uint32_t, offset to first lensing obs48 FIELD lensobjOffset, OFF_LENSOBJ, uint32_t, offset to mean lensing data49 FIELD extendOffset, OFF_EXTEND, uint32_t, offset to extended object entry47 FIELD lensingOffset, OFF_LENSING, int, offset to first lensing obs 48 FIELD lensobjOffset, OFF_LENSOBJ, int, offset to mean lensing data 49 FIELD extendOffset, OFF_EXTEND, int, offset to extended object entry 50 50 51 51 FIELD refColor, REF_COLOR, float, color of astrometry ref stars -
branches/eam_branches/ipp-20140610/Ohana/src/libautocode/def/lensing-ps1-v5.d
r36899 r36921 42 42 FIELD objID, OBJ_ID, unsigned int, unique ID for object in table 43 43 FIELD catID, CAT_ID, unsigned int, unique ID for table in which object was first realized 44 FIELD pad, PAD, int44 FIELD averef, AVE_REF, unsigned int, reference to average entry 45 45 46 46 # 28 x float -
branches/eam_branches/ipp-20140610/Ohana/src/libautocode/def/lensing.d
r36920 r36921 42 42 FIELD objID, OBJ_ID, unsigned int, unique ID for object in table 43 43 FIELD catID, CAT_ID, unsigned int, unique ID for table in which object was first realized 44 FIELD pad, PAD, int44 FIELD averef, AVE_REF, unsigned int, reference to average entry 45 45 46 46 # 28 x float -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/include/dvo.h
r36919 r36921 606 606 char catmode; /* storage mode (raw, mef, split, mysql) */ 607 607 char catformat; /* storage format (elixir, panstarrs, etc) */ 608 char catflags; /* choices to be loaded */609 608 char sorted; /* is measure table average-sorted? */ 610 609 610 short catflags; /* choices to be loaded */ 611 611 612 /* pointers for data manipulation */ 612 613 off_t *found; -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_catalog.c
r36918 r36921 333 333 334 334 // init all data, or just catalog data 335 void dvo_catalog_init (Catalog *catalog, int complete) {336 337 // the following are used to guide open/create/load338 if (complete) {339 catalog[0].f = NULL;340 catalog[0].filename = NULL;341 342 catalog[0].lockmode = 0;343 catalog[0].catmode = 0;344 catalog[0].catformat = 0;345 catalog[0].catflags = 0;346 catalog[0].Nsecfilt = 0;347 }348 349 gfits_init_header (&catalog[0].header);350 351 // the following describe the catalog files on disk352 catalog[0].average = NULL;353 catalog[0].measure = NULL;354 catalog[0].missing = NULL;355 catalog[0].secfilt = NULL;356 357 catalog[0].averageT = NULL;358 catalog[0].measureT = NULL;359 360 catalog[0].objID = 0;361 catalog[0].catID = 0;362 catalog[0].sorted = 0;363 364 catalog[0].Naverage = 0;365 catalog[0].Nmeasure = 0;366 catalog[0].Nmissing = 0;367 catalog[0].Nsecf_mem = 0;368 369 catalog[0].Naves_disk = 0;370 catalog[0].Nmeas_disk = 0;371 catalog[0].Nmiss_disk = 0;372 catalog[0].Nsecf_disk = 0;373 374 catalog[0].Naves_off = 0;375 catalog[0].Nmeas_off = 0;376 catalog[0].Nmiss_off = 0;377 catalog[0].Nsecf_off = 0;378 379 /* pointers to SPLIT data files */380 catalog[0].measure_catalog = NULL;381 catalog[0].missing_catalog = NULL;382 catalog[0].secfilt_catalog = NULL;383 384 /* pointers for data manipulation */385 catalog[0].found = NULL;386 catalog[0].image = NULL;387 catalog[0].mosaic = NULL;388 catalog[0].X = NULL;389 catalog[0].Y = NULL;390 }391 392 // init all data, or just catalog data393 335 void dvo_lensing_init (Lensing *lensing) { 394 336 lensing->X11_sm_obj = NAN; … … 429 371 lensing->objID = -1; 430 372 lensing->catID = -1; 431 432 lensing->pad = 0; 373 lensing->averef = 0; 433 374 } 434 375 … … 477 418 478 419 lensobj->pad = 0; 420 } 421 422 // init all data, or just catalog data 423 void dvo_catalog_init (Catalog *catalog, int complete) { 424 425 // the following are used to guide open/create/load 426 if (complete) { 427 catalog[0].f = NULL; 428 catalog[0].filename = NULL; 429 430 catalog[0].lockmode = 0; 431 catalog[0].catmode = 0; 432 catalog[0].catformat = 0; 433 catalog[0].catflags = 0; 434 catalog[0].Nsecfilt = 0; 435 } 436 437 gfits_init_header (&catalog[0].header); 438 439 // the following describe the catalog files on disk 440 catalog[0].average = NULL; 441 catalog[0].measure = NULL; 442 catalog[0].missing = NULL; 443 catalog[0].secfilt = NULL; 444 445 catalog[0].lensing = NULL; 446 catalog[0].lensobj = NULL; 447 448 catalog[0].averageT = NULL; 449 catalog[0].measureT = NULL; 450 451 catalog[0].objID = 0; 452 catalog[0].catID = 0; 453 catalog[0].sorted = 0; 454 455 catalog[0].Naverage = 0; 456 catalog[0].Nmeasure = 0; 457 catalog[0].Nmissing = 0; 458 catalog[0].Nsecf_mem = 0; 459 460 catalog[0].Nlensing = 0; 461 catalog[0].Nlensobj = 0; 462 463 catalog[0].Naves_disk = 0; 464 catalog[0].Nmeas_disk = 0; 465 catalog[0].Nmiss_disk = 0; 466 catalog[0].Nsecf_disk = 0; 467 468 catalog[0].Nlensing_disk = 0; 469 catalog[0].Nlensobj_disk = 0; 470 471 catalog[0].Naves_off = 0; 472 catalog[0].Nmeas_off = 0; 473 catalog[0].Nmiss_off = 0; 474 catalog[0].Nsecf_off = 0; 475 476 catalog[0].Nlensing_off = 0; 477 catalog[0].Nlensobj_off = 0; 478 479 /* pointers to SPLIT data files */ 480 catalog[0].measure_catalog = NULL; 481 catalog[0].missing_catalog = NULL; 482 catalog[0].secfilt_catalog = NULL; 483 catalog[0].lensing_catalog = NULL; 484 catalog[0].lensobj_catalog = NULL; 485 486 /* pointers for data manipulation */ 487 catalog[0].found = NULL; 488 catalog[0].image = NULL; 489 catalog[0].mosaic = NULL; 490 catalog[0].X = NULL; 491 catalog[0].Y = NULL; 479 492 } 480 493 -
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
r36918 r36921 454 454 out[i].objID = in[i].objID; 455 455 out[i].catID = in[i].catID; 456 457 out[i].averef = in[i].averef; 456 458 } 457 459 return (out); … … 504 506 out[i].objID = in[i].objID; 505 507 out[i].catID = in[i].catID; 508 509 out[i].averef = in[i].averef; 506 510 } 507 511 return (out);
Note:
See TracChangeset
for help on using the changeset viewer.
