Changeset 36745
- Timestamp:
- May 12, 2014, 5:44:57 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140423/Ohana/src/photdbc
- Files:
-
- 1 added
- 8 edited
-
Makefile (modified) (2 diffs)
-
include/photdbc.h (modified) (3 diffs)
-
src/args.c (modified) (4 diffs)
-
src/copy_images.c (modified) (2 diffs)
-
src/initialize.c (modified) (2 diffs)
-
src/make_subcatalog.c (modified) (5 diffs)
-
src/photdbc.c (modified) (1 diff)
-
src/photdbc_catalogs.c (modified) (1 diff)
-
src/select_images.c (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140423/Ohana/src/photdbc/Makefile
r33655 r36745 31 31 $(SRC)/args.$(ARCH).o \ 32 32 $(SRC)/copy_images.$(ARCH).o \ 33 $(SRC)/select_images.$(ARCH).o \ 33 34 $(SRC)/Shutdown.$(ARCH).o \ 34 35 $(SRC)/join_stars.$(ARCH).o \ … … 41 42 $(SRC)/ConfigInit.$(ARCH).o \ 42 43 $(SRC)/args.$(ARCH).o \ 43 $(SRC)/copy_images.$(ARCH).o \44 44 $(SRC)/Shutdown.$(ARCH).o \ 45 45 $(SRC)/join_stars.$(ARCH).o \ -
branches/eam_branches/ipp-20140423/Ohana/src/photdbc/include/photdbc.h
r33963 r36745 20 20 int Nmeas; 21 21 } StatType; 22 23 typedef struct { 24 double Xc[5]; 25 double Yc[5]; 26 double Rc; 27 double Dc; 28 } SkyRegionCoords; 29 30 # define MARKTIME(MSG,...) { \ 31 gettimeofday (&stopTimer, (void *) NULL); \ 32 float dtime = DTIME (stopTimer, startTimer); \ 33 fprintf (stderr, MSG, __VA_ARGS__); } 34 35 # define INITTIME \ 36 struct timeval startTimer, stopTimer; \ 37 gettimeofday (&startTimer, (void *) NULL); 22 38 23 39 int PARALLEL; … … 80 96 PhotCodeData photcodes; 81 97 82 char *PHOTCODE_DROP_LIST, *PHOTCODE_ SKIP_LIST;83 int NphotcodesDrop, Nphotcodes Skip;84 PhotCode **photcodesDrop, **photcodes Skip;98 char *PHOTCODE_DROP_LIST, *PHOTCODE_KEEP_LIST; 99 int NphotcodesDrop, NphotcodesKeep; 100 PhotCode **photcodesDrop, **photcodesKeep; 85 101 86 102 # define FLAG_AREA 0X0001 … … 131 147 void SetProtect (int mode); 132 148 int SetSignals (void); 133 int copy_images (char *outdir );149 int copy_images (char *outdir, SkyList *skylist); 134 150 void usage(); 151 152 void dsortindex (double *X, off_t *Y, int N); 153 off_t getRegionStartByRA (double R, double *Rref, off_t Nregions); 154 155 Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage, int UseFullOverlap); 135 156 136 157 int photdbc_catalogs (char *outroot, SkyList *skylist, int hostID); -
branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/args.c
r33655 r36745 85 85 } 86 86 87 // measurements with these photcodes are not copied to the output 87 88 PHOTCODE_DROP_LIST = NULL; 88 89 if ((N = get_argument (argc, argv, "-photcode-drop"))) { … … 92 93 } 93 94 94 PHOTCODE_SKIP_LIST = NULL; 95 if ((N = get_argument (argc, argv, "-photcode-skip"))) { 96 remove_argument (N, &argc, argv); 97 PHOTCODE_SKIP_LIST = strcreate(argv[N]); 95 // measurements with these photcodes are kept ***regardless of quality*** 96 // -photcode-keep J will keep all J-band measurements of all kinds 97 // -photcode-keep GPC1.02.g will keep all g-band measurements from chip XY02 98 PHOTCODE_KEEP_LIST = NULL; 99 if ((N = get_argument (argc, argv, "-photcode-keep"))) { 100 remove_argument (N, &argc, argv); 101 PHOTCODE_KEEP_LIST = strcreate(argv[N]); 98 102 remove_argument (N, &argc, argv); 99 103 } … … 254 258 } 255 259 256 PHOTCODE_ SKIP_LIST = NULL;257 if ((N = get_argument (argc, argv, "-photcode- skip"))) {258 remove_argument (N, &argc, argv); 259 PHOTCODE_ SKIP_LIST = strcreate(argv[N]);260 PHOTCODE_KEEP_LIST = NULL; 261 if ((N = get_argument (argc, argv, "-photcode-keep"))) { 262 remove_argument (N, &argc, argv); 263 PHOTCODE_KEEP_LIST = strcreate(argv[N]); 260 264 remove_argument (N, &argc, argv); 261 265 } … … 290 294 291 295 fprintf (stderr, " -photcode-drop : remove these photcodes from the output (REF or DEP only)\n"); 292 fprintf (stderr, " -photcode- skip : ignore these photcodes when assessing the validity (keep unless object is dropped)\n");296 fprintf (stderr, " -photcode-keep : ignore these photcodes when assessing the validity (keep unless object is dropped)\n"); 293 297 294 298 fprintf (stderr, " -instmag (min) (max) : range of valid instrumental magnitudes (or measurements are dropped)\n"); -
branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/copy_images.c
r33655 r36745 1 1 # include "photdbc.h" 2 2 3 int copy_images (char *outdir ) {3 int copy_images (char *outdir, SkyList *skylist) { 4 4 5 5 int status; 6 off_t Nimage; 6 off_t Nimage, Nsubset; 7 off_t *LineNumber; 7 8 char *ImageOut; 8 9 unsigned int imageID; 9 10 FITS_DB in; 10 11 FITS_DB out; 11 Image *image ;12 Image *image, *subset; 12 13 struct stat filestat; 13 14 char *path; … … 50 51 exit (2); 51 52 } 52 dvo_image_addrows (&out, image, Nimage); 53 54 subset = select_images (skylist, image, Nimage, &LineNumber, &Nsubset, FALSE); 55 56 dvo_image_addrows (&out, subset, Nsubset); 53 57 54 58 // note that imageID is unsigned int -
branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/initialize.c
r33655 r36745 13 13 14 14 photcodesDrop = ParsePhotcodeList (PHOTCODE_DROP_LIST, &NphotcodesDrop, FALSE); 15 photcodes Skip = ParsePhotcodeList (PHOTCODE_SKIP_LIST, &NphotcodesSkip, FALSE);15 photcodesKeep = ParsePhotcodeList (PHOTCODE_KEEP_LIST, &NphotcodesKeep, FALSE); 16 16 17 17 if (SHOW_PARAMS) { … … 54 54 55 55 photcodesDrop = ParsePhotcodeList (PHOTCODE_DROP_LIST, &NphotcodesDrop, FALSE); 56 photcodes Skip = ParsePhotcodeList (PHOTCODE_SKIP_LIST, &NphotcodesSkip, FALSE);56 photcodesKeep = ParsePhotcodeList (PHOTCODE_KEEP_LIST, &NphotcodesKeep, FALSE); 57 57 58 58 if (SHOW_PARAMS) { -
branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/make_subcatalog.c
r31635 r36745 9 9 off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm, Nsecfilt; 10 10 double mag, minMag, minSigma; 11 int keep, *sec Skip;11 int keep, *secKeep; 12 12 PhotCode *photcode; 13 13 … … 16 16 17 17 // set up a list of SEC entries to ignore when evaluating a source 18 ALLOCATE (sec Skip, int, Nsecfilt);18 ALLOCATE (secKeep, int, Nsecfilt); 19 19 for (i = 0; i < Nsecfilt; i++) { 20 sec Skip[i] = FALSE;20 secKeep[i] = FALSE; 21 21 photcode = GetPhotcodebyNsec(i); 22 for (k = 0; k < Nphotcodes Skip; k++) {23 if (photcodes Skip[k][0].code != photcode[0].code) continue;24 sec Skip[i] = TRUE;22 for (k = 0; k < NphotcodesKeep; k++) { 23 if (photcodesKeep[k][0].code != photcode[0].code) continue; 24 secKeep[i] = TRUE; 25 25 } 26 26 } … … 67 67 keep = FALSE; 68 68 for (j = 0; !keep && (j < Nsecfilt); j++) { 69 if (sec Skip[j]) continue;69 if (secKeep[j]) continue; 70 70 if (catalog[0].secfilt[Nsecfilt*i+j].Ncode >= NCODE_MIN) { 71 71 keep = TRUE; … … 101 101 if (NphotcodesDrop > 0) { 102 102 found = FALSE; 103 for (k = 0; (k < Nphotcodes Skip) && !found; k++) {104 if (photcodes Skip[k][0].code == catalog[0].measure[offset].photcode) found = TRUE;105 if (photcodes Skip[k][0].code == GetPhotcodeEquivCodebyCode(catalog[0].measure[offset].photcode)) found = TRUE;103 for (k = 0; (k < NphotcodesDrop) && !found; k++) { 104 if (photcodesDrop[k][0].code == catalog[0].measure[offset].photcode) found = TRUE; 105 if (photcodesDrop[k][0].code == GetPhotcodeEquivCodebyCode(catalog[0].measure[offset].photcode)) found = TRUE; 106 106 } 107 107 if (found) continue; … … 109 109 110 110 // ignore certain photcodes to assess the measurements 111 if (Nphotcodes Skip > 0) {111 if (NphotcodesKeep > 0) { 112 112 found = FALSE; 113 for (k = 0; (k < Nphotcodes Skip) && !found; k++) {114 if (photcodes Skip[k][0].code == catalog[0].measure[offset].photcode) found = TRUE;115 if (photcodes Skip[k][0].code == GetPhotcodeEquivCodebyCode(catalog[0].measure[offset].photcode)) found = TRUE;113 for (k = 0; (k < NphotcodesKeep) && !found; k++) { 114 if (photcodesKeep[k][0].code == catalog[0].measure[offset].photcode) found = TRUE; 115 if (photcodesKeep[k][0].code == GetPhotcodeEquivCodebyCode(catalog[0].measure[offset].photcode)) found = TRUE; 116 116 } 117 117 if (found) goto keep; -
branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/photdbc.c
r33655 r36745 9 9 initialize (argc, argv); 10 10 11 // load and copy the image table12 copy_images (argv[1]);13 14 11 // the output catalog needs to inherit the SKY_DEPTH of the input catalog 15 12 sky = SkyTableLoadOptimal (CATDIR, NULL, NULL, TRUE, 0, VERBOSE); 16 13 SkyTableSetFilenames (sky, CATDIR, "cpt"); 17 14 skylist = SkyListByPatch (sky, -1, ®ION); 15 16 // load and copy the image table 17 copy_images (argv[1], skylist); 18 18 19 19 // hostID is 0 for master program -
branches/eam_branches/ipp-20140423/Ohana/src/photdbc/src/photdbc_catalogs.c
r33963 r36745 120 120 if (ExcludeByMaxMinMag) { snprintf (tmpline, DVO_MAX_PATH, "%s -maxminmag %f", command, MAX_MIN_MAG); strcpy (command, tmpline); } 121 121 if (PHOTCODE_DROP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-drop %s", command, PHOTCODE_DROP_LIST); strcpy (command, tmpline); } 122 if (PHOTCODE_ SKIP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-skip %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }122 if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-keep %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); } 123 123 if (CATFORMAT) { snprintf (tmpline, DVO_MAX_PATH, "%s -set-format %s", command, CATFORMAT); strcpy (command, tmpline); } 124 124 if (CATMODE) { snprintf (tmpline, DVO_MAX_PATH, "%s -set-mode %s", command, CATMODE); strcpy (command, tmpline); }
Note:
See TracChangeset
for help on using the changeset viewer.
