Changeset 16810 for trunk/Ohana/src/addstar
- Timestamp:
- Mar 4, 2008, 12:39:41 PM (19 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 11 added
- 32 edited
-
Makefile (modified) (6 diffs)
-
doc/2mass.txt (added)
-
doc/notes.txt (modified) (1 diff)
-
doc/sdss-tsObj.txt (added)
-
doc/sdss.txt (added)
-
include/2mass.h (modified) (1 diff)
-
include/addstar.h (modified) (4 diffs)
-
src/FilterStars.c (modified) (2 diffs)
-
src/GetFileMode.c (modified) (1 diff)
-
src/ImageOptions.c (modified) (4 diffs)
-
src/LoadData.c (added)
-
src/LoadDataSDSS.c (added)
-
src/LoadHeaders.c (added)
-
src/LoadStars.c (modified) (4 diffs)
-
src/MatchHeaders.c (added)
-
src/ReadImageHeader.c (modified) (3 diffs)
-
src/ReadSDSSHeader.c (added)
-
src/ReadStarsFITS.c (modified) (5 diffs)
-
src/ReadStarsSDSS.c (added)
-
src/ReadStarsTEXT.c (modified) (1 diff)
-
src/SEDfit.c (modified) (4 diffs)
-
src/UpdateImageIDs.c (added)
-
src/addstar.c (modified) (1 diff)
-
src/addstarc.c (modified) (1 diff)
-
src/args.c (modified) (1 diff)
-
src/build_links.c (modified) (11 diffs)
-
src/calibrate.c (modified) (1 diff)
-
src/fakeimage.c (modified) (2 diffs)
-
src/find_matches.c (modified) (10 diffs)
-
src/find_matches_closest.c (modified) (10 diffs)
-
src/find_matches_refstars.c (modified) (14 diffs)
-
src/get2mass_dr2.c (modified) (1 diff)
-
src/get2mass_full.c (added)
-
src/get2mass_ops.c (modified) (5 diffs)
-
src/getgsc.c (modified) (1 diff)
-
src/gettycho.c (modified) (1 diff)
-
src/getusno.c (modified) (1 diff)
-
src/getusnob.c (modified) (1 diff)
-
src/grefstars.c (modified) (1 diff)
-
src/load2mass_as_rawdata.c (modified) (2 diffs)
-
src/load2mass_catalog.c (modified) (2 diffs)
-
src/replace_match.c (modified) (2 diffs)
-
src/update_coords.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/Makefile
r16040 r16810 13 13 14 14 # programs may add their own internal requirements here 15 FULL_CFLAGS = $(BASE_CFLAGS) 15 FULL_CFLAGS = $(BASE_CFLAGS) -Wall -Werror 16 16 FULL_CPPFLAGS = $(BASE_CPPFLAGS) 17 17 FULL_LDFLAGS = -lkapa -ldvo -lFITS -lohana $(BASE_LDFLAGS) … … 59 59 $(SRC)/grefstars.$(ARCH).o \ 60 60 $(SRC)/LoadStars.$(ARCH).o \ 61 $(SRC)/LoadHeaders.$(ARCH).o \ 62 $(SRC)/MatchHeaders.$(ARCH).o \ 63 $(SRC)/LoadData.$(ARCH).o \ 64 $(SRC)/LoadDataSDSS.$(ARCH).o \ 61 65 $(SRC)/in_image.$(ARCH).o \ 62 66 $(SRC)/load_subpix.$(ARCH).o \ … … 67 71 $(SRC)/ReadStarsFITS.$(ARCH).o \ 68 72 $(SRC)/ReadStarsTEXT.$(ARCH).o \ 73 $(SRC)/ReadStarsSDSS.$(ARCH).o \ 69 74 $(SRC)/FilterStars.$(ARCH).o \ 70 75 $(SRC)/ImageOptions.$(ARCH).o \ 71 76 $(SRC)/GetFileMode.$(ARCH).o \ 72 77 $(SRC)/ReadImageHeader.$(ARCH).o \ 78 $(SRC)/UpdateImageIDs.$(ARCH).o \ 73 79 $(SRC)/update_coords.$(ARCH).o 74 80 … … 165 171 $(SRC)/ConfigInit.$(ARCH).o \ 166 172 $(SRC)/LoadStars.$(ARCH).o \ 173 $(SRC)/LoadHeaders.$(ARCH).o \ 174 $(SRC)/MatchHeaders.$(ARCH).o \ 175 $(SRC)/LoadData.$(ARCH).o \ 176 $(SRC)/LoadDataSDSS.$(ARCH).o \ 167 177 $(SRC)/grefstars.$(ARCH).o \ 168 178 $(SRC)/load_subpix.$(ARCH).o \ … … 172 182 $(SRC)/ReadImageHeader.$(ARCH).o \ 173 183 $(SRC)/ReadStarsTEXT.$(ARCH).o \ 184 $(SRC)/ReadStarsSDSS.$(ARCH).o \ 185 $(SRC)/UpdateImageIDs.$(ARCH).o \ 174 186 $(SRC)/FilterStars.$(ARCH).o \ 175 187 $(SRC)/Shutdown.$(ARCH).o \ … … 189 201 $(SRC)/load2mass_catalog.$(ARCH).o \ 190 202 $(SRC)/get2mass_ops.$(ARCH).o \ 203 $(SRC)/get2mass_full.$(ARCH).o \ 191 204 $(SRC)/find_matches_refstars.$(ARCH).o \ 192 205 $(SRC)/args_load2mass.$(ARCH).o \ -
trunk/Ohana/src/addstar/doc/notes.txt
r16271 r16810 1 2 2008.02.23 3 4 features I need to add / finish in dvo: 5 6 * detID / objID / imageID 7 8 some questions: 9 10 db_id 11 table_id (chip / warp / stack / diff) 12 chip_id / warp_id / stack_id / diff_id 13 14 detections from stand-alone analysis would require an alternate sequence? 15 detections without an associated image get image_id = 0 16 17 * imageID : we will define a new, unique running ID within dvo 18 against which joins are performed. in addition, I will keep the 19 externally supplied ids as a reference (32bit id + 16bit source) 20 21 * detID : the detection (measure) should carry the imageID + detID as a 22 unique value. 23 24 * objID : objects will get a unique ID when they are created 25 (sequence in table + table ID? or use the same bits as Maria?) 26 27 * extended measurement tables 28 * SDSS ingest 29 * 2MASS flags 30 1 31 2 32 2008.01.31 -
trunk/Ohana/src/addstar/include/2mass.h
r8361 r16810 42 42 int get2mass_star (Stars *star, char *line, int Nmax); 43 43 int get2mass_3star (Stars *star, char *line, int Nmax); 44 45 int get2mass_3star_full (Stars *star, char *line, int Nmax); 46 char *next2MASSfield (char *line); 47 int set2MASS_ph_qual (Stars *star, char qual); 48 int set2MASS_rd_flag (Stars *star, char qual); 49 int set2MASS_cc_flag (Stars *star, char qual); 50 int set2MASS_bl_flag (Stars *star, char qual); 51 int set2MASS_gal_flag (Stars *star, char qual); 52 int set2MASS_mp_flag (Stars *star, char qual); 53 int set2MASS_dup_flag (Stars *star, char qual); 54 int set2MASS_use_flag (Stars *star, char qual); -
trunk/Ohana/src/addstar/include/addstar.h
r15210 r16810 51 51 52 52 enum {M_IMAGE, M_REFLIST, M_REFCAT, M_FAKEIMAGE, M_RESORT}; 53 enum {NONE, SIMPLE_CMP, SIMPLE_CMF, SIMPLE_MEF, MOSAIC_CMP, MOSAIC_CMF, MOSAIC_MEF, MOSAIC_PHU };53 enum {NONE, SIMPLE_CMP, SIMPLE_CMF, SIMPLE_MEF, MOSAIC_CMP, MOSAIC_CMF, MOSAIC_MEF, MOSAIC_PHU, SDSS_OBJ}; 54 54 /* note: MEF implies CMF */ 55 55 … … 163 163 Stars *grefstars PROTO((char *file, int photcode, int *Nstars)); 164 164 165 Stars *LoadStars PROTO((char *file, int *Nstars, Image **images, int *Nimages, int photcode));165 Stars *LoadStars PROTO((char *file, int *Nstars, Image **images, int *Nimages, AddstarClientOptions *options)); 166 166 Header **LoadHeaders PROTO((FILE *f, int *mode, int *Nheader)); 167 167 HeaderSet *MatchHeaders PROTO((int **extsize, int *nimage, int mode, Header **headers, int Nheaders)); … … 185 185 Stars *ReadStarsFITS PROTO((FILE *f, Header *header, Header *in_theader, unsigned int *nstars)); 186 186 Stars *ReadStarsTEXT PROTO((FILE *f, unsigned int *nstars)); 187 Stars *ReadStarsSDSS PROTO((FILE *f, char *name, Header *header, Header *in_theader, Image *images, int *nimages, unsigned int *nstars)); 187 188 int ReadImageHeader PROTO((Header *header, Image *image, int photcode)); 188 Stars *FilterStars PROTO((Stars *instars, Image *image ));189 Stars *FilterStars PROTO((Stars *instars, Image *image, unsigned int imageID)); 189 190 Stars *MergeStars PROTO((Stars *stars, int *Nstars, Stars *instars, int Ninstars)); 190 191 void save_pt_catalog PROTO((Catalog *catalog)); /*** choose new name ***/ … … 245 246 int args_skycells (int argc, char **argv); 246 247 int ConfigInit_skycells (int *argc, char **argv); 248 int UpdateImageIDs (Stars *stars, int Nstars, Image *images, int Nimages); 249 int LoadDataSDSS (FILE *f, char *file, Image **images, int *nvalid, Stars **stars, int *Nstars, Header **headers, int *extsize, HeaderSet *headerSets, int Nimages); 250 int altaz (double *alt, double *az, double ha, double dec, double latitude); 247 251 248 252 // this is a gnu extension?? caution! -
trunk/Ohana/src/addstar/src/FilterStars.c
r15514 r16810 1 1 # include "addstar.h" 2 2 3 Stars *FilterStars (Stars *instars, Image *image ) {3 Stars *FilterStars (Stars *instars, Image *image, unsigned int imageID) { 4 4 5 5 int j, N; … … 65 65 stars[N].M += MTIME - dMs; 66 66 } 67 if (!isnan(stars[N].Mgal)) {68 stars[N].Mgal += MTIME - dMs;69 }70 67 if (!isnan(stars[N].Map)) { 71 68 stars[N].Map += MTIME - dMs; 72 69 } 73 70 71 // XXX currently, this ID is internal only; 72 // should we use the psphot / other external ID, if available? 73 stars[N].detID = N; // sequence number within image 74 stars[N].imageID = imageID; // does this need to be updated? 75 74 76 N ++; 75 77 } -
trunk/Ohana/src/addstar/src/GetFileMode.c
r10937 r16810 16 16 gfits_scan (header, "EXTEND", "%t", 1, &extend); 17 17 18 { 19 int tmp, haveCAMCOL, haveSTRIPE; 20 21 // SDSS tsObj files have CAMCOL & STRIP keywords present in the header 22 haveCAMCOL = gfits_scan (header, "CAMCOL", "%d", 1, &tmp); 23 haveSTRIPE = gfits_scan (header, "STRIPE", "%d", 1, &tmp); 24 if (haveCAMCOL && haveSTRIPE) return SDSS_OBJ; 25 } 26 18 27 if ((Naxis == 2) || TEXTMODE || !simple) { 19 28 if (!strcmp (&ctype[4], "-WRP")) { -
trunk/Ohana/src/addstar/src/ImageOptions.c
r15038 r16810 4 4 int ImageOptions (AddstarClientOptions *options, Image *images, int Nimages) { 5 5 6 int i, equivPhotcode ;6 int i, equivPhotcode, consistent; 7 7 float maxError; 8 8 PhotCode *photcode; … … 18 18 19 19 // check that all images have the same equiv photcode and save it 20 // XXX this is only used to allow use to calculate an average mag 21 // if we have mis-matched photcodes, leave this as 0; 22 options[0].photcode = 0; 20 23 equivPhotcode = 0; 24 consistent = TRUE; 21 25 22 26 for (i = 0; i < Nimages; i++) { … … 28 32 if (equivPhotcode) { 29 33 if (equivPhotcode != photcode[0].equiv) { 30 fprintf (stderr, "ERROR: mismatch in equiv photcode values\n");31 exit (2);34 consistent = FALSE; 35 break; 32 36 } 33 37 } else { … … 35 39 } 36 40 } 37 options[0].photcode = equivPhotcode; 41 if (consistent) { 42 options[0].photcode = equivPhotcode; 43 } 38 44 39 45 options[0].imageID = 0; -
trunk/Ohana/src/addstar/src/LoadStars.c
r15487 r16810 1 1 # include "addstar.h" 2 2 3 Stars *LoadStars (char *filename, int *Nstars, Image **images, int *Nimages, int photcode) {3 Stars *LoadStars (char *filename, int *Nstars, Image **images, int *Nimages, AddstarClientOptions *options) { 4 4 5 int i, Nfile, N headers, NheaderSets, mode, *extsize;6 char **file ;5 int i, Nfile, NFILE, Nheaders, NheaderSets, mode, *extsize; 6 char **file, line[1024]; 7 7 FILE *f; 8 8 glob_t globList; … … 11 11 HeaderSet *headerSets; 12 12 13 // parse the filename as a glob 14 globList.gl_offs = 0; 15 glob (filename, 0, NULL, &globList); 13 if (options[0].filelist) { 14 // read the list of input files from the supplied file 15 f = fopen (filename, "r"); 16 if (f == NULL) { 17 fprintf (stderr, "can't read input list %s, giving up\n", filename); 18 exit (1); 19 } 16 20 17 // if the glob does not match, save the literal word: 18 // otherwise save all glob matches 19 if (globList.gl_pathc == 0) { 20 Nfile = 1; 21 ALLOCATE (file, char *, Nfile); 22 file[0] = strcreate (filename); 21 NFILE = 10; 22 ALLOCATE (file, char *, NFILE); 23 for (i = 0; (fscanf (f, "%s", line) != EOF); i++) { 24 // filename limited to 1024 chars 25 fprintf (stderr, "file: %s\n", line); 26 file[i] = strcreate (line); 27 if (i == NFILE - 1) { 28 NFILE += 10; 29 REALLOCATE (file, char *, NFILE); 30 } 31 } 32 Nfile = i; 23 33 } else { 24 Nfile = globList.gl_pathc; 25 ALLOCATE (file, char *, Nfile); 26 for (i = 0; i < Nfile; i++) { 27 file[i] = strcreate (globList.gl_pathv[i]); 34 // parse the filename as a glob 35 globList.gl_offs = 0; 36 glob (filename, 0, NULL, &globList); 37 38 // if the glob does not match, save the literal word: 39 // otherwise save all glob matches 40 if (globList.gl_pathc == 0) { 41 Nfile = 1; 42 ALLOCATE (file, char *, Nfile); 43 file[0] = strcreate (filename); 44 } else { 45 Nfile = globList.gl_pathc; 46 ALLOCATE (file, char *, Nfile); 47 for (i = 0; i < Nfile; i++) { 48 file[i] = strcreate (globList.gl_pathv[i]); 49 } 28 50 } 29 51 } … … 54 76 55 77 /* supplied photcode is incompatible with multi-chip images */ 56 if ((NheaderSets > 1) && photcode) {78 if ((NheaderSets > 1) && options[0].photcode) { 57 79 fprintf (stderr, "ERROR: photcode cannot be supplied to multi-chip images -- manually adjust the headers\n"); 58 80 exit (1); 59 81 } 60 82 83 if (headerSets[0].exttype && !strcmp (headerSets[0].exttype, "SDSS_OBJ")) { 84 LoadDataSDSS (f, file[i], images, Nimages, &stars, Nstars, headers, extsize, headerSets, NheaderSets); 85 continue; 86 } 87 61 88 LoadData (f, file[i], images, Nimages, &stars, Nstars, headers, extsize, headerSets, NheaderSets); 89 90 // XXX add a function to (optionally) load the extended source measurements 91 # if (0) 92 if (extSources) { 93 // not sure how to link the measurements here to the psf measurements above (though there is an ID in the det list) 94 LoadDataXSRC (f, file[i], images, Nimages, &stars, Nstars, headers, extsize, headerSets, NheaderSets); 95 } 96 if (extFits) { 97 LoadDataXFIT (f, file[i], images, Nimages, &stars, Nstars, headers, extsize, headerSets, NheaderSets); 98 } 99 # endif 100 62 101 } 63 102 … … 73 112 } 74 113 75 // load all of the headers, jump in file to skip data segments76 Header **LoadHeaders (FILE *f, int *mode, int *Nheaders) {77 78 int i, status, Nskip, NHEADERS;79 Header **headers;80 81 /* we need to examine the extensions to determine the headers and the data */82 NHEADERS = 10;83 ALLOCATE (headers, Header *, NHEADERS);84 85 // load all headers into memory86 for (i = 0;; i++) {87 ALLOCATE (headers[i], Header, 1);88 status = gfits_fread_header (f, headers[i]);89 if (!status) {90 *Nheaders = i;91 return (headers);92 }93 94 // check the mode for this file95 if (i == 0) {96 *mode = GetFileMode (headers[0]);97 if ((*mode == SIMPLE_CMP) || (*mode == MOSAIC_CMP)) {98 *Nheaders = i;99 return (headers);100 }101 }102 103 // advance to the next header104 Nskip = gfits_data_size (headers[i]);105 fseek (f, Nskip, SEEK_CUR);106 if (i == NHEADERS - 1) {107 NHEADERS += 10;108 REALLOCATE (headers, Header *, NHEADERS);109 }110 }111 }112 113 HeaderSet *MatchHeaders (int **extsize, int *nimage, int mode, Header **headers, int Nheaders) {114 115 int i, j, Nimage, NIMAGE;116 char extname[80], exttype[80], exthead[80];117 HeaderSet *headerSets;118 119 ALLOCATE (extsize[0], int, Nheaders);120 121 Nimage = 0;122 NIMAGE = 10;123 ALLOCATE (headerSets, HeaderSet, NIMAGE);124 125 // what is the mode of the first header (ie, do we have a PHU DIS image?)126 mode = GetFileMode (headers[0]);127 128 if (mode == MOSAIC_MEF) {129 headerSets[Nimage].exthead = strcreate ("PHU");130 headerSets[Nimage].extdata = strcreate ("NONE");131 headerSets[Nimage].extnum_data = -1;132 headerSets[Nimage].extnum_head = 0;133 Nimage ++;134 }135 136 // now examine the headers, count the table entries, find corresponding headers137 for (i = 0; i < Nheaders; i++) {138 if (mode == SIMPLE_CMP) {139 extsize[0][i] = headers[i][0].size;140 } else {141 extsize[0][i] = headers[i][0].size + gfits_data_size (headers[i]);142 }143 gfits_scan (headers[i], "EXTTYPE", "%s", 1, exttype);144 145 if (!strcmp (exttype, "SMPDATA")) goto keep;146 if (!strcmp (exttype, "PS1_DEV_0")) goto keep;147 if (!strcmp (exttype, "PS1_DEV_1")) goto keep;148 continue;149 150 keep:151 headerSets[Nimage].exttype = strcreate (exttype);152 153 gfits_scan (headers[i], ExtnameKeyword, "%s", 1, extname);154 gfits_scan (headers[i], "EXTHEAD", "%s", 1, exthead);155 156 headerSets[Nimage].extdata = strcreate (extname);157 headerSets[Nimage].exthead = strcreate (exthead);158 headerSets[Nimage].extnum_data = i;159 headerSets[Nimage].extnum_head = -1;160 161 // find the matching exthead entry162 for (j = 0; j < Nheaders; j++) {163 if (!gfits_scan (headers[j], ExtnameKeyword, "%s", 1, extname)) continue;164 if (strcmp (extname, headerSets[Nimage].exthead)) continue;165 headerSets[Nimage].extnum_head = j;166 break;167 }168 169 // skip or crash on table with missing matching header?170 if (headerSets[Nimage].extnum_head == -1) {171 return NULL;172 }173 Nimage ++;174 if (Nimage == NIMAGE) {175 NIMAGE += 10;176 REALLOCATE (headerSets, HeaderSet, NIMAGE);177 }178 }179 180 // some old format files did not write EXTTYPE. they have a single table in the first181 // extension matched to the header in the PHU182 if (Nimage == 0) {183 extsize[0][0] = headers[0][0].size + gfits_data_size (headers[0]);184 extsize[0][1] = headers[1][0].size + gfits_data_size (headers[1]);185 gfits_scan (headers[1], ExtnameKeyword, "%s", 1, extname);186 if (!strcmp (extname, "SMPFILE")) {187 headerSets[Nimage].extdata = strcreate (extname);188 headerSets[Nimage].exttype = strcreate ("SMPDATA");189 headerSets[Nimage].exthead = strcreate ("PHU");190 headerSets[Nimage].extnum_head = 0;191 headerSets[Nimage].extnum_data = 1;192 Nimage = 1;193 }194 }195 196 *nimage = Nimage;197 return (headerSets);198 }199 200 // examine the header sets and set the Image entries for the the valid images201 int LoadData (FILE *f, char *file, Image **images, int *nvalid, Stars **stars, int *Nstars, Header **headers, int *extsize, HeaderSet *headerSets, int Nimages) {202 203 char *name;204 int i, j, Nvalid, Nhead, Ndata, Nskip;205 Stars *inStars;206 207 if (images[0] == NULL) {208 Nvalid = 0;209 NVALID = 10;210 ALLOCATE (images[0], Image, NVALID);211 } else {212 Nvalid = *nvalid;213 NVALID = Nvalid + 10;214 REALLOCATE (images[0], Image, NVALID);215 }216 217 // find image rootname218 name = filebasename (file);219 220 // now run through the images, interpret the headers and read the stars221 for (i = 0; i < Nimages; i++) {222 Nhead = headerSets[i].extnum_head;223 224 if (VERBOSE) fprintf (stderr, "reading header for %s (%s)\n", headerSets[i].exthead, headerSets[i].extdata);225 if (!ReadImageHeader (headers[Nhead], &images[0][Nvalid], 0)) {226 fprintf (stderr, "skipping %s\n", headerSets[i].exthead);227 continue;228 }229 230 // XXX use something to set the chip name? EXTNAME?231 if (!strcmp(headerSets[i].exthead, "PHU") && (Nimages == 1)) {232 snprintf (images[0][Nvalid].name, 64, "%s", name);233 } else {234 snprintf (images[0][Nvalid].name, 64, "%s[%s]", name, headerSets[i].exthead);235 }236 237 // skip the table if there is no data segment (eg, mosaic WRP image)238 if (!strcmp(headerSets[i].extdata, "NONE")) {239 Nvalid++;240 if (Nvalid == NVALID) {241 NVALID += 10;242 REALLOCATE (images[0], Image, NVALID);243 }244 continue;245 }246 247 // advance the pointer to the start of the corresponding table block248 Ndata = headerSets[i].extnum_data;249 Nskip = 0;250 for (j = 0; j < Ndata; j++) {251 Nskip += extsize[j];252 }253 fseek (f, Nskip, SEEK_SET);254 255 inStars = ReadStarsFITS (f, headers[Nhead], headers[Ndata], &images[0][Nvalid].nstar);256 inStars = FilterStars (inStars, &images[0][Nvalid]);257 *stars = MergeStars (*stars, Nstars, inStars, images[0][Nvalid].nstar);258 Nvalid++;259 }260 free (name);261 *nvalid = Nvalid;262 return (TRUE);263 }264 -
trunk/Ohana/src/addstar/src/ReadImageHeader.c
r15514 r16810 8 8 double tmp, sec, Cerror, ZeroPt; 9 9 char *c, photname[64], line[80]; 10 11 // zero out the entire image structure 12 memset (image, 0, sizeof(Image)); 10 13 11 14 /* get astrometry information */ … … 132 135 133 136 tmp = 0; 134 gfits_scan (header, "TRATE", "%lf", 1, &tmp); 135 image[0].trate = 10000 * tmp; 137 if (gfits_scan (header, "TRATE", "%lf", 1, &tmp)) { 138 image[0].trate = 10000 * tmp; 139 } else { 140 image[0].trate = 0.0; 141 } 136 142 137 143 image[0].secz = NAN; … … 156 162 image[0].Xm = NAN_S_SHORT; 157 163 image[0].code = 0; 158 memset (image[0].dummy, 0, sizeof(image[0].dummy));159 164 160 165 /* find expected number of stars */ -
trunk/Ohana/src/addstar/src/ReadStarsFITS.c
r15514 r16810 72 72 if ((smpdata[i].M >= ZeroPt) || isnan(smpdata[i].M)) { 73 73 stars[i].M = NAN; 74 stars[i].Mgal = NAN;75 74 stars[i].Map = NAN; 76 75 } else { 77 76 stars[i].M = smpdata[i].M; 78 stars[i].Mgal = smpdata[i].M;79 77 stars[i].Map = smpdata[i].M; 80 78 } … … 122 120 stars[i].df = ps1data[i].df; 123 121 124 stars[i].psf Prob = ps1data[i].psfProb;125 stars[i].psfQual = ps1data[i].psfQual;122 stars[i].psfChisq = ps1data[i].psfChisq; 123 stars[i].psfQual = ps1data[i].psfQual; 126 124 127 125 stars[i].detID = ps1data[i].detID; … … 150 148 /* these are not used */ 151 149 stars[i].Map = NAN; 152 stars[i].Mgal = NAN;153 150 stars[i].dophot = 0; 154 151 } … … 190 187 stars[i].df = ps1data[i].df; 191 188 192 stars[i].psf Prob = ps1data[i].psfProb;189 stars[i].psfChisq = ps1data[i].psfChisq; 193 190 stars[i].psfQual = ps1data[i].psfQual; 194 191 stars[i].crNsigma = ps1data[i].crNsigma; … … 225 222 /* these are not used */ 226 223 stars[i].Map = NAN; 227 stars[i].Mgal = NAN;228 224 stars[i].dophot = 0; 229 225 } -
trunk/Ohana/src/addstar/src/ReadStarsTEXT.c
r15509 r16810 80 80 stars[N].dophot = tmp; 81 81 82 dparse (&stars[N].Mgal, 7, &buffer[j*BYTES_STAR]); 82 // XXX I've removed the Mgal field from the measure.d table, and am using Map 83 // instead. DVO has not to date been used to track and study objects which are 84 // extended, but it is about to. Related to this, I have created the concept of two 85 // extended source attribute tables, to carry the information being measured by the 86 // IPP. 87 88 // dparse (&stars[N].Mgal, 7, &buffer[j*BYTES_STAR]); 83 89 dparse (&stars[N].Map, 8, &buffer[j*BYTES_STAR]); 84 90 dparse (&stars[N].fx, 9, &buffer[j*BYTES_STAR]); -
trunk/Ohana/src/addstar/src/SEDfit.c
r15743 r16810 77 77 78 78 // load the measurements for this source 79 m = incat[0].average[i]. offset;79 m = incat[0].average[i].measureOffset; 80 80 Nphot = 0; 81 for (j = 0; j < incat[0].average[i].Nm ; j++) {81 for (j = 0; j < incat[0].average[i].Nmeasure; j++) { 82 82 idx = table[0].hashcode[incat[0].measure[m+j].photcode]; 83 83 if (idx == -1) continue; … … 159 159 160 160 // XXX for now, set the average mag data to NULL 161 outcat[0].average[Nave].Nm = 0;162 outcat[0].average[Nave].N n= 0;163 outcat[0].average[Nave].Xp = NAN_S_SHORT;164 outcat[0].average[Nave]. offset= Nmeas;165 outcat[0].average[Nave].missing = -1;166 outcat[0].average[Nave].code = 0;161 outcat[0].average[Nave].Nmeasure = 0; 162 outcat[0].average[Nave].Nmissing = 0; 163 outcat[0].average[Nave].Xp = NAN_S_SHORT; 164 outcat[0].average[Nave].measureOffset = Nmeas; 165 outcat[0].average[Nave].missingOffset = -1; 166 outcat[0].average[Nave].code = 0; 167 167 168 168 for (j = 0; j < Nsec; j++) { … … 193 193 outcat[0].measure[Nmeas].dt = 0xffff; 194 194 195 outcat[0].measure[Nmeas].Mgal = NAN;196 195 outcat[0].measure[Nmeas].airmass = 0; 197 196 outcat[0].measure[Nmeas].FWx = NAN_S_SHORT; … … 199 198 outcat[0].measure[Nmeas].theta = NAN_S_SHORT; 200 199 201 outcat[0].average[Nave].Nm ++;200 outcat[0].average[Nave].Nmeasure++; 202 201 Nmeas ++; 203 202 } -
trunk/Ohana/src/addstar/src/addstar.c
r15743 r16810 37 37 switch (options.mode) { 38 38 case M_IMAGE: 39 stars = LoadStars (argv[1], &Nstars, &images, &Nimages, options.photcode); 39 stars = LoadStars (argv[1], &Nstars, &images, &Nimages, &options); 40 41 // set and update the imageID sequence 42 UpdateImageIDs (stars, Nstars, images, Nimages); 43 40 44 if ((DUMP != NULL) && !strcmp (DUMP, "rawstars")) dump_rawstars (stars, Nstars); 41 45 for (i = 0; i < Nimages; i++) { -
trunk/Ohana/src/addstar/src/addstarc.c
r15036 r16810 21 21 case M_IMAGE: 22 22 /* load data */ 23 stars = LoadStars (argv[1], &Nstars, &images, &Nimages, options.photcode); 23 stars = LoadStars (argv[1], &Nstars, &images, &Nimages, &options); 24 25 // set and update the imageID sequence 26 UpdateImageIDs (stars, Nstars, images, Nimages); 24 27 25 28 /* send data to server */ -
trunk/Ohana/src/addstar/src/args.c
r14590 r16810 37 37 if ((N = get_argument (argc, argv, "-resort"))) { 38 38 options.mode = M_RESORT; 39 remove_argument (N, &argc, argv); 40 } 41 42 options.filelist = FALSE; 43 if ((N = get_argument (argc, argv, "-list"))) { 44 options.filelist = TRUE; 39 45 remove_argument (N, &argc, argv); 40 46 } -
trunk/Ohana/src/addstar/src/build_links.c
r5239 r16810 2 2 3 3 /* build the initial links assuming the table is sorted, 4 not partial, and has a correct set of average[]. offset,Nm values */4 not partial, and has a correct set of average[].measureOffset,Nm values */ 5 5 int *init_measure_links (Average *average, int Naverage, Measure *measure, int Nmeasure) { 6 6 … … 12 12 ALLOCATE (next, int, Nmeasure); 13 13 for (i = 0; i < Naverage; i++, N++) { 14 for (j = 0; j < average[i].Nm - 1; j++, N++) {14 for (j = 0; j < average[i].Nmeasure - 1; j++, N++) { 15 15 next[N] = N + 1; 16 16 if (N >= Nmeasure) { … … 41 41 ALLOCATE (next, int, Nmissing); 42 42 for (i = 0; i < Naverage; i++) { 43 for (j = 0; j < average[i].N n- 1; j++, N++) {43 for (j = 0; j < average[i].Nmissing - 1; j++, N++) { 44 44 next[N] = N + 1; 45 45 } 46 if (average[i].N n> 0) {46 if (average[i].Nmissing > 0) { 47 47 next[N] = -1; 48 48 if (N >= Nmissing) { … … 57 57 } 58 58 59 /* average[]. offset, average[].Nmare valid within an addstar run */59 /* average[].measureOffset, average[].Nmeasure are valid within an addstar run */ 60 60 int add_meas_link (Average *average, int *next, int Nmeasure, int NMEASURE) { 61 61 … … 63 63 64 64 /* if we have trouble, check validity of next[m] : m < Nmeasure */ 65 m = average[0]. offset;66 67 for (k = 0; k < average[0].Nm - 1; k++) {65 m = average[0].measureOffset; 66 67 for (k = 0; k < average[0].Nmeasure - 1; k++) { 68 68 m = next[m]; 69 69 if (m >= NMEASURE) { … … 79 79 80 80 if (m == -1) { 81 average[0]. offset = Nmeasure;81 average[0].measureOffset = Nmeasure; 82 82 } else { 83 83 next[m] = Nmeasure; … … 95 95 96 96 /* there may be 0 Nmiss; this is not true for Nmeas */ 97 if (average[0].N n< 1) {98 average[0].missing = Nmissing;97 if (average[0].Nmissing < 1) { 98 average[0].missingOffset = Nmissing; 99 99 next[Nmissing] = -1; 100 100 return (TRUE); 101 101 } 102 102 103 m = average[0].missing ;104 for (k = 0; k < average[0].N n- 1; k++) m = next[m];103 m = average[0].missingOffset; 104 for (k = 0; k < average[0].Nmissing - 1; k++) m = next[m]; 105 105 /* set up references */ 106 106 next[Nmissing] = -1; … … 125 125 /* reset the Nm, offset values for average */ 126 126 for (i = 0; i < Naverage; i++) { 127 average[i]. offset = -1;128 average[i].Nm = 0;127 average[i].measureOffset = -1; 128 average[i].Nmeasure = 0; 129 129 } 130 130 131 131 for (Nm = 0; Nm < Nmeasure; Nm++) { 132 132 averef = measure[Nm].averef; 133 m = average[averef]. offset;133 m = average[averef].measureOffset; 134 134 next[Nm] = -1; 135 135 136 136 if (m == -1) { /* no links yet for source */ 137 average[averef]. offset = Nm;138 average[averef].Nm = 1;137 average[averef].measureOffset = Nm; 138 average[averef].Nmeasure = 1; 139 139 continue; 140 140 } … … 147 147 } 148 148 149 average[averef].Nm = k + 2;149 average[averef].Nmeasure = k + 2; 150 150 next[m] = Nm; 151 151 if (m >= Nmeasure) { … … 168 168 ALLOCATE (tmpmeasure, Measure, Nmeasure); 169 169 for (i = 0; i < Naverage; i++) { 170 n = average[i]. offset;171 average[i]. offset = N;172 for (k = 0; k < average[i].Nm ; k++, N++) {170 n = average[i].measureOffset; 171 average[i].measureOffset = N; 172 for (k = 0; k < average[i].Nmeasure; k++, N++) { 173 173 tmpmeasure[N] = measure[n]; 174 174 tmpmeasure[N].averef = i; … … 189 189 ALLOCATE (tmpmissing, Missing, Nmissing); 190 190 for (i = 0; i < Naverage; i++) { 191 n = average[i].missing ;192 average[i].missing = N;193 for (k = 0; k < average[i].N n; k++, N++) {191 n = average[i].missingOffset; 192 average[i].missingOffset = N; 193 for (k = 0; k < average[i].Nmissing; k++, N++) { 194 194 tmpmissing[N] = missing[n]; 195 195 n = next[n]; -
trunk/Ohana/src/addstar/src/calibrate.c
r16040 r16810 97 97 } 98 98 99 m = average[0]. offset;100 for (i = 0; i < average[0].Nm ; i++) {99 m = average[0].measureOffset; 100 for (i = 0; i < average[0].Nmeasure; i++) { 101 101 if (measure[m].photcode == CalC0) { 102 102 found0 = TRUE; -
trunk/Ohana/src/addstar/src/fakeimage.c
r15509 r16810 130 130 image[i+1].Xm = NAN_S_SHORT; 131 131 image[i+1].code = 0; 132 memset (image[i+1].dummy, 0, sizeof(image[i+1].dummy));133 132 134 133 image[i+1].nstar = 0; … … 189 188 image[0].Xm = NAN_S_SHORT; 190 189 image[0].code = 0; 191 memset (image[0].dummy, 0, sizeof(image[0].dummy));192 190 image[0].nstar = 0; 193 191 image[0].Myyyy = 0; 192 193 // XXX need to set the imageID here 194 194 195 195 *Nimage = Nchips + 1; -
trunk/Ohana/src/addstar/src/find_matches.c
r16040 r16810 10 10 int Nave, NAVE, Nmeas, NMEAS, Nmatch; 11 11 int Nsecfilt, Nsec; 12 unsigned int objID, catID; 12 13 Coords tcoords; 13 14 … … 37 38 NMEAS = Nmeas = catalog[0].Nmeasure; 38 39 40 // current max obj ID for this catalog 41 objID = catalog[0].objID; 42 catID = catalog[0].catID; 43 39 44 /* project onto rectilinear grid with 1 arcsec pixels. the choice of ZEA projection has the 40 45 * advantage that every point in R,D has a mapping to a unique X,Y. However, note that not all … … 179 184 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 180 185 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 181 catalog[0].measure[Nmeas].psf Prob = stars[N].psfProb;186 catalog[0].measure[Nmeas].psfChisq = stars[N].psfChisq; 182 187 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 183 188 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; … … 193 198 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 194 199 195 catalog[0].measure[Nmeas].M gal = stars[N].Mgal;200 catalog[0].measure[Nmeas].Map = stars[N].Map; 196 201 catalog[0].measure[Nmeas].FWx = 100*stars[N].fx; 197 202 catalog[0].measure[Nmeas].FWy = 100*stars[N].fy; … … 233 238 /* Nm is updated, but not written out in -update mode (for existing entries) 234 239 Nm is recalculated in build_meas_links if loaded table is not sorted */ 235 catalog[0].average[n].Nm ++;240 catalog[0].average[n].Nmeasure ++; 236 241 Nmeas ++; 237 242 … … 263 268 if (!IN_REGION (stars[N].R, stars[N].D)) continue; 264 269 265 catalog[0].average[Nave].R = stars[N].R;266 catalog[0].average[Nave].D = stars[N].D;267 catalog[0].average[Nave].Xp = 0;268 catalog[0].average[Nave].Nm = 1;269 catalog[0].average[Nave].N n= 0;270 catalog[0].average[Nave]. offset= Nmeas;271 catalog[0].average[Nave].missing = -1;272 catalog[0].average[Nave].code = 0;270 catalog[0].average[Nave].R = stars[N].R; 271 catalog[0].average[Nave].D = stars[N].D; 272 catalog[0].average[Nave].Xp = 0; 273 catalog[0].average[Nave].Nmeasure = 1; 274 catalog[0].average[Nave].Nmissing = 0; 275 catalog[0].average[Nave].measureOffset = Nmeas; 276 catalog[0].average[Nave].missingOffset = -1; 277 catalog[0].average[Nave].code = 0; 273 278 274 279 catalog[0].average[Nave].dR = 0; … … 280 285 catalog[0].average[Nave].P = 0; 281 286 catalog[0].average[Nave].dP = 0; 287 288 catalog[0].average[Nave].objID = objID; 289 catalog[0].average[Nave].catID = catID; 290 objID ++; 282 291 283 292 for (j = 0; j < Nsecfilt; j++) { … … 305 314 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 306 315 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 307 catalog[0].measure[Nmeas].psf Prob = stars[N].psfProb;316 catalog[0].measure[Nmeas].psfChisq = stars[N].psfChisq; 308 317 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 309 318 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; … … 314 323 315 324 catalog[0].measure[Nmeas].detID = stars[N].detID; 316 catalog[0].measure[Nmeas].imageID = options.imageID;325 catalog[0].measure[Nmeas].imageID = stars[N].imageID; 317 326 318 327 catalog[0].measure[Nmeas].dXccd = stars[N].dX; 319 328 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 320 329 321 catalog[0].measure[Nmeas].M gal = stars[N].Mgal;330 catalog[0].measure[Nmeas].Map = stars[N].Map; 322 331 catalog[0].measure[Nmeas].FWx = 100*stars[N].fx; 323 332 catalog[0].measure[Nmeas].FWy = 100*stars[N].fy; … … 359 368 360 369 /* check if the catalog has changed? if no change, no need to write */ 370 catalog[0].objID = objID; // new max value, save on catalog close 361 371 catalog[0].Naverage = Nave; 362 372 catalog[0].Nmeasure = Nmeas; -
trunk/Ohana/src/addstar/src/find_matches_closest.c
r16040 r16810 9 9 int *N1, *N2, *next_meas, *next_miss; 10 10 int Nave, NAVE, Nmeas, NMEAS, Nmiss, NMISS, Nmatch; 11 int Nsecfilt, Nsec; 12 unsigned int objID, catID; 11 13 Coords tcoords; 12 int Nsecfilt, Nsec;13 14 14 15 /* photcode data - must by of type DEP; options.photcode is equiv photcode for all input … … 37 38 NMEAS = Nmeas = catalog[0].Nmeasure; 38 39 NMISS = Nmiss = catalog[0].Nmissing; 40 41 // current max obj ID for this catalog 42 objID = catalog[0].objID; 43 catID = catalog[0].catID; 39 44 40 45 /* project onto rectilinear grid with 1 arcsec pixels. the choice of ZEA projection has the … … 199 204 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 200 205 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 201 catalog[0].measure[Nmeas].psf Prob = stars[N].psfProb;206 catalog[0].measure[Nmeas].psfChisq = stars[N].psfChisq; 202 207 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 203 208 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; … … 213 218 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 214 219 215 catalog[0].measure[Nmeas].M gal = stars[N].Mgal;220 catalog[0].measure[Nmeas].Map = stars[N].Map; 216 221 217 222 // XXX saturate range for FWx, FWy, theta … … 241 246 stars[N].found = Nmeas; 242 247 catalog[0].found[n] = Nmeas; 243 catalog[0].average[n].Nm ++;248 catalog[0].average[n].Nmeasure ++; 244 249 Nmeas ++; 245 250 i++; … … 265 270 if (!IN_REGION (stars[N].R, stars[N].D)) continue; 266 271 267 catalog[0].average[Nave].R = stars[N].R;268 catalog[0].average[Nave].D = stars[N].D;269 catalog[0].average[Nave].Xp = 0;270 catalog[0].average[Nave].Nm = 1;271 catalog[0].average[Nave].N n= 0;272 catalog[0].average[Nave]. offset= Nmeas;273 catalog[0].average[Nave].missing = -1;274 catalog[0].average[Nave].code = 0;272 catalog[0].average[Nave].R = stars[N].R; 273 catalog[0].average[Nave].D = stars[N].D; 274 catalog[0].average[Nave].Xp = 0; 275 catalog[0].average[Nave].Nmeasure = 1; 276 catalog[0].average[Nave].Nmissing = 0; 277 catalog[0].average[Nave].measureOffset = Nmeas; 278 catalog[0].average[Nave].missingOffset = -1; 279 catalog[0].average[Nave].code = 0; 275 280 276 281 catalog[0].average[Nave].dR = 0; … … 282 287 catalog[0].average[Nave].P = 0; 283 288 catalog[0].average[Nave].dP = 0; 289 290 catalog[0].average[Nave].objID = objID; 291 catalog[0].average[Nave].catID = catID; 292 objID ++; 284 293 285 294 for (j = 0; j < Nsecfilt; j++) { … … 307 316 catalog[0].measure[Nmeas].photFlags = stars[N].flags; 308 317 catalog[0].measure[Nmeas].qPSF = stars[N].psfQual; 309 catalog[0].measure[Nmeas].psf Prob = stars[N].psfProb;318 catalog[0].measure[Nmeas].psfChisq = stars[N].psfChisq; 310 319 catalog[0].measure[Nmeas].crNsigma = stars[N].crNsigma; 311 320 catalog[0].measure[Nmeas].extNsigma = stars[N].extNsigma; … … 321 330 catalog[0].measure[Nmeas].dYccd = stars[N].dY; 322 331 323 catalog[0].measure[Nmeas].M gal = stars[N].Mgal;332 catalog[0].measure[Nmeas].Map = stars[N].Map; 324 333 catalog[0].measure[Nmeas].FWx = 100*stars[N].fx; 325 334 catalog[0].measure[Nmeas].FWy = 100*stars[N].fy; … … 360 369 361 370 /* check if the catalog has changed? if no change, no need to write */ 371 catalog[0].objID = objID; // new max value, save on catalog close 362 372 catalog[0].Naverage = Nave; 363 373 catalog[0].Nmeasure = Nmeas; -
trunk/Ohana/src/addstar/src/find_matches_refstars.c
r16040 r16810 9 9 int *N1, *N2, *next, *next_miss, last, last_miss; 10 10 int Nave, NAVE, Nmeas, NMEAS, Nmiss, NMISS, Nmatch; 11 unsigned int objID, catID; 11 12 Measure *tmpmeasure; 12 13 Missing *tmpmissing; … … 47 48 REALLOCATE (catalog[0].missing, Missing, NMISS); 48 49 50 // current max obj ID for this catalog 51 objID = catalog[0].objID; 52 catID = catalog[0].catID; 53 49 54 /* project onto rectilinear grid with 1 arcsec pixels, sort by X */ 50 55 /* reference for coords is catalog center */ … … 115 120 n = N2[J]; 116 121 N = N1[i]; 117 m = catalog[0].average[n]. offset;122 m = catalog[0].average[n].measureOffset; 118 123 119 124 /** in replace mode, search for entry and replace values M, dM, R, D */ … … 122 127 /** insert star in measurement list */ 123 128 /* find last measurement of this star */ 124 for (k = 0; k < catalog[0].average[n].Nm - 1; k++) m = next[m];129 for (k = 0; k < catalog[0].average[n].Nmeasure - 1; k++) m = next[m]; 125 130 /* set up references */ 126 131 next[Nmeas] = next[m]; … … 143 148 catalog[0].measure[Nmeas].dt = 0xffff; 144 149 145 catalog[0].measure[Nmeas].M gal= NAN;150 catalog[0].measure[Nmeas].Map = NAN; 146 151 catalog[0].measure[Nmeas].airmass = 0; 147 152 catalog[0].measure[Nmeas].FWx = NAN_S_SHORT; … … 151 156 catalog[0].measure[Nmeas].photFlags = 0; 152 157 catalog[0].measure[Nmeas].qPSF = 0; 153 catalog[0].measure[Nmeas].psf Prob= 0;158 catalog[0].measure[Nmeas].psfChisq = 0; 154 159 catalog[0].measure[Nmeas].crNsigma = 0; 155 160 catalog[0].measure[Nmeas].extNsigma = 0; … … 199 204 } 200 205 201 catalog[0].average[n].Nm ++;206 catalog[0].average[n].Nmeasure ++; 202 207 Nmeas ++; 203 208 if (Nmeas == NMEAS) { … … 224 229 if (stars[N][0].found >= 0) continue; 225 230 226 catalog[0].average[Nave].R = stars[N][0].R;227 catalog[0].average[Nave].D = stars[N][0].D;228 catalog[0].average[Nave].Xp = 0;229 catalog[0].average[Nave].Nm = 1;230 catalog[0].average[Nave].N n= 0;231 catalog[0].average[Nave]. offset= Nmeas;232 catalog[0].average[Nave].missing = -1;233 catalog[0].average[Nave].code = 0;231 catalog[0].average[Nave].R = stars[N][0].R; 232 catalog[0].average[Nave].D = stars[N][0].D; 233 catalog[0].average[Nave].Xp = 0; 234 catalog[0].average[Nave].Nmeasure = 1; 235 catalog[0].average[Nave].Nmissing = 0; 236 catalog[0].average[Nave].measureOffset = Nmeas; 237 catalog[0].average[Nave].missingOffset = -1; 238 catalog[0].average[Nave].code = 0; 234 239 235 240 if (ACCEPT_MOTION) { … … 253 258 } 254 259 260 catalog[0].average[Nave].objID = objID; 261 catalog[0].average[Nave].catID = catID; 262 objID ++; 263 255 264 for (j = 0; j < Nsecfilt; j++) { 256 265 catalog[0].secfilt[Nave*Nsecfilt+j].M = NAN; … … 273 282 catalog[0].measure[Nmeas].photFlags = 0; 274 283 catalog[0].measure[Nmeas].qPSF = 0; 275 catalog[0].measure[Nmeas].psf Prob= 0;284 catalog[0].measure[Nmeas].psfChisq = 0; 276 285 catalog[0].measure[Nmeas].crNsigma = 0; 277 286 catalog[0].measure[Nmeas].extNsigma = 0; … … 291 300 292 301 catalog[0].measure[Nmeas].airmass = 0; 293 catalog[0].measure[Nmeas].M gal= NAN;302 catalog[0].measure[Nmeas].Map = NAN; 294 303 catalog[0].measure[Nmeas].FWx = NAN_S_SHORT; 295 304 catalog[0].measure[Nmeas].FWy = NAN_S_SHORT; … … 324 333 ALLOCATE (tmpmeasure, Measure, Nmeas); 325 334 for (i = 0; i < Nave; i++) { 326 n = catalog[0].average[i]. offset;327 catalog[0].average[i]. offset = N;328 for (k = 0; k < catalog[0].average[i].Nm ; k++, N++) {335 n = catalog[0].average[i].measureOffset; 336 catalog[0].average[i].measureOffset = N; 337 for (k = 0; k < catalog[0].average[i].Nmeasure; k++, N++) { 329 338 tmpmeasure[N] = catalog[0].measure[n]; 330 339 tmpmeasure[N].averef = i; … … 339 348 ALLOCATE (tmpmissing, Missing, Nmiss); 340 349 for (i = 0; i < Nave; i++) { 341 if (catalog[0].average[i].N n> 0) {342 n = catalog[0].average[i].missing ;343 catalog[0].average[i].missing = N;344 for (k = 0; k < catalog[0].average[i].N n; k++, N++) {350 if (catalog[0].average[i].Nmissing > 0) { 351 n = catalog[0].average[i].missingOffset; 352 catalog[0].average[i].missingOffset = N; 353 for (k = 0; k < catalog[0].average[i].Nmissing; k++, N++) { 345 354 tmpmissing[N] = catalog[0].missing[n]; 346 355 n = next_miss[n]; … … 369 378 free (next_miss); 370 379 380 catalog[0].objID = objID; // new max value, save on catalog close 371 381 catalog[0].Naverage = Nave; 372 382 catalog[0].Nmeasure = Nmeas; -
trunk/Ohana/src/addstar/src/get2mass_dr2.c
r7394 r16810 62 62 stars[Nstars].t = short_date_to_sec (&buffer[NBYTE*i + 164]); 63 63 stars[Nstars].found = -1; 64 stars[Nstars].detID = 0; 65 stars[Nstars].imageID = 0; 64 66 65 67 if (photcode == TM_J) { -
trunk/Ohana/src/addstar/src/get2mass_ops.c
r14590 r16810 57 57 } 58 58 59 star[0].M = M; 60 star[0].dM = dM; 61 star[0].code = Photcode; 62 star[0].t = time; 63 star[0].found = -1; 59 star[0].M = M; 60 star[0].dM = dM; 61 star[0].code = Photcode; 62 star[0].t = time; 63 star[0].found = -1; 64 star[0].detID = 0; 65 star[0].imageID = 0; 64 66 65 67 return TRUE; … … 103 105 } 104 106 107 // how many bits are being used for the 2mass flags; can we just set photFlags based on them? 108 105 109 star[0].M = J; 106 110 star[0].dM = dJ; … … 108 112 star[0].t = time; 109 113 star[0].found = -1; 114 star[0].detID = 0; 115 star[0].imageID = 0; 110 116 111 117 star[1].M = H; … … 114 120 star[1].t = time; 115 121 star[1].found = -1; 122 star[1].detID = 0; 123 star[1].imageID = 0; 116 124 117 125 star[2].M = K; … … 120 128 star[2].t = time; 121 129 star[2].found = -1; 130 star[2].detID = 0; 131 star[2].imageID = 0; 122 132 123 133 return TRUE; -
trunk/Ohana/src/addstar/src/getgsc.c
r15514 r16810 75 75 stars[Nstars].code = GSC_M; 76 76 stars[Nstars].found = -1; 77 78 stars[Nstars].detID = 0; 79 stars[Nstars].imageID = 0; 80 77 81 Nstars ++; 78 82 CHECK_REALLOCATE (stars, Stars, NSTARS, Nstars, 1000); -
trunk/Ohana/src/addstar/src/gettycho.c
r14590 r16810 96 96 stars[Ntycho].dP = 0; 97 97 98 stars[Ntycho].detID = 0; 99 stars[Ntycho].imageID = 0; 100 98 101 /* Tycho uses J2000 equinox and 1991.25 epoch for coordinates */ 99 102 /* the magnitudes have no temporal information */ -
trunk/Ohana/src/addstar/src/getusno.c
r15514 r16810 117 117 stars[Nusno].found = -1; 118 118 119 stars[Nusno].detID = 0; 120 stars[Nusno].imageID = 0; 121 119 122 /* one pass of addstar does either r or b */ 120 123 if (photcode == USNO_RED) { -
trunk/Ohana/src/addstar/src/getusnob.c
r15036 r16810 141 141 stars[Nusno].found = -1; 142 142 143 stars[Nusno].detID = 0; 144 stars[Nusno].imageID = 0; 145 143 146 /* USNO-B uses J2000 equinox and 2000.0 epoch for coordinates */ 144 147 /* the magnitudes have no temporal information */ -
trunk/Ohana/src/addstar/src/grefstars.c
r8361 r16810 30 30 stars[N].code = photcode; 31 31 stars[N].found = FALSE; 32 stars[N].detID = 0; 33 stars[N].imageID = 0; 32 34 CHECK_REALLOCATE (stars, Stars, NSTARS, N+1, 100); 33 35 } -
trunk/Ohana/src/addstar/src/load2mass_as_rawdata.c
r14401 r16810 135 135 stars[Nstars+2].R = tstars[j].R; 136 136 stars[Nstars+2].D = tstars[j].D; 137 get2mass_3star (&stars[Nstars], &buffer[offset], Nbyte - offset);137 get2mass_3star_full (&stars[Nstars], &buffer[offset], Nbyte - offset); 138 138 // get2mass_star (&stars[Nstars], &buffer[offset], Nbyte - offset); 139 139 … … 165 165 166 166 // an error exit status here is a significant error 167 if (!dvo_catalog_open (&catalog, skylist[0].regions[ i], VERBOSE, "w")) {167 if (!dvo_catalog_open (&catalog, skylist[0].regions[0], VERBOSE, "w")) { 168 168 fprintf (stderr, "ERROR: failure to open/create catalog file %s\n", catalog.filename); 169 169 exit (2); -
trunk/Ohana/src/addstar/src/load2mass_catalog.c
r15743 r16810 32 32 33 33 // XXX for now, set the average mag data to NULL 34 catalog[0].average[Nave].Nm = 0;35 catalog[0].average[Nave].N n= 0;36 catalog[0].average[Nave].Xp = NAN_S_SHORT;37 catalog[0].average[Nave]. offset= Nmeas;38 catalog[0].average[Nave].missing = -1;39 catalog[0].average[Nave].code = 0;34 catalog[0].average[Nave].Nmeasure = 0; 35 catalog[0].average[Nave].Nmissing = 0; 36 catalog[0].average[Nave].Xp = NAN_S_SHORT; 37 catalog[0].average[Nave].measureOffset = Nmeas; 38 catalog[0].average[Nave].missingOffset = -1; 39 catalog[0].average[Nave].code = 0; 40 40 41 41 for (j = 0; j < Nsec; j++) { … … 47 47 // we now have the min chisq row. use this to supply the other filter values.... 48 48 for (j = 0; j < 3; j++) { 49 catalog[0].measure[Nmeas].dR = 0.0; 50 catalog[0].measure[Nmeas].dD = 0.0; 51 catalog[0].measure[Nmeas].M = stars[i+j].M; 52 catalog[0].measure[Nmeas].dM = stars[i+j].dM; 53 catalog[0].measure[Nmeas].Mcal = 0; 54 catalog[0].measure[Nmeas].t = stars[i+j].t; 55 catalog[0].measure[Nmeas].averef = Nave; 56 catalog[0].measure[Nmeas].photcode = stars[i+j].code; 57 catalog[0].measure[Nmeas].dophot = 0; 58 catalog[0].measure[Nmeas].dbFlags = 0; 59 catalog[0].measure[Nmeas].dt = 0xffff; 49 catalog[0].measure[Nmeas].dR = 0.0; 50 catalog[0].measure[Nmeas].dD = 0.0; 51 catalog[0].measure[Nmeas].Xccd = stars[i+j].X; 52 catalog[0].measure[Nmeas].Yccd = stars[i+j].Y; 53 catalog[0].measure[Nmeas].dXccd = 0.0; 54 catalog[0].measure[Nmeas].dYccd = 0.0; 55 catalog[0].measure[Nmeas].M = stars[i+j].M; 56 catalog[0].measure[Nmeas].dM = stars[i+j].dM; 57 catalog[0].measure[Nmeas].Mcal = 0; 58 catalog[0].measure[Nmeas].dMcal = stars[i+j].dMcal; 59 catalog[0].measure[Nmeas].t = stars[i+j].t; 60 catalog[0].measure[Nmeas].averef = Nave; 61 catalog[0].measure[Nmeas].photcode = stars[i+j].code; 62 catalog[0].measure[Nmeas].dophot = 0; 63 catalog[0].measure[Nmeas].photFlags = stars[i+j].flags; 64 catalog[0].measure[Nmeas].dbFlags = 0; 65 catalog[0].measure[Nmeas].dt = 0xffff; 66 67 catalog[0].measure[Nmeas].airmass = 0; 68 catalog[0].measure[Nmeas].FWx = stars[i+j].fx; 69 catalog[0].measure[Nmeas].FWy = stars[i+j].fy; 70 catalog[0].measure[Nmeas].theta = stars[i+j].df; 60 71 61 catalog[0].measure[Nmeas].Mgal = NAN; 62 catalog[0].measure[Nmeas].airmass = 0; 63 catalog[0].measure[Nmeas].FWx = NAN_S_SHORT; 64 catalog[0].measure[Nmeas].FWy = NAN_S_SHORT; 65 catalog[0].measure[Nmeas].theta = NAN_S_SHORT; 66 67 catalog[0].average[Nave].Nm++; 72 catalog[0].average[Nave].Nmeasure++; 68 73 Nmeas ++; 69 74 CHECK_REALLOCATE (catalog[0].measure, Measure, NMEAS, Nmeas, 100); -
trunk/Ohana/src/addstar/src/replace_match.c
r15509 r16810 6 6 7 7 /* search for entry and replace values M, dM, R, D */ 8 for (i = 0; i < average[0].Nm ; i++) {8 for (i = 0; i < average[0].Nmeasure; i++) { 9 9 if (measure[i].photcode != star[0].code) continue; 10 10 measure[i].dR = 3600.0*(average[0].R - star[0].R); … … 12 12 measure[i].M = star[0].M; 13 13 measure[i].dM = star[0].dM; 14 star[0].found = average[0]. offset + i;14 star[0].found = average[0].measureOffset + i; 15 15 return (TRUE); 16 16 } -
trunk/Ohana/src/addstar/src/update_coords.c
r12332 r16810 10 10 Npt = r = d = r2 = d2 = 0; 11 11 12 if (average[0].Nm < 2) return;12 if (average[0].Nmeasure < 2) return; 13 13 14 14 /* find the average & sum-square (does not use reference coordinates) */ 15 m = average[0]. offset; /* first measurement of this star */16 for (i = 0; i < average[0].Nm ; i++) {15 m = average[0].measureOffset; /* first measurement of this star */ 16 for (i = 0; i < average[0].Nmeasure; i++) { 17 17 if (measure[m].t == 0) { 18 18 m = next[m]; … … 35 35 average[0].R -= r / 3600.0; 36 36 average[0].D -= d / 3600.0; 37 m = average[0]. offset; /* first measurement of this star */38 for (i = 0; i < average[0].Nm ; i++) {37 m = average[0].measureOffset; /* first measurement of this star */ 38 for (i = 0; i < average[0].Nmeasure; i++) { 39 39 measure[m].dR -= r; 40 40 measure[m].dD -= d;
Note:
See TracChangeset
for help on using the changeset viewer.
