Changeset 35664
- Timestamp:
- Jun 15, 2013, 3:42:29 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130509/Ohana/src/uniphot
- Files:
-
- 6 edited
-
Makefile (modified) (3 diffs)
-
include/fixstkids.h (modified) (3 diffs)
-
src/ImageSubsetFixStackIDs.c (modified) (1 diff)
-
src/initialize_fixstkids.c (modified) (1 diff)
-
src/load_images_fixstkids.c (modified) (4 diffs)
-
src/update_catalog_fixstkids.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130509/Ohana/src/uniphot/Makefile
r35593 r35664 1 default: uniphot setphot setphot_client setfwhm setposangle setposangle_client setastrom setastrom_client fiximids fiximids_client 1 default: uniphot setphot setphot_client setfwhm setposangle setposangle_client setastrom setastrom_client fiximids fiximids_client fixstkids fixstkids_client 2 2 help: 3 3 @echo "make options: uniphot setphot setfwhm default help install default (uniphot setphot setfwhm)" … … 27 27 fiximids: $(BIN)/fiximids.$(ARCH) 28 28 fiximids_client: $(BIN)/fiximids_client.$(ARCH) 29 fixstkids: $(BIN)/fixstkids.$(ARCH) 30 fixstkids_client: $(BIN)/fixstkids_client.$(ARCH) 29 31 30 install: $(DESTBIN)/uniphot $(DESTBIN)/setfwhm $(DESTBIN)/setphot $(DESTBIN)/setphot_client $(DESTBIN)/setposangle $(DESTBIN)/setposangle_client $(DESTBIN)/setastrom $(DESTBIN)/setastrom_client $(DESTBIN)/fiximids $(DESTBIN)/fiximids_client 32 install: $(DESTBIN)/uniphot $(DESTBIN)/setfwhm $(DESTBIN)/setphot $(DESTBIN)/setphot_client $(DESTBIN)/setposangle $(DESTBIN)/setposangle_client $(DESTBIN)/setastrom $(DESTBIN)/setastrom_client $(DESTBIN)/fiximids $(DESTBIN)/fiximids_client $(DESTBIN)/fixstkids $(DESTBIN)/fixstkids_client 31 33 32 34 UNIPHOT = \ … … 166 168 $(BIN)/fiximids_client.$(ARCH): $(FIXIMIDS_CLIENT) 167 169 170 FIXSTKIDS = \ 171 $(SRC)/fixstkids.$(ARCH).o \ 172 $(SRC)/initialize_fixstkids.$(ARCH).o \ 173 $(SRC)/load_images_fixstkids.$(ARCH).o \ 174 $(SRC)/ImageSubsetFixImageIDs.$(ARCH).o \ 175 $(SRC)/update_dvo_fixstkids.$(ARCH).o \ 176 $(SRC)/update_catalog_fixstkids.$(ARCH).o \ 177 $(SRC)/SetSignals.$(ARCH).o \ 178 $(SRC)/Shutdown.$(ARCH).o 179 180 $(FIXSTKIDS): $(INC)/fixstkids.h 181 $(BIN)/fixstkids.$(ARCH): $(FIXSTKIDS) 182 183 FIXSTKIDS_CLIENT = \ 184 $(SRC)/fixstkids_client.$(ARCH).o \ 185 $(SRC)/initialize_fixstkids.$(ARCH).o \ 186 $(SRC)/load_images_fixstkids.$(ARCH).o \ 187 $(SRC)/ImageSubsetFixStackIDs.$(ARCH).o \ 188 $(SRC)/update_dvo_fixstkids.$(ARCH).o \ 189 $(SRC)/update_catalog_fixstkids.$(ARCH).o \ 190 $(SRC)/SetSignals.$(ARCH).o \ 191 $(SRC)/Shutdown.$(ARCH).o 192 193 $(FIXSTKIDS_CLIENT): $(INC)/fixstkids.h 194 $(BIN)/fixstkids_client.$(ARCH): $(FIXSTKIDS_CLIENT) 195 -
branches/eam_branches/ipp-20130509/Ohana/src/uniphot/include/fixstkids.h
r35663 r35664 34 34 void ConfigInit PROTO((int *argc, char **argv)); 35 35 36 void usage_fixstkids PROTO(());37 void initialize_fixstkids PROTO((int argc, char **argv));38 int args_fixstkids PROTO((int argc, char **argv));36 void usage_fixstkids PROTO(()); 37 void initialize_fixstkids PROTO((int argc, char **argv)); 38 int args_fixstkids PROTO((int argc, char **argv)); 39 39 40 void usage_fixstkids_client PROTO(());41 void initialize_fixstkids_client PROTO((int argc, char **argv));42 int args_fixstkids_client PROTO((int argc, char **argv));40 void usage_fixstkids_client PROTO(()); 41 void initialize_fixstkids_client PROTO((int argc, char **argv)); 42 int args_fixstkids_client PROTO((int argc, char **argv)); 43 43 44 44 ImageSubset *ImageSubsetLoad PROTO((char *filename, off_t *nimage)); … … 52 52 int SetSignals PROTO((void)); 53 53 54 Image *load_images_fixstkids PROTO((FITS_DB *db, off_t *Nimage));55 int update_dvo_fixstkids PROTO((ImageSubset *image, off_t Nimage));56 int update_dvo_fixstkids_parallel PROTO((SkyTable *sky, ImageSubset *image, off_t Nimage));54 Image *load_images_fixstkids PROTO((FITS_DB *db, off_t *Nimage)); 55 int update_dvo_fixstkids PROTO((ImageSubset *image, off_t Nimage)); 56 int update_dvo_fixstkids_parallel PROTO((SkyTable *sky, ImageSubset *image, off_t Nimage)); 57 57 58 void update_catalog_fixstkids PROTO((Catalog *catalog));58 void update_catalog_fixstkids PROTO((Catalog *catalog)); 59 59 60 void sort_image_externID PROTO((unsigned int *I, unsigned int *E, short *C, unsigned int *Q, off_t N)); 60 61 void sort_image_times PROTO((e_time *S, e_time *E, short *C, unsigned int *I, unsigned int *Q, off_t N)); 61 int FindImageID PROTO((off_t *ID, off_t *Seq, e_time time, short photcode));62 int FindImageID PROTO((off_t *ID, off_t *Seq, short *photcode, off_t extID)); 62 63 void initImageIndex PROTO((ImageSubset *image, off_t Nimage_init)); 63 64 … … 69 70 int ImageValidSave PROTO((char *filename)); 70 71 int ImageValidLoad PROTO((char *filename)); 72 73 int UnpackPSPSStackDetectionID PROTO((int *sourceID, int *imageID, int *detID, uint64_t pspsStackID)); -
branches/eam_branches/ipp-20130509/Ohana/src/uniphot/src/ImageSubsetFixStackIDs.c
r35663 r35664 58 58 GET_COLUMN (imageID, "IMAGE_ID", int); 59 59 GET_COLUMN (externID, "EXTERN_ID", int); 60 GET_COLUMN (nstar, " nstar", int);60 GET_COLUMN (nstar, "NSTAR", int); 61 61 GET_COLUMN (photcode, "PHOTCODE", short); 62 62 -
branches/eam_branches/ipp-20130509/Ohana/src/uniphot/src/initialize_fixstkids.c
r35663 r35664 68 68 remove_argument (N, &argc, argv); 69 69 } 70 71 // XXX I want to avoid running this on all data all the time72 // some options: gpc1 only (hardwired), require photcodes (fairly tedious),73 // exclude some photcodes?74 // XXX for now, hardwire gpc1 photcodes75 70 76 71 SINGLE_CPT = NULL; -
branches/eam_branches/ipp-20130509/Ohana/src/uniphot/src/load_images_fixstkids.c
r35663 r35664 2 2 # define FT_BZERO_INT32 1.0*0x80000000 3 3 4 off_t Nimage = 0; 5 e_time *startImage = NULL; 6 e_time *stopImage = NULL; 7 short *photcodeImage = NULL; 8 unsigned int *imageID = NULL; 9 unsigned int *imageSeq = NULL; 4 off_t Nimage = 0; 5 short *photcodeImage = NULL; 6 unsigned int *imageID = NULL; 7 unsigned int *externID = NULL; 8 unsigned int *imageSeq = NULL; 10 9 int *Nimage_valid = NULL; 11 10 int *Nimage_invalid = NULL; … … 93 92 *ID = imageID[N]; 94 93 *Seq = imageSeq[N]; 94 95 for (Ni = N + 1; Ni < Nimage; Ni++) { 96 if (extID < externID[Ni]) break; 97 if (externID[Ni] == extID) { 98 fprintf (stderr, "found second image ID matching extern ID?\n"); 99 fprintf (stderr, "first ext ID: %d, image ID: %d, photcode: %d\n", externID[N], imageID[N], photcodeImage[N]); 100 fprintf (stderr, "second ext ID: %d, image ID: %d, photcode: %d\n", externID[Ni], imageID[Ni], photcodeImage[Ni]); 101 exit (2); 102 } 103 } 95 104 return TRUE; 96 105 } … … 122 131 if (image[i].photcode == 0) continue; // skip images with 0 photcode (eg, PHU) 123 132 124 char *date = ohana_sec_to_date (image[i].tzero);125 133 char *code = GetPhotcodeNamebyCode (image[i].photcode); 126 fprintf (stderr, "image %s %s : %d %d %d : %f\n", date, code, image[i].nstar, Nimage_valid[i], Nimage_invalid[i],134 fprintf (stderr, "image %s extID %d imageID %d : %d %d %d : %f\n", code, image[i].imageID, image[i].externID, image[i].nstar, Nimage_valid[i], Nimage_invalid[i], 127 135 (Nimage_valid[i] + Nimage_invalid[i]) / (float) image[i].nstar); 128 136 } … … 166 174 tmp_u = Q[A]; Q[A] = Q[B]; Q[B] = tmp_u; \ 167 175 } 168 # define COMPARE(A,B)( S[A] < S[B])176 # define COMPARE(A,B)(E[A] < E[B]) 169 177 170 178 OHANA_SORT (N, COMPARE, SWAPFUNC); -
branches/eam_branches/ipp-20130509/Ohana/src/uniphot/src/update_catalog_fixstkids.c
r35663 r35664 9 9 off_t Ninvalid = 0; 10 10 11 off_t imageIDs[MAX_DUPS];11 int sourceID, externID, detID; 12 12 13 13 for (i = 0; i < catalog[0].Nmeasure; i++) { … … 18 18 19 19 // reverse engineer the detID, imageID, sourceID from the psps det ID (extID) 20 UnpackPSPS stackDetID (&sourceID, &externID, &detID, catalog[0].measure[i].extID);20 UnpackPSPSStackDetectionID (&sourceID, &externID, &detID, catalog[0].measure[i].extID); 21 21 myAssert (sourceID = 35, "problem with source ID %d (%0x08 %0x08)", sourceID, catalog[0].measure[i].objID, catalog[0].measure[i].catID); 22 22 myAssert (detID = catalog[0].measure[i].detID, "problem with det ID %d (%0x08 %0x08)", detID, catalog[0].measure[i].objID, catalog[0].measure[i].catID); … … 24 24 // we now have the externID of the given detection -- find the real image in the image table 25 25 off_t imageID, Seq; 26 short Photcode; 26 27 if (!FindImageID (&imageID, &Seq, &Photcode, externID)) continue; 27 28 … … 32 33 33 34 // validate the photcode and time? 34 myAssert (catalog[0].measure[i].photcode == Photcode, "bad photcode match? objID, catID: (%0x08 %0x08), imageID, externID: %d, %d", catalog[0].measure[i].objID, catalog[0].measure[i].catID, imageID, externID)35 myAssert (catalog[0].measure[i].photcode == Photcode, "bad photcode match? objID, catID: (%0x08 %0x08), imageID, externID: "OFF_T_FMT", %d", catalog[0].measure[i].objID, catalog[0].measure[i].catID, imageID, externID) 35 36 36 37 if (imageID == catalog[0].measure[i].imageID) { … … 53 54 } 54 55 56 int UnpackPSPSStackDetectionID(int *sourceID, int *imageID, int *detID, uint64_t pspsStackID) 57 { 58 // sourceID : ID of database + table that tracked the image (< 0x7f = 127) 59 // imageID : external ID of the image which provided the detections (< 0x1000.0000 ~ 2.7e8) 60 // detID : detection sequence in image (< 0x1000.0000 ~ 2.7e8) 61 62 // 0x0000.0000.0000.0000 63 64 // bits 0 - 27 : 0x0000.0000.0fff.ffff 65 // bits 28 - 55 : 0x00ff.ffff.f000.0000 66 // bits 56 - 63 : 0xff00.0000.0000.0000 67 68 *sourceID = (pspsStackID & (uint64_t) 0xff00000000000000) >> 56; 69 *imageID = (pspsStackID & (uint64_t) 0x00fffffff0000000) >> 28; 70 *detID = (pspsStackID & (uint64_t) 0x000000000fffffff); 71 72 return TRUE; 73 } 74
Note:
See TracChangeset
for help on using the changeset viewer.
