Changeset 37357 for trunk/Ohana
- Timestamp:
- Sep 4, 2014, 7:55:12 AM (12 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 8 edited
- 1 copied
-
Makefile (modified) (1 diff)
-
include/addstar.h (modified) (3 diffs)
-
src/FilterStars.c (modified) (2 diffs)
-
src/LoadData.c (modified) (1 diff)
-
src/MatchHeaders.c (modified) (1 diff)
-
src/ReadXradFITS.c (copied) (copied from branches/eam_branches/ipp-20140813/Ohana/src/addstar/src/ReadXradFITS.c )
-
src/UpdateImageIDs.c (modified) (1 diff)
-
src/addstar.c (modified) (8 diffs)
-
src/args.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/Makefile
r37116 r37357 86 86 $(SRC)/ReadStarsTEXT.$(ARCH).o \ 87 87 $(SRC)/ReadStarsSDSS.$(ARCH).o \ 88 $(SRC)/ReadXradFITS.$(ARCH).o \ 88 89 $(SRC)/FilterStars.$(ARCH).o \ 89 90 $(SRC)/ImageOptions.$(ARCH).o \ -
trunk/Ohana/src/addstar/include/addstar.h
r37116 r37357 35 35 char *exthead; 36 36 char *extdata; 37 char *extxrad; 37 38 char *exttype; 38 39 int extnum_head; 39 40 int extnum_data; 41 int extnum_xrad; 40 42 } HeaderSet; 41 43 … … 146 148 147 149 int OLD_RESORT; 150 int READ_XRAD_DATA; 148 151 149 152 int PARALLEL; … … 250 253 Stars *FilterStars PROTO((Stars *instars, Image *image, unsigned int imageID, const AddstarClientOptions *options)); 251 254 Stars *MergeStars PROTO((Stars *stars, unsigned int *Nstars, Stars *instars, unsigned int Ninstars)); 255 256 int ReadXradFITS PROTO((FILE *f, Header *theader, Stars *stars, unsigned int Nstars)); 257 252 258 double scat_subpix PROTO((double x, double y)); 253 259 void update_coords PROTO((Average *average, Measure *measure, off_t *next)); -
trunk/Ohana/src/addstar/src/FilterStars.c
r37036 r37357 9 9 10 10 // the imageID supplied here is the sequence **within this set** 11 // this value is updated based on the image table later 11 // this value is updated based on the image table later (in UpdateImageIDs) 12 12 Stars *FilterStars (Stars *instars, Image *image, unsigned int imageID, const AddstarClientOptions *options) { 13 13 … … 127 127 stars[N].measure.imageID = imageID; // this value is updated in UpdateImageIDs 128 128 129 // add imageID to lensing entry, if it exists 130 if (stars[N].lensing) { 131 stars[N].lensing->imageID = imageID; 132 } 133 129 134 N ++; 130 135 } -
trunk/Ohana/src/addstar/src/LoadData.c
r34088 r37357 83 83 continue; 84 84 } 85 86 // XRAD : if we want to read the xrad table, skip to that table here: 87 if (headerSets[i].extnum_xrad != -1) { 88 int Nxrad = headerSets[i].extnum_xrad; 89 Nskip = 0; 90 for (j = 0; j < Nxrad; j++) { 91 Nskip += extsize[j]; 92 } 93 fseeko (f, Nskip, SEEK_SET); 94 95 if (!ReadXradFITS (f, headers[Nxrad], inStars, images[0][Nvalid].nstar)) { 96 fprintf (stderr, "problem reading the radial flux data for %s\n", headerSets[i].extdata); 97 } 98 } 99 85 100 inStars = FilterStars (inStars, &images[0][Nvalid], Nvalid, options); 86 101 *stars = MergeStars (*stars, Nstars, inStars, images[0][Nvalid].nstar); -
trunk/Ohana/src/addstar/src/MatchHeaders.c
r37054 r37357 79 79 headerSets[Nimage].extdata = strcreate (extname); 80 80 headerSets[Nimage].exthead = strcreate (exthead); 81 headerSets[Nimage].extxrad = NULL; 81 82 headerSets[Nimage].extnum_data = i; 82 83 headerSets[Nimage].extnum_head = -1; 84 headerSets[Nimage].extnum_xrad = -1; 85 86 // XXX a special case for fforce xrad data 87 if (READ_XRAD_DATA) { 88 // extname is foobar.psf, convert to foobar.xrad 89 int Nchar = strlen (extname); // foobar.psf : Nchar = 10 90 ALLOCATE (headerSets[Nimage].extxrad, char, Nchar + 2); // xrad is 1 longer than psf 91 memcpy (headerSets[Nimage].extxrad, extname, Nchar - 3); // Nchar - 3 = 7 92 memcpy (&headerSets[Nimage].extxrad[Nchar-3], "xrad", 4); 93 headerSets[Nimage].extxrad[Nchar + 1] = 0; // put the 0 at element 11 for foobar.xrad\0 94 } 83 95 84 96 // find the matching exthead entry 85 97 for (j = 0; j < Nheaders; j++) { 86 98 if (!gfits_scan (headers[j], ExtnameKeyword, "%s", 1, extname)) continue; 87 if (strcmp (extname, headerSets[Nimage].exthead)) continue; 88 headerSets[Nimage].extnum_head = j; 89 break; 99 if (!strcmp (extname, headerSets[Nimage].exthead)) { 100 headerSets[Nimage].extnum_head = j; 101 if (!READ_XRAD_DATA) break; 102 } 103 if (READ_XRAD_DATA && !strcmp (extname, headerSets[Nimage].extxrad)) { 104 headerSets[Nimage].extnum_xrad = j; 105 } 106 if ((headerSets[Nimage].extnum_head > -1) && (headerSets[Nimage].extnum_xrad > -1)) { 107 // we can only get here if READ_XRAD_DATA is true 108 break; 109 } 90 110 } 91 111 -
trunk/Ohana/src/addstar/src/UpdateImageIDs.c
r35579 r37357 55 55 for (i = 0; i < Nstars; i++) { 56 56 stars[i].measure.imageID += imageID; 57 if (stars[i].lensing) { 58 stars[i].lensing->imageID += imageID; 59 } 57 60 } 58 61 -
trunk/Ohana/src/addstar/src/addstar.c
r37116 r37357 1 1 # include "addstar.h" 2 3 # define RESETTIME { gettimeofday (&startTimer, (void *) NULL); } 2 4 3 5 // LARGEFILES: this program currently limits Nstars (input file) to < 2^31 … … 18 20 SkyList *newlist = NULL; 19 21 20 double dtime;21 struct timeval start, stop;22 23 gettimeofday (&start, NULL);22 struct timeval startAddstar, stopAddstar; 23 gettimeofday (&startAddstar, (void *) NULL); 24 25 INITTIME; 24 26 25 27 SetSignals (); … … 44 46 } 45 47 48 MARKTIME ("init and config: %f sec\n", dtime); RESETTIME; 49 46 50 stars = NULL; 47 51 … … 50 54 case ADDSTAR_MODE_IMAGE: 51 55 stars = LoadStars (argv[1], &Nstars, &images, &Nimages, &options); 56 MARKTIME ("load smf: %f sec\n", dtime); RESETTIME; 52 57 53 58 // set and update the imageID sequence … … 127 132 } 128 133 } 134 MARKTIME ("load cpt: %f sec\n", dtime); RESETTIME; 129 135 130 136 // Naves_disk == 0 implies an empty catalog file … … 157 163 break; 158 164 } 165 MARKTIME ("match stars: %f sec\n", dtime); RESETTIME; 166 159 167 /* report total updated values */ 160 168 Naverage += catalog.Naverage; … … 175 183 dvo_catalog_unlock (&catalog); 176 184 dvo_catalog_free (&catalog); 185 MARKTIME ("save cpt: %f sec\n", dtime); RESETTIME; 177 186 178 187 if (options.mode == ADDSTAR_MODE_REFCAT) free (stars); … … 208 217 dvo_image_unlock (&db); /* unlock? */ 209 218 210 gettimeofday (&stop ,NULL);211 dtime = DTIME (stop, start);219 gettimeofday (&stopAddstar, (void *) NULL); 220 float dtime = DTIME (stopAddstar, startAddstar); 212 221 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); 213 222 -
trunk/Ohana/src/addstar/src/args.c
r37116 r37357 81 81 PMM_CCD_TABLE = strcreate (argv[N]); 82 82 remove_argument (N, &argc, argv); 83 } 84 85 READ_XRAD_DATA = FALSE; 86 if ((N = get_argument (argc, argv, "-xrad"))) { 87 remove_argument (N, &argc, argv); 88 READ_XRAD_DATA = TRUE; 83 89 } 84 90
Note:
See TracChangeset
for help on using the changeset viewer.
