Changeset 40129
- Timestamp:
- Sep 8, 2017, 3:28:50 PM (9 years ago)
- Location:
- branches/czw_branch/20170908/Ohana/src/uniphot/src
- Files:
-
- 4 edited
-
cam_zpt_correction.c (modified) (2 diffs)
-
initialize_setphot.c (modified) (1 diff)
-
match_camcorr_to_images.c (modified) (2 diffs)
-
setphot.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20170908/Ohana/src/uniphot/src/cam_zpt_correction.c
r39288 r40129 100 100 char field[256]; 101 101 double value; 102 102 103 103 snprintf (field, 256, "TS_%03d", i); 104 104 if (!gfits_scan (phu, field, "%lf", 1, &value)) return FALSE; 105 105 cam->tstart[i] = ohana_mjd_to_sec(value); 106 106 107 107 snprintf (field, 256, "TE_%03d", i); 108 108 if (!gfits_scan (phu, field, "%lf", 1, &value)) return FALSE; … … 174 174 if (!flat_id) return 0.0; 175 175 176 myAssert (flat_id > 0, "flat_id out of range"); 177 myAssert (flat_id <= cam->Nvalues, "flat_id out of range"); 178 176 // myAssert (flat_id > 0, "flat_id out of range"); 177 // myAssert (flat_id <= cam->Nvalues, "flat_id out of range"); 178 if ((flat_id < 0)||(flat_id > cam->Nvalues)) { return 0.0; } 179 179 180 // validate the flat_id (not out of range?) 180 181 // NOTE: we are setting the ID to be the sequence + 1 (match_camcorr_to_images.c:39) -
branches/czw_branch/20170908/Ohana/src/uniphot/src/initialize_setphot.c
r39926 r40129 217 217 218 218 219 if (argc !=2) {219 if (argc > 2) { 220 220 fprintf (stderr, "USAGE: setphot (zptfile) [options]\n"); 221 221 fprintf (stderr, " options:\n"); -
branches/czw_branch/20170908/Ohana/src/uniphot/src/match_camcorr_to_images.c
r39288 r40129 14 14 // season comes from the date/time 15 15 16 int minCode = 10000; 17 int maxCode = 10576; 16 int minCodeGPC1 = 10000; 17 int maxCodeGPC1 = 10576; 18 19 int minCodeHSC = 20000; 20 int maxCodeHSC = 26111; 18 21 19 22 int Nmissed = 0; 23 24 int isGPC1 = FALSE; 25 int isHSC = FALSE; 20 26 21 27 for (i = 0; i < Nimage; i++) { 22 28 if (!image[i].photcode) continue; // skip PHU images 23 29 24 if (image[i].photcode < minCode) continue; // skip non-gpc1-chip images 25 if (image[i].photcode > maxCode) continue; // skip non-gpc1-chip images 30 if ((image[i].photcode >= minCodeGPC1)&&(image[i].photcode <= maxCodeGPC1)) { 31 isGPC1 = TRUE; 32 isHSC = FALSE; 33 } 34 else if ((image[i].photcode >= minCodeHSC)&&(image[i].photcode <= maxCodeHSC)) { 35 isGPC1 = FALSE; 36 isHSC = TRUE; 37 } 26 38 39 if (!(isGPC1) && !(isHSC)) { continue; } 40 27 41 int found = FALSE; 28 42 for (j = 0; !found && (j < camcorr->Nseason); j++) { … … 30 44 if (image[i].tzero > camcorr->tstop[j]) continue; 31 45 46 int seq; 32 47 int photcode = image[i].photcode; 33 int iy = photcode % 10; 34 int ix = (int)(photcode / 10) % 10; 35 int filter = (int)(photcode / 100) % 10; 48 49 if (isGPC1) { 50 int iy = photcode % 10; 51 int ix = (int)(photcode / 10) % 10; 52 int filter = (int)(photcode / 100) % 10; 53 54 seq = ix + iy * camcorr->Nx + filter * camcorr->Nchips + j * camcorr->Nflats; 55 } 56 else if (isHSC) { 57 int ix = photcode % 112; 58 int filter = (int)(photcode / 1000) % 10; 59 60 seq = ix + filter * camcorr->Nchips + j * camcorr->Nflats; 61 } 36 62 37 63 // we add one so photom_map_id = 0 can mean no map 38 int seq = ix + iy * camcorr->Nx + filter * camcorr->Nchips + j * camcorr->Nflats;39 64 image[i].photom_map_id = seq + 1; 40 65 found = TRUE; -
branches/czw_branch/20170908/Ohana/src/uniphot/src/setphot.c
r39288 r40129 37 37 } 38 38 camcorr = merge_flatcorr_and_camcorr (&flatcorrTable, rawcorr); 39 39 40 40 char newflatfile[DVO_MAX_PATH]; 41 41 size = snprintf (newflatfile, DVO_MAX_PATH, "%s/flatfield.fits", CATDIR); … … 43 43 CamPhotomCorrectionSave (camcorr, newflatfile); 44 44 } else { 45 zpts = load_zpt_table (argv[1], &Nzpts);45 // zpts = load_zpt_table (argv[1], &Nzpts); 46 46 } 47 47 48 if (!zpts) Shutdown ("failed to load zero points, or empty table"); 48 if ((CAM_PHOTOM_FILE)&&(!camcorr)) { 49 CamPhotomCorrection *rawcorr = CamPhotomCorrectionLoad(CAM_PHOTOM_FILE); 50 if (!rawcorr) { 51 fprintf (stderr, "failed to load camera-static flat-field correction\n"); 52 exit (2); 53 } 54 camcorr = rawcorr; 55 char newflatfile[DVO_MAX_PATH]; 56 int size = snprintf (newflatfile, DVO_MAX_PATH, "%s/flatfield.fits", CATDIR); 57 assert (size < DVO_MAX_PATH); 58 CamPhotomCorrectionSave (camcorr, newflatfile); 59 60 // zpts = load_zpt_table (argv[1], &Nzpts); 61 } 62 63 64 // if (!zpts) Shutdown ("failed to load zero points, or empty table"); 49 65 50 66 // load images … … 52 68 if (!UPDATE) dvo_image_unlock (&db); 53 69 54 match_zpts_to_images (image, Nimage, zpts, Nzpts);70 // match_zpts_to_images (image, Nimage, zpts, Nzpts); 55 71 56 if (UBERCAL) {72 // if (UBERCAL) { 57 73 // we are going to deprecate the flatcorr imaage lookup 58 74 // match_flatcorr_to_images (image, Nimage, &flatcorrTable); 59 75 match_camcorr_to_images (image, Nimage, camcorr); 60 }76 // } 61 77 62 78 if (!IMAGES_ONLY) {
Note:
See TracChangeset
for help on using the changeset viewer.
