Changeset 38523
- Timestamp:
- Jun 23, 2015, 8:51:11 PM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150616/Ohana/src/addstar/src
- Files:
-
- 2 edited
-
LoadData.c (modified) (4 diffs)
-
LoadStars.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/LoadData.c
r38522 r38523 5 5 6 6 // examine the header sets and set the Image entries for the the valid images 7 int LoadData (FILE *f, AddstarFile *file, Image **images, off_t *nvalid, Stars **stars, unsigned int *Nstars, Header **headers, off_t *extsize, HeaderSet *headerSets, int Nimages, AddstarClientOptions *options) {7 Catalog *LoadData (FILE *f, AddstarFile *file, Image **images, off_t *nvalid, unsigned int *Ncatalog, Header **headers, off_t *extsize, HeaderSet *headerSets, int Nimages, AddstarClientOptions *options) { 8 8 9 9 off_t Nskip, Nvalid, NVALID; 10 10 int i, j, Nhead, Ndata; 11 11 uint32_t parentID = UINT32_MAX; 12 Stars *inStars; 12 13 int ncatalog = 0; 14 int NCATALOG = Nimages; 15 Catalog *catalog = NULL; 16 ALLOCATE (catalog, Catalog, NCATALOG); 13 17 14 18 if (images[0] == NULL) { … … 76 80 fseeko (f, Nskip, SEEK_SET); 77 81 78 inStars = ReadStarsFITS (f, headers[Nhead], headers[Ndata], &images[0][Nvalid].nstar);79 if (! inStars) {82 status = ReadStarsFITS (f, headers[Nhead], headers[Ndata], &images[0][Nvalid].nstar, &catalog[ncatalog]); 83 if (!status) { 80 84 // XXX need to free the data here or in ReadStarsFITS on error 81 85 continue; … … 91 95 fseeko (f, Nskip, SEEK_SET); 92 96 93 if (!ReadXradFITS (f, headers[Nxrad], inStars, images[0][Nvalid].nstar)) {97 if (!ReadXradFITS (f, headers[Nxrad], &catalog[ncatalog], images[0][Nvalid].nstar)) { 94 98 fprintf (stderr, "problem reading the radial flux data for %s\n", headerSets[i].extdata); 95 99 } 96 100 } 97 101 98 inStars = FilterStars (inStars, &images[0][Nvalid], Nvalid, options); 99 *stars = MergeStars (*stars, Nstars, inStars, images[0][Nvalid].nstar); 100 FREE (inStars); 102 FilterStars (&catalog[ncatalog], &images[0][Nvalid], Nvalid, options); 103 104 // XXX merge catalogs here : I should only have one output catalog! 105 106 // XXX need to merge here? 107 // *stars = MergeStars (*stars, Nstars, inStars, images[0][Nvalid].nstar); 108 // FREE (inStars); 101 109 102 110 Nvalid++; … … 115 123 } 116 124 125 // thoughts: 126 // 1) I read the data from a single image file into a catalog structure (instead of Stars) 127 // 2) merge these into a single catalog here or in LoadData above? -
branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/LoadStars.c
r38522 r38523 1 1 # include "addstar.h" 2 2 3 Stars *LoadStars (char *filename, unsigned int *Nstars, Image **images, off_t *Nimages, AddstarClientOptions *options) {3 Catalog *LoadStars (char *filename, unsigned int *Ncatalog, Image **images, off_t *Nimages, AddstarClientOptions *options) { 4 4 5 5 off_t *extsize; 6 6 int i, Nfile, mode; 7 Stars *stars;8 7 9 8 AddstarFile *file = LoadFilenames (&Nfile, filename, options); 10 9 11 10 *Nimages = 0; 12 *N stars= 0;11 *Ncatalog = 0; 13 12 *images = NULL; 14 stars= NULL;13 Catalog *catalog = NULL; 15 14 16 15 for (i = 0; i < Nfile; i++) { … … 23 22 // load PMM data if specified (these are not stored as FITS-tables) 24 23 if (PMM_CCD_TABLE != NULL) { 25 LoadDataPMM (f, file[i].imagename, images, Nimages, &stars, Nstars); 24 *Ncatalog = 1; 25 // XXX catalog = LoadDataPMM (f, file[i].imagename, images, Nimages); 26 26 continue; 27 27 } … … 58 58 // if these are SDSS data, load with SDSS-specific wrapper 59 59 if (headerSets[0].exttype && !strcmp (headerSets[0].exttype, "SDSS_OBJ")) { 60 LoadDataSDSS (f, file[i].imagename, images, Nimages, &stars, Nstars, headers, extsize, headerSets, NheaderSets); 60 *Ncatalog = 1; 61 // XXX catalog = LoadDataSDSS (f, file[i].imagename, images, Nimages, headers, extsize, headerSets, NheaderSets); 61 62 goto next_file; 62 63 } … … 64 65 // if these are SDSS data, load with SDSS-specific wrapper 65 66 if (headerSets[0].exttype && !strcmp (headerSets[0].exttype, "UKIRT_OBJ")) { 66 LoadDataUKIRT (f, file[i].imagename, images, Nimages, &stars, Nstars, headers, extsize, headerSets, NheaderSets); 67 *Ncatalog = 1; 68 // XXX catalog = LoadDataUKIRT (f, file[i].imagename, images, Nimages, headers, extsize, headerSets, NheaderSets); 67 69 goto next_file; 68 70 } 69 71 70 LoadData (f, &file[i], images, Nimages, &stars, Nstars, headers, extsize, headerSets, NheaderSets, options);72 catalog = LoadData (f, &file[i], images, Nimages, Ncatalog, headers, extsize, headerSets, NheaderSets, options); 71 73 72 74 next_file: … … 91 93 92 94 AddstarFileFree (file, Nfile); 93 return stars;95 return catalog; 94 96 } 95 97
Note:
See TracChangeset
for help on using the changeset viewer.
