- Timestamp:
- Dec 12, 2015, 8:38:47 PM (11 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 22 edited
-
addstar/src/loadgalphot_readstars.c (modified) (1 diff)
-
dvomerge/src/merge_catalogs_old.c (modified) (8 diffs)
-
libautocode/def/measure-ps1-sim.d (modified) (2 diffs)
-
libautocode/def/measure-ps1-v5.d (modified) (1 diff)
-
libautocode/def/measure.d (modified) (1 diff)
-
libdvo/include/dvo.h (modified) (2 diffs)
-
libdvo/src/dbExtractMeasures.c (modified) (2 diffs)
-
libdvo/src/dvo_catalog.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_SIM.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_PS1_V5.c (modified) (3 diffs)
-
libdvo/src/dvo_tiny_values.c (modified) (1 diff)
-
relastro/src/BrightCatalog.c (modified) (9 diffs)
-
relastro/src/ImageOps.c (modified) (1 diff)
-
relphot/src/BrightCatalog.c (modified) (8 diffs)
-
relphot/src/setMrelCatalog.c (modified) (4 diffs)
-
uniphot/Makefile (modified) (2 diffs)
-
uniphot/include/setphot.h (modified) (1 diff)
-
uniphot/src/cam_correction.c (modified) (3 diffs)
-
uniphot/src/initialize_setphot.c (modified) (1 diff)
-
uniphot/src/initialize_setphot_client.c (modified) (1 diff)
-
uniphot/src/setphot.c (modified) (3 diffs)
-
uniphot/src/update_catalog_setphot.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/loadgalphot_readstars.c
r39125 r39262 204 204 fit->ClipNsigma = 5.0; 205 205 206 // use the list of index values from above to join entries with the same index 207 206 208 int Nbad = 0; 207 209 for (i = 0; i < Nrow; i++) { -
trunk/Ohana/src/dvomerge/src/merge_catalogs_old.c
r39142 r39262 85 85 N1[Nstars] = i; 86 86 Nstars ++; 87 input[0].found_t[i] = -1;87 input[0].found_t[i] = FALSE; 88 88 } 89 89 if (Nstars < 1) { … … 180 180 off_t N = N1[i]; 181 181 182 input[0].found_t[N] = TRUE; 183 182 184 /* make sure there is space for next Nmeasure entries */ 183 185 if (Nmeas + input[0].average[N].Nmeasure >= NMEAS) { … … 209 211 Nreplace = replace_tycho (&output[0].average[n], output[0].measure, next_meas, &input[0].average[N], &input[0].measure[Minp]); 210 212 if (Nreplace == 6) { 211 input[0].found_t[N] = Nmeas;212 213 output[0].found_t[n] = Nmeas; 213 214 i++; … … 224 225 // XXX this does not support lensing, starpar, or galphot measurements 225 226 if (replace_match (&output[0].average[n], output[0].measure, next_meas, &input[0].average[N], &input[0].measure[offset])) { 226 input[0].found_t[N] = output[0].average[n].measureOffset;227 227 continue; 228 228 } … … 274 274 } 275 275 } 276 input[0].found_t[N] = Nmeas;277 276 output[0].average[n].Nmeasure ++; 278 277 Nmeas ++; … … 394 393 } 395 394 396 if (input[0].found_t[N] >= 0) continue;395 if (input[0].found_t[N]) continue; 397 396 398 397 // if we are using MATCHED_TABLES, we are going to leave the edge cases in their 399 398 // source catalog, even if they have leaked beyond the edge 400 399 if (!MATCHED_TABLES && !IN_REGION (input[0].average[N].R, input[0].average[N].D)) continue; 400 401 input[0].found_t[N] = TRUE; 401 402 402 403 // XXX should we accept the input measurements for these fields? … … 450 451 451 452 /* we set next[Nmeas] to -1 here, and update correctly below */ 452 input[0].found_t[N] = Nmeas;453 453 next_meas[Nmeas] = -1; 454 454 Nmeas ++; … … 559 559 } 560 560 561 /* note stars which have been found in this catalog */562 for (i = 0; i < input[0].Naverage; i++) {563 if (input[0].found_t[i] > -1) {564 input[0].found_t[i] = -2;565 } else {566 input[0].found_t[i] = -3;567 }568 }569 570 561 /* check if the catalog has changed? if no change, no need to write */ 571 562 output[0].objID = objID; // new max value, save on catalog close -
trunk/Ohana/src/libautocode/def/measure-ps1-sim.d
r37807 r39262 27 27 FIELD XoffDCR, X_OFF_DCR, float, X offset from correction, pixels 28 28 FIELD YoffDCR, Y_OFF_DCR, float, Y offset from correction, pixels 29 FIELD RoffGAL, R_OFF_GAL, float, RA offset from correction, arcsec 30 FIELD DoffGAL, D_OFF_GAL, float, DEC offset from correction, arcsec 29 30 FIELD Mflat, M_FLAT, float, Static Flat-field offset, mag 31 FIELD dummy2, PADDING, int, unused 4 bytes 31 32 32 33 FIELD t, TIME, int, time in seconds (UNIX) … … 48 49 FIELD dRsys, POS_SYS_ERR, short, systematic error from astrom, 1/100 of pixels 49 50 50 FIELD dummy, PADDING ,short, padding51 FIELD dummy, PADDING2, short, padding 51 52 FIELD posangle, POSANGLE, short, position angle sky to chip, (0xffff/360) deg 52 53 FIELD pltscale, PLTSCALE, float, plate scale, arcsec/pixel -
trunk/Ohana/src/libautocode/def/measure-ps1-v5.d
r38986 r39262 42 42 FIELD XoffCAM, X_OFF_CAM, float, X offset from correction, pixels 43 43 FIELD YoffCAM, Y_OFF_CAM, float, Y offset from correction, pixels 44 FIELD RoffGAL, R_OFF_GAL, float, RA offset from correction, arcsec 45 FIELD DoffGAL, D_OFF_GAL, float, DEC offset from correction, arcsec 44 45 FIELD Mflat, M_FLAT, float, Static Flat-field offset, mag 46 FIELD dummy2, PADDING, int, unused 4 bytes 46 47 47 48 # could these be packed into fewer bits? -
trunk/Ohana/src/libautocode/def/measure.d
r39225 r39262 43 43 FIELD YoffCAM, Y_OFF_CAM, float, Y offset from correction, pixels 44 44 45 # XXX I can deprecate these as I am going to apply the correct uR,uD offset 46 # XXX not sure how to use this yet... 47 # XXX replace RoffGall with Moff -> static component of the zpt correction 48 FIELD RoffGAL, R_OFF_GAL, float, RA offset from correction, arcsec 49 FIELD DoffGAL, D_OFF_GAL, float, DEC offset from correction, arcsec 45 FIELD Mflat, M_FLAT, float, Static Flat-field offset, mag 46 FIELD dummy2, PADDING, int, unused 4 bytes 50 47 51 48 # could these be packed into fewer bits? -
trunk/Ohana/src/libdvo/include/dvo.h
r39125 r39262 476 476 double R; 477 477 double D; 478 float RoffGAL;479 float DoffGAL;480 478 float M; 481 479 float Mcal; 480 float Mflat; 482 481 float dM; 483 482 float airmass; … … 620 619 float XoffDCR; // X offset from correction (pixels) 621 620 float YoffDCR; // Y offset from correction (pixels) 622 float RoffGAL; // RAoffset from correction (arcsec)623 float DoffGAL; // DEC offset from correction (arcsec)621 float Mflat; // flat offset from correction (arcsec) 622 int padding2; // dummy 624 623 float Sky; // local estimate of sky flux (counts/sec) 625 624 float dSky; // local estimate of sky flux (counts/sec) -
trunk/Ohana/src/libdvo/src/dbExtractMeasures.c
r38986 r39262 597 597 case MEAS_XOFF_CAM: { value.Flt = measure[0].XoffCAM; break; } 598 598 case MEAS_YOFF_CAM: { value.Flt = measure[0].YoffCAM; break; } 599 case MEAS_ROFF_GAL: { value.Flt = measure[0].RoffGAL; break; }600 case MEAS_DOFF_GAL: { value.Flt = measure[0].DoffGAL; break; }601 599 602 600 case MEAS_XFIELD: /* offset relative to exposure center in ra,dec space */ … … 723 721 724 722 case MEAS_MCAL_OFFSET: { value.Flt = measure[0].Mcal; break; } 725 726 case MEAS_FLAT: /* OK */ 727 // flat = measure.Mcal - image.Mcal 728 if (REMOTE_CLIENT) { 729 ImageMetadata *image = MatchImageMetadataDVO (measure[0].imageID); 730 if (image == NULL) break; 731 value.Flt = measure[0].Mcal - image[0].Mcal; 732 } else { 733 Image *image = MatchImageDVO (measure[0].t, measure[0].photcode, measure[0].imageID); 734 if (image == NULL) break; 735 value.Flt = measure[0].Mcal - image[0].Mcal; 736 } 737 break; 723 case MEAS_FLAT: { value.Flt = measure[0].Mflat; break; } 738 724 739 725 // we have measure[0].Xccd,Yccd and image[0].NX,NY. Find the distance to the center -
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r39125 r39262 332 332 measure->XoffCAM = NAN; 333 333 measure->YoffCAM = NAN; 334 measure->RoffGAL = NAN; 335 measure->DoffGAL = NAN; 334 335 measure->Mflat = 0.0; 336 measure->dummy2 = 0; 336 337 337 338 measure->Sky = NAN; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_SIM.c
r38462 r39262 29 29 out[i].XoffDCR = in[i].XoffDCR; 30 30 out[i].YoffDCR = in[i].YoffDCR; 31 out[i].RoffGAL = in[i].RoffGAL; 32 out[i].DoffGAL = in[i].DoffGAL; 31 out[i].Mflat = in[i].Mflat; 33 32 out[i].t = in[i].t; 34 33 out[i].averef = in[i].averef; … … 75 74 out[i].XoffDCR = in[i].XoffDCR; 76 75 out[i].YoffDCR = in[i].YoffDCR; 77 out[i].RoffGAL = in[i].RoffGAL; 78 out[i].DoffGAL = in[i].DoffGAL; 76 out[i].Mflat = in[i].Mflat; 79 77 out[i].t = in[i].t; 80 78 out[i].averef = in[i].averef; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
r39125 r39262 42 42 out[i].XoffCAM = in[i].XoffCAM; 43 43 out[i].YoffCAM = in[i].YoffCAM; 44 out[i].RoffGAL = in[i].RoffGAL; 45 out[i].DoffGAL = in[i].DoffGAL; 44 out[i].Mflat = in[i].Mflat; 46 45 out[i].Sky = in[i].Sky; 47 46 out[i].dSky = in[i].dSky; … … 116 115 out[i].XoffCAM = in[i].XoffCAM; 117 116 out[i].YoffCAM = in[i].YoffCAM; 118 out[i].RoffGAL = in[i].RoffGAL; 119 out[i].DoffGAL = in[i].DoffGAL; 117 out[i].Mflat = in[i].Mflat; 120 118 out[i].Sky = in[i].Sky; 121 119 out[i].dSky = in[i].dSky; … … 1678 1676 out[i].XoffDCR = in[i].XoffDCR; 1679 1677 out[i].YoffDCR = in[i].YoffDCR; 1680 out[i].RoffGAL = in[i].RoffGAL; 1681 out[i].DoffGAL = in[i].DoffGAL; 1678 out[i].Mflat = in[i].Mflat; 1682 1679 out[i].Sky = in[i].Sky; 1683 1680 out[i].dSky = in[i].dSky; -
trunk/Ohana/src/libdvo/src/dvo_tiny_values.c
r38062 r39262 22 22 measureT[0].dM = measure[0].dM; 23 23 measureT[0].airmass = measure[0].airmass; 24 measureT[0].RoffGAL = measure[0].RoffGAL; 25 measureT[0].DoffGAL = measure[0].DoffGAL; 24 measureT[0].Mflat = measure[0].Mflat; 26 25 measureT[0].Xccd = measure[0].Xccd; 27 26 measureT[0].Yccd = measure[0].Yccd; -
trunk/Ohana/src/relastro/src/BrightCatalog.c
r39225 r39262 67 67 GET_COLUMN(R, "RA", double); 68 68 GET_COLUMN(D, "DEC", double); 69 GET_COLUMN(RoffGAL, "ROFF_GAL", float);70 GET_COLUMN(DoffGAL, "DOFF_GAL", float);71 69 GET_COLUMN(M, "MAG_SYS", float); 72 70 GET_COLUMN(Mcal, "MAG_CAL", float); … … 94 92 measure[i].R = R[i]; 95 93 measure[i].D = D[i]; 96 measure[i].RoffGAL = RoffGAL[i];97 measure[i].DoffGAL = DoffGAL[i];98 94 measure[i].M = M[i]; 99 95 measure[i].Mcal = Mcal[i]; … … 121 117 free (R ); 122 118 free (D ); 123 free (RoffGAL );124 free (DoffGAL );125 119 free (M ); 126 120 free (Mcal ); … … 362 356 gfits_define_bintable_column (&theader, "D", "RA", "ra", "degrees", 1.0, 0.0); 363 357 gfits_define_bintable_column (&theader, "D", "DEC", "dec", "degrees", 1.0, 0.0); 364 gfits_define_bintable_column (&theader, "E", "ROFF_GAL", "ra offset", "arcsec", 1.0, 0.0);365 gfits_define_bintable_column (&theader, "E", "DOFF_GAL", "dec offset", "arcsec", 1.0, 0.0);366 358 gfits_define_bintable_column (&theader, "E", "MAG_SYS", "magnitude (sys)", NULL, 1.0, 0.0); 367 359 gfits_define_bintable_column (&theader, "E", "MAG_CAL", "magnitude (cal)", NULL, 1.0, 0.0); … … 382 374 383 375 // generate the output array that carries the data 384 ohana_memcheck (1);385 376 gfits_create_table (&theader, &ftable); 386 ohana_memcheck (1);387 377 388 378 // create intermediate storage arrays 389 379 double *R ; ALLOCATE (R , double, catalog->Nmeasure); 390 380 double *D ; ALLOCATE (D , double, catalog->Nmeasure); 391 float *RoffGAL ; ALLOCATE (RoffGAL , float, catalog->Nmeasure);392 float *DoffGAL ; ALLOCATE (DoffGAL , float, catalog->Nmeasure);393 381 float *M ; ALLOCATE (M , float, catalog->Nmeasure); 394 382 float *Mcal ; ALLOCATE (Mcal , float, catalog->Nmeasure); … … 407 395 int *catID ; ALLOCATE (catID , int , catalog->Nmeasure); 408 396 short *photcode ; ALLOCATE (photcode , short, catalog->Nmeasure); 409 ohana_memcheck (1);410 397 411 398 // assign the storage arrays … … 414 401 R[i] = measure[i].R ; 415 402 D[i] = measure[i].D ; 416 RoffGAL[i] = measure[i].RoffGAL ;417 DoffGAL[i] = measure[i].DoffGAL ;418 403 M[i] = measure[i].M ; 419 404 Mcal[i] = measure[i].Mcal ; … … 433 418 photcode[i] = measure[i].photcode ; 434 419 } 435 ohana_memcheck (1);436 420 437 421 // add the columns to the output array 438 422 gfits_set_bintable_column (&theader, &ftable, "RA", R, catalog->Nmeasure); 439 ohana_memcheck (1);440 423 gfits_set_bintable_column (&theader, &ftable, "DEC", D, catalog->Nmeasure); 441 ohana_memcheck (1);442 gfits_set_bintable_column (&theader, &ftable, "ROFF_GAL", RoffGAL, catalog->Nmeasure);443 gfits_set_bintable_column (&theader, &ftable, "DOFF_GAL", DoffGAL, catalog->Nmeasure);444 424 gfits_set_bintable_column (&theader, &ftable, "MAG_SYS", M, catalog->Nmeasure); 445 425 gfits_set_bintable_column (&theader, &ftable, "MAG_CAL", Mcal, catalog->Nmeasure); … … 461 441 free (R ); 462 442 free (D ); 463 free (RoffGAL );464 free (DoffGAL );465 443 free (M ); 466 444 free (Mcal ); -
trunk/Ohana/src/relastro/src/ImageOps.c
r38986 r39262 769 769 ref[i].R += dTime * catalog[c].average[n].uR / 3600.0 / cos(ref[i].D*RAD_DEG); 770 770 ref[i].D += dTime * catalog[c].average[n].uD / 3600.0; 771 }772 773 // if we are correcting for the Galaxy Motion Model, we assume the mean R,D is at the J2000 epoch position774 if (0) {775 myAssert (!isnan(measure[0].RoffGAL), "oops");776 myAssert (!isnan(measure[0].DoffGAL), "oops");777 ref[i].R += measure[0].RoffGAL / 3600.0;778 ref[i].D += measure[0].DoffGAL / 3600.0;779 771 } 780 772 -
trunk/Ohana/src/relphot/src/BrightCatalog.c
r37037 r39262 67 67 GET_COLUMN(M, "MAG_SYS", float); 68 68 GET_COLUMN(Mcal, "MAG_CAL", float); 69 GET_COLUMN(Mflat, "MAG_FLAT", float); 69 70 GET_COLUMN(dM, "MAG_ERR", float); 70 71 GET_COLUMN(airmass, "AIRMASS", float); … … 89 90 measure[i].M = M[i]; 90 91 measure[i].Mcal = Mcal[i]; 92 measure[i].Mflat = Mflat[i]; 91 93 measure[i].dM = dM[i]; 92 94 measure[i].airmass = airmass[i]; … … 109 111 free (M ); 110 112 free (Mcal ); 113 free (Mflat ); 111 114 free (dM ); 112 115 free (airmass ); … … 269 272 gfits_define_bintable_column (&theader, "E", "MAG_SYS", "magnitude (sys)", NULL, 1.0, 0.0); 270 273 gfits_define_bintable_column (&theader, "E", "MAG_CAL", "magnitude (cal)", NULL, 1.0, 0.0); 274 gfits_define_bintable_column (&theader, "E", "MAG_FLAT", "magnitude (flat)", NULL, 1.0, 0.0); 271 275 gfits_define_bintable_column (&theader, "E", "MAG_ERR", "magnitude (err)", NULL, 1.0, 0.0); 272 276 gfits_define_bintable_column (&theader, "E", "AIRMASS", "airmass", NULL, 1.0, 0.0); … … 290 294 float *M ; ALLOCATE (M , float, catalog->Nmeasure); 291 295 float *Mcal ; ALLOCATE (Mcal , float, catalog->Nmeasure); 296 float *Mflat ; ALLOCATE (Mflat , float, catalog->Nmeasure); 292 297 float *dM ; ALLOCATE (dM , float, catalog->Nmeasure); 293 298 float *airmass ; ALLOCATE (airmass , float, catalog->Nmeasure); … … 310 315 M[i] = measure[i].M ; 311 316 Mcal[i] = measure[i].Mcal ; 317 Mflat[i] = measure[i].Mflat ; 312 318 dM[i] = measure[i].dM ; 313 319 airmass[i] = measure[i].airmass ; … … 329 335 gfits_set_bintable_column (&theader, &ftable, "MAG_SYS", M, catalog->Nmeasure); 330 336 gfits_set_bintable_column (&theader, &ftable, "MAG_CAL", Mcal, catalog->Nmeasure); 337 gfits_set_bintable_column (&theader, &ftable, "MAG_FLAT", Mflat, catalog->Nmeasure); 331 338 gfits_set_bintable_column (&theader, &ftable, "MAG_ERR", dM, catalog->Nmeasure); 332 339 gfits_set_bintable_column (&theader, &ftable, "AIRMASS", airmass, catalog->Nmeasure); … … 346 353 free (M ); 347 354 free (Mcal ); 355 free (Mflat ); 348 356 free (dM ); 349 357 free (airmass ); -
trunk/Ohana/src/relphot/src/setMrelCatalog.c
r39107 r39262 1 1 # include "relphot.h" 2 3 /* 4 # define TEST_OBJ_ID 0x3ae2 5 # define TEST_CAT_ID 0x16c5f 6 */ 7 # define TEST_OBJ_ID 0 8 # define TEST_CAT_ID 0 9 2 10 int markMeasureByRanking (StatDataSet *dataset, Measure *measure, int minrank, DVOMeasureFlags flags); 3 11 … … 113 121 114 122 // option for a test print 115 if ( FALSE && (averageT[0].objID == 0x7146) && (averageT[0].catID == 0x49d8)) {123 if ((averageT[0].objID == TEST_OBJ_ID) && (averageT[0].catID == TEST_CAT_ID)) { 116 124 fprintf (stderr, "test obj\n"); 117 125 print_measure_set_alt (average, secfilt, measure); … … 353 361 354 362 if (isSetMrelFinal) { 355 if ( FALSE && (average->objID == 0x1) && (average->catID)) {363 if ((average[0].objID == TEST_OBJ_ID) && (average[0].catID == TEST_CAT_ID)) { 356 364 fprintf (stderr, "test obj\n"); 357 365 } … … 723 731 724 732 // option for a test print 725 if ( FALSE && (average[0].objID == 0x0000049c) && (average[0].catID == 0x00016c5e)) {733 if ((average[0].objID == TEST_OBJ_ID) && (average[0].catID == TEST_CAT_ID)) { 726 734 fprintf (stderr, "test obj\n"); 727 735 print_measure_set_alt (average, secfilt, measure); -
trunk/Ohana/src/uniphot/Makefile
r38986 r39262 1 default: uniphot setphot setphot_client setfwhm setposangle setposangle_client setastrom setastrom_client setgalmodel setgalmodel_client fiximids fiximids_client fixstkids fixstkids_client ckids ckids_client 1 # default: uniphot setphot setphot_client setfwhm setposangle setposangle_client setastrom setastrom_client setgalmodel setgalmodel_client fiximids fiximids_client fixstkids fixstkids_client ckids ckids_client 2 default: uniphot setfwhm setposangle setposangle_client setastrom setastrom_client setgalmodel setgalmodel_client fiximids fiximids_client fixstkids fixstkids_client ckids ckids_client 3 2 4 help: 3 5 @echo "make options: uniphot setphot setfwhm default help install default (uniphot setphot setfwhm)" … … 34 36 ckids_client: $(BIN)/ckids_client.$(ARCH) 35 37 36 install: $(DESTBIN)/uniphot $(DESTBIN)/setfwhm $(DESTBIN)/setphot $(DESTBIN)/setphot_client $(DESTBIN)/setposangle $(DESTBIN)/setposangle_client $(DESTBIN)/setastrom $(DESTBIN)/setastrom_client $(DESTBIN)/setgalmodel $(DESTBIN)/setgalmodel_client $(DESTBIN)/fiximids $(DESTBIN)/fiximids_client $(DESTBIN)/fixstkids $(DESTBIN)/fixstkids_client $(DESTBIN)/ckids $(DESTBIN)/ckids_client 38 # install: $(DESTBIN)/uniphot $(DESTBIN)/setfwhm $(DESTBIN)/setphot $(DESTBIN)/setphot_client $(DESTBIN)/setposangle $(DESTBIN)/setposangle_client $(DESTBIN)/setastrom $(DESTBIN)/setastrom_client $(DESTBIN)/setgalmodel $(DESTBIN)/setgalmodel_client $(DESTBIN)/fiximids $(DESTBIN)/fiximids_client $(DESTBIN)/fixstkids $(DESTBIN)/fixstkids_client $(DESTBIN)/ckids $(DESTBIN)/ckids_client 39 install: $(DESTBIN)/uniphot $(DESTBIN)/setfwhm $(DESTBIN)/setposangle $(DESTBIN)/setposangle_client $(DESTBIN)/setastrom $(DESTBIN)/setastrom_client $(DESTBIN)/setgalmodel $(DESTBIN)/setgalmodel_client $(DESTBIN)/fiximids $(DESTBIN)/fiximids_client $(DESTBIN)/fixstkids $(DESTBIN)/fixstkids_client $(DESTBIN)/ckids $(DESTBIN)/ckids_client 37 40 38 41 UNIPHOT = \ -
trunk/Ohana/src/uniphot/include/setphot.h
r39138 r39262 17 17 unsigned int flags; 18 18 } ImageSubset; 19 20 // we have one correction (an image) for each filter and chip 21 typedef struct { 22 int Nx; // number of chips in x 23 int Ny; // number of chips in y 24 int Nfilter; // number of filters 25 int Nseason; // number of correction peridos 26 27 int Nchips; // chip offset (Nx*Ny) 28 int Nflats; // season offset (Nx*Ny*Nfilters) 29 int Nvalues; // Nx*Ny*Nfilters*Nseason 30 31 int dX; // superpixel size 32 int dY; // superpixel size 33 34 int NxCCD; // number of pixels 35 int NyCCD; // number of pixels 36 37 Matrix **matrix; // allocate an array of pointers 38 // index = ix + iy*Nx + filter*Nchips + dir*Ngroup 39 } CamCorrection; 19 40 20 41 /* global variables set in parameter file */ -
trunk/Ohana/src/uniphot/src/cam_correction.c
r38062 r39262 29 29 30 30 int Ndir, Nfilter, Nx, Ny, dX, dY, NxCCD, NyCCD; 31 if (!gfits_scan (&header, "NDIR", "%d", 1, &Ndir)) return FALSE;32 if (!gfits_scan (&header, "NFILTER", "%d", 1, &Nfilter)) return FALSE;31 if (!gfits_scan (&header, "NDIR", "%d", 1, &Ndir)) return FALSE; 32 if (!gfits_scan (&header, "NFILTER", "%d", 1, &Nfilter)) return FALSE; 33 33 if (!gfits_scan (&header, "NX", "%d", 1, &Nx)) return FALSE; 34 34 if (!gfits_scan (&header, "NY", "%d", 1, &Ny)) return FALSE; … … 61 61 } 62 62 63 int found = FALSE;64 63 while (TRUE) { 65 64 Header theader; … … 90 89 // assert that cam->matrix[index] is NULL? 91 90 cam->matrix[index] = matrix; 92 93 if (!found) {94 95 }96 91 } 97 92 return TRUE; -
trunk/Ohana/src/uniphot/src/initialize_setphot.c
r39138 r39262 33 33 34 34 int N; 35 36 CAM_FILE = NULL; 37 if ((N = get_argument (argc, argv, "-CAM"))) { 38 remove_argument (N, &argc, argv); 39 char *tmpfile = strcreate (argv[N]); 40 CAM_FILE = abspath (tmpfile, DVO_MAX_PATH); 41 remove_argument (N, &argc, argv); 42 } 43 CAM_RESET = FALSE; 44 if ((N = get_argument (argc, argv, "-CAM-reset"))) { 45 remove_argument (N, &argc, argv); 46 CAM_RESET = TRUE; 47 } 35 48 36 49 VERBOSE = FALSE; -
trunk/Ohana/src/uniphot/src/initialize_setphot_client.c
r38986 r39262 26 26 27 27 int N; 28 29 CAM_FILE = NULL; 30 if ((N = get_argument (argc, argv, "-CAM"))) { 31 remove_argument (N, &argc, argv); 32 char *tmpfile = strcreate (argv[N]); 33 CAM_FILE = abspath (tmpfile, DVO_MAX_PATH); 34 remove_argument (N, &argc, argv); 35 } 36 CAM_RESET = FALSE; 37 if ((N = get_argument (argc, argv, "-CAM-reset"))) { 38 remove_argument (N, &argc, argv); 39 CAM_RESET = TRUE; 40 } 28 41 29 42 VERBOSE = FALSE; -
trunk/Ohana/src/uniphot/src/setphot.c
r38986 r39262 8 8 ZptTable *zpts; 9 9 Image *image; 10 FlatCorrectionTable flatcorrTable; 10 11 // FlatCorrectionTable flatcorrTable; 11 12 12 13 /* get configuration info, args, lockfile */ … … 33 34 } 34 35 36 // if supplied, read in the camera-static flat-field correction 37 if (CAM_FILE) { 38 if (!load_cam_correction (CAM_FILE)) { 39 fprintf (stderr, "failed to load camera-static flat-field correction\n"); 40 exit (2); 41 } 42 merge_flatcorr_with_cam (flatcorrTable); 43 } else { 44 convert_flatcorr_to_cam (flatcorrTable); 45 } 46 47 { 48 char newflatfile[DVO_MAX_PATH]; 49 int size = snprintf (newflatfile, DVO_MAX_PATH, "%s/flatfield.fits", CATDIR); 50 assert (size < DVO_MAX_PATH); 51 save_cam_correction (newflatfile); 52 } 53 35 54 if (!zpts) Shutdown ("failed to load zero points, or empty table"); 36 55 … … 42 61 43 62 if (UBERCAL) { 44 match_flatcorr_to_images (image, Nimage, &flatcorrTable); 63 // we are going to deprecate the flatcorr imaage lookup 64 // match_flatcorr_to_images (image, Nimage, &flatcorrTable); 65 match_camcorr_to_images (image, Nimage); 45 66 } 46 67 47 68 if (!IMAGES_ONLY) { 48 status = update_dvo_setphot (image, Nimage , &flatcorrTable);69 status = update_dvo_setphot (image, Nimage); 49 70 } 50 71 -
trunk/Ohana/src/uniphot/src/update_catalog_setphot.c
r35425 r39262 1 1 # include "setphot.h" 2 2 3 void update_catalog_setphot (Catalog *catalog, Image *image, off_t *index, off_t Nimage , FlatCorrectionTable *flatcorr) {3 void update_catalog_setphot (Catalog *catalog, Image *image, off_t *index, off_t Nimage) { 4 4 5 5 off_t i, j, found; … … 7 7 // if we are resetting, reset all flags 8 8 DVOMeasureFlags photomFlags = ID_MEAS_POOR_PHOTOM | ID_MEAS_SKIP_PHOTOM | ID_MEAS_PHOTOM_UBERCAL; 9 10 CamCorrection *camcorr = get_cam_correction_ptr (); 9 11 10 12 found = 0; … … 21 23 float Mcal = image[id].Mcal; 22 24 float dMcal = image[id].dMcal; 23 float M cal_offset = 0.0;25 float Mflat = 0.0; 24 26 25 27 // if we know about a flat-field correction, then we need to apply the sub-chip correction 26 28 int flat_id = image[id].photom_map_id; 27 29 if (flat_id > 0) { 28 Mcal_offset = FlatCorrectionOffset (flatcorr, flat_id, catalog[0].measure[m].Xccd, catalog[0].measure[m].Yccd);30 Mflat = CamCorrectionOffset (camcorr, flat_id, catalog[0].measure[m].Xccd, catalog[0].measure[m].Yccd); 29 31 } 30 32 31 catalog[0].measure[m].Mcal = Mcal - Mcal_offset; 33 catalog[0].measure[m].Mcal = Mcal; 34 catalog[0].measure[m].Mflat = Mflat; 32 35 catalog[0].measure[m].dMcal = dMcal; 33 36 myAssert(isfinite(catalog[0].measure[m].Mcal), "oops: ubercal made a nan");
Note:
See TracChangeset
for help on using the changeset viewer.
