Changeset 10939
- Timestamp:
- Jan 5, 2007, 11:23:20 AM (19 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 12 edited
-
Makefile (modified) (6 diffs)
-
include/addstar.h (modified) (2 diffs)
-
src/NewImage.c (modified) (3 diffs)
-
src/NewImage_Thread.c (modified) (4 diffs)
-
src/NewRefcat_Thread.c (modified) (1 diff)
-
src/NewReflist_Thread.c (modified) (1 diff)
-
src/UpdateDatabase_Image.c (modified) (7 diffs)
-
src/addstar.c (modified) (1 diff)
-
src/addstarc.c (modified) (2 diffs)
-
src/addstart.c (modified) (1 diff)
-
src/find_matches.c (modified) (3 diffs)
-
src/find_matches_closest.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/Makefile
r10937 r10939 41 41 $(SRC)/fakeimage.$(ARCH).o \ 42 42 $(SRC)/find_matches.$(ARCH).o \ 43 $(SRC)/find_matches_closest.$(ARCH).o \ 43 44 $(SRC)/find_matches_refstars.$(ARCH).o \ 44 45 $(SRC)/find_subset.$(ARCH).o \ … … 71 72 72 73 # $(SRC)/gimages.$(ARCH).o \ 73 # $(SRC)/find_matches_closest.$(ARCH).o \74 74 75 75 ADDSTARD = \ … … 107 107 $(SRC)/getusno.$(ARCH).o \ 108 108 $(SRC)/getusnob.$(ARCH).o \ 109 $(SRC)/ImageOptions.$(ARCH).o \ 109 110 $(SRC)/gimages.$(ARCH).o \ 110 111 $(SRC)/greference.$(ARCH).o \ … … 118 119 ADDSTART = \ 119 120 $(SRC)/addstart.$(ARCH).o \ 121 $(SRC)/ImageOptions.$(ARCH).o \ 120 122 $(SRC)/DatasetOps.$(ARCH).o \ 121 123 $(SRC)/SocketOps.$(ARCH).o \ … … 163 165 ADDSTARC = \ 164 166 $(SRC)/addstarc.$(ARCH).o \ 167 $(SRC)/airmass.$(ARCH).o \ 165 168 $(SRC)/SocketOps.$(ARCH).o \ 166 169 $(SRC)/ConfigInit.$(ARCH).o \ … … 168 171 $(SRC)/grefstars.$(ARCH).o \ 169 172 $(SRC)/load_subpix.$(ARCH).o \ 170 $(SRC)/rfits.$(ARCH).o \171 173 $(SRC)/parse_time.$(ARCH).o \ 172 $(SRC)/rtext.$(ARCH).o \ 174 $(SRC)/ReadStarsFITS.$(ARCH).o \ 175 $(SRC)/GetFileMode.$(ARCH).o \ 176 $(SRC)/ReadImageHeader.$(ARCH).o \ 177 $(SRC)/ReadStarsTEXT.$(ARCH).o \ 178 $(SRC)/FilterStars.$(ARCH).o \ 173 179 $(SRC)/Shutdown.$(ARCH).o \ 174 180 $(SRC)/SetSignals.$(ARCH).o \ -
trunk/Ohana/src/addstar/include/addstar.h
r10937 r10939 25 25 int Nstars; 26 26 Stars *stars; 27 Image *image; 27 int Nimages; 28 Image *images; 28 29 Coords *mosaic; 29 30 SkyRegion *patch; … … 202 203 int WaitServerSocket PROTO((int InitSocket, SockAddress *Address, int *validIP, int Nvalid)); 203 204 int GetClientSocket PROTO((char *hostname)); 204 int UpdateDatabase_Image PROTO((AddstarClientOptions *options, Image *image , Coords *mosaic, Stars *stars, int Nstars));205 int UpdateDatabase_Image PROTO((AddstarClientOptions *options, Image *images, int Nimages, Coords *mosaic, Stars *stars, int Nstars)); 205 206 int UpdateDatabase_Reflist PROTO((AddstarClientOptions *options, Stars *stars, int Nstars)); 206 207 int UpdateDatabase_Refcat PROTO((AddstarClientOptions *options, SkyRegion *UserPatch, char *refcat)); -
trunk/Ohana/src/addstar/src/NewImage.c
r5347 r10939 3 3 int NewImage (int BindSocket) { 4 4 5 int N, Nstars ;5 int N, Nstars, Nimages; 6 6 Stars *stars; 7 Image *image ;7 Image *images; 8 8 Coords *mosaic; 9 9 AddstarClientOptions *options; … … 19 19 } 20 20 21 if (!Recv_Image (BindSocket, &image , &N)) {21 if (!Recv_Image (BindSocket, &images, &Nimages)) { 22 22 fprintf (stderr, "error: problem receiving image data\n"); 23 goto reject;24 }25 if (N != 1) {26 fprintf (stderr, "error: invalid number of images (%d)\n", N);27 23 goto reject; 28 24 } … … 43 39 goto reject; 44 40 } 45 fprintf (stderr, "accepted % s, %d stars\n", image[0].name, Nstars);41 fprintf (stderr, "accepted %d images, %d stars\n", Nimages, Nstars); 46 42 47 43 /* add to db */ 48 UpdateDatabase_Image (options, image , mosaic, stars, Nstars);44 UpdateDatabase_Image (options, images, Nimages, mosaic, stars, Nstars); 49 45 50 46 close (BindSocket); -
trunk/Ohana/src/addstar/src/NewImage_Thread.c
r6498 r10939 3 3 int NewImage_Thread (int BindSocket) { 4 4 5 int N, Nstars ;5 int N, Nstars, Nimages; 6 6 Stars *stars; 7 Image *image ;7 Image *images; 8 8 Coords *mosaic; 9 9 AddstarClientOptions *options; … … 20 20 } 21 21 22 if (!Recv_Image (BindSocket, &image , &N)) {22 if (!Recv_Image (BindSocket, &images, &Nimages)) { 23 23 fprintf (stderr, "error: problem receiving image data\n"); 24 goto reject;25 }26 if (N != 1) {27 fprintf (stderr, "error: invalid number of images (%d)\n", N);28 24 goto reject; 29 25 } … … 44 40 goto reject; 45 41 } 46 fprintf (stderr, "accepted % s, %d stars\n", image[0].name, Nstars);42 fprintf (stderr, "accepted %d, %d stars\n", Nimages, Nstars); 47 43 48 44 /* create new dataset to store the incoming data */ … … 51 47 dataset[0].patch = NULL; 52 48 dataset[0].refcat = NULL; 53 dataset[0].image = image; 49 dataset[0].images = images; 50 dataset[0].Nimages = Nimages; 54 51 dataset[0].mosaic = mosaic; 55 52 dataset[0].stars = stars; -
trunk/Ohana/src/addstar/src/NewRefcat_Thread.c
r6674 r10939 43 43 dataset[0].patch = patch; 44 44 dataset[0].refcat = message.buffer; 45 dataset[0].image = NULL;45 dataset[0].images = NULL; 46 46 dataset[0].mosaic = NULL; 47 47 dataset[0].stars = NULL; -
trunk/Ohana/src/addstar/src/NewReflist_Thread.c
r6674 r10939 29 29 dataset[0].patch = NULL; 30 30 dataset[0].refcat = NULL; 31 dataset[0].image = NULL;31 dataset[0].images = NULL; 32 32 dataset[0].mosaic = NULL; 33 33 dataset[0].stars = stars; -
trunk/Ohana/src/addstar/src/UpdateDatabase_Image.c
r8516 r10939 1 1 # include "addstar.h" 2 2 3 int UpdateDatabase_Image (AddstarClientOptions *options, Image *image , Coords *mosaic, Stars *stars, int Nstars) {3 int UpdateDatabase_Image (AddstarClientOptions *options, Image *images, int Nimages, Coords *mosaic, Stars *stars, int Nstars) { 4 4 5 5 int i, Noverlap, status; 6 6 Image *overlap; 7 7 Catalog catalog; 8 SkyList *skylist ;8 SkyList *skylist, *newlist; 9 9 10 10 if (options[0].mode != M_IMAGE) { … … 16 16 if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF; 17 17 18 // XXX this is probably not needed anymore 18 19 SetAirmassQuality (options[0].quality_airmass); 19 20 /*** find image overlaps, if needed ***/21 Noverlap = 0;22 overlap = NULL;23 if (!options[0].skip_missed) {24 FITS_DB db;25 26 set_db (&db);27 status = dvo_image_lock (&db, ImageCat, 60.0, LCK_SOFT);28 if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename);29 30 /* load images / build overlap : XXX EAM : split into two functions? */31 overlap = gimages (&db, image, mosaic, &Noverlap);32 dvo_image_unlock (&db);33 }34 20 35 21 /*** update catalog: average, measure, etc ***/ … … 37 23 /* find correpsonding regions for image */ 38 24 RegisterMosaic (mosaic); 39 skylist = SkyListByImage (ServerSky, -1, image); 25 skylist = NULL; 26 newlist = NULL; 27 for (i = 0; i < Nimages; i++) { 28 newlist = SkyListByImage (ServerSky, -1, &images[i]); 29 SkyListMerge (&skylist, newlist); 30 SkyListFree (newlist, FALSE); 31 } 32 33 ImageOptions (options, images, Nimages); 40 34 41 35 /* reduce regions to existing subset, if necessary */ … … 73 67 74 68 if (options[0].closest) { 75 find_matches_closest (skylist[0].regions[i], stars, Nstars, &catalog, image, overlap, Noverlap, mosaic,options[0]);69 find_matches_closest (skylist[0].regions[i], stars, Nstars, &catalog, options[0]); 76 70 } else { 77 find_matches (skylist[0].regions[i], stars, Nstars, &catalog, image, overlap, Noverlap, mosaic,options[0]);71 find_matches (skylist[0].regions[i], stars, Nstars, &catalog, options[0]); 78 72 } 79 73 … … 87 81 } 88 82 89 if (options[0].calibrate) { FindCalibration ( image); }83 if (options[0].calibrate) { FindCalibration (&images[0]); } 90 84 91 85 /*** load image db, save new image ***/ … … 93 87 FITS_DB db; 94 88 95 set_db (&db); 96 89 /*** update the image table ***/ 90 /* setup image table format and lock */ 91 db.mode = dvo_catalog_catmode (CATMODE); 92 db.format = dvo_catalog_catformat (CATFORMAT); 97 93 status = dvo_image_lock (&db, ImageCat, 60.0, LCK_XCLD); 98 94 if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename); 99 95 100 /* load images / build overlap : XXX EAM : split into two functions? */ 101 overlap = gimages (&db, image, mosaic, &Noverlap); 96 /* load or create the image table */ 97 if (db.dbstate == LCK_EMPTY) { 98 if (VERBOSE) fprintf (stderr, "can't find %s, creating a new one\n", ImageCat); 99 dvo_image_create (&db, ZeroPt); 100 } else { 101 if (!dvo_image_load (&db, VERBOSE, FORCE_READ)) { 102 Shutdown ("can't read image catalog %s", db.filename); 103 } 104 } 102 105 103 if (db.dbstate == LCK_EMPTY) dvo_image_create (&db, ZeroPt);104 105 106 /* write out new image */ 106 dvo_image_addrows (&db, image , 1);107 dvo_image_addrows (&db, images, Nimages); 107 108 SetProtect (TRUE); 108 109 dvo_image_update (&db, VERBOSE); … … 111 112 } 112 113 free (mosaic); 113 free (image );114 free (images); 114 115 free (stars); 115 116 return (TRUE); -
trunk/Ohana/src/addstar/src/addstar.c
r10937 r10939 103 103 Nsubset = Nstars; 104 104 if (options.closest) { 105 //Nmatch += find_matches_closest (skylist[0].regions[i], stars, Nstars, &catalog, options);105 Nmatch += find_matches_closest (skylist[0].regions[i], stars, Nstars, &catalog, options); 106 106 } else { 107 107 Nmatch += find_matches (skylist[0].regions[i], stars, Nstars, &catalog, options); -
trunk/Ohana/src/addstar/src/addstarc.c
r5445 r10939 3 3 int main (int argc, char **argv) { 4 4 5 int Nstars ;5 int Nstars, Nimages; 6 6 int BindSocket; 7 7 AddstarClientOptions options; 8 8 Stars *stars; 9 Image image;9 Image *images; 10 10 11 11 /* load config and options */ … … 21 21 case M_IMAGE: 22 22 /* load data */ 23 stars = gstars (argv[1], &Nstars, options.photcode, &image);23 stars = gstars (argv[1], &Nstars, &images, &Nimages, options.photcode); 24 24 25 25 /* send data to server */ 26 26 SendCommand (BindSocket, 5, "IMAGE"); 27 27 Send_AddstarClientOptions (BindSocket, &options, 1, TRUE); 28 Send_Image (BindSocket, &image, 1, FALSE);28 Send_Image (BindSocket, images, Nimages, FALSE); 29 29 if (options.mosaic) { 30 30 Send_Coords (BindSocket, MOSAIC, 1, FALSE); -
trunk/Ohana/src/addstar/src/addstart.c
r8361 r10939 32 32 switch (dataset[0].options[0].mode) { 33 33 case M_IMAGE: 34 UpdateDatabase_Image (dataset[0].options, dataset[0].image , dataset[0].mosaic, dataset[0].stars, dataset[0].Nstars);34 UpdateDatabase_Image (dataset[0].options, dataset[0].images, dataset[0].Nimages, dataset[0].mosaic, dataset[0].stars, dataset[0].Nstars); 35 35 continue; 36 36 -
trunk/Ohana/src/addstar/src/find_matches.c
r10937 r10939 10 10 int Nave, NAVE, Nmeas, NMEAS, Nmatch; 11 11 int Nsecfilt, Nsec; 12 float Mcat, *Mval , MTIME;12 float Mcat, *Mval; 13 13 PhotCode *code; 14 14 Coords tcoords; … … 98 98 /** find matched stars **/ 99 99 for (i = j = 0; (i < Nstars) && (j < Nave); ) { 100 100 if (!finite(X1[i]) || !finite(Y1[i])) { 101 i++; 102 continue; 103 } 104 if (!finite(X2[j]) || !finite(Y2[j])) { 105 j++; 106 continue; 107 } 108 101 109 /* negative dX: j is too large */ 102 110 dX = X1[i] - X2[j]; … … 273 281 catalog[0].measure[Nmeas].airmass_PS = stars[N].airmass; 274 282 275 catalog[0].measure[Nmeas].Mgal_PS = MIN (stars[N].Mgal + MTIME, NO_MAG);283 catalog[0].measure[Nmeas].Mgal_PS = stars[N].Mgal; 276 284 catalog[0].measure[Nmeas].FWx = MIN (100*stars[N].fx, NO_MAG); 277 285 catalog[0].measure[Nmeas].FWy = MIN (100*stars[N].fy, NO_MAG); -
trunk/Ohana/src/addstar/src/find_matches_closest.c
r8644 r10939 1 1 # include "addstar.h" 2 2 3 int find_matches_closest (SkyRegion *region, Stars *stars, int NstarsIn, Catalog *catalog, Image *image, Image *overlap, int Noverlap, Coords *mosaic,AddstarClientOptions options) {3 int find_matches_closest (SkyRegion *region, Stars *stars, int NstarsIn, Catalog *catalog, AddstarClientOptions options) { 4 4 5 5 int i, j, n, N, J, Jmin, status, Nstars; … … 14 14 PhotCode *code; 15 15 16 /* XXX EAM : options.photcode overridden by image.source.... */ 17 code = GetPhotcodebyCode (image[0].source); 18 19 /* photcode data - must by of type DEP, (PRI, SEC) - probably should restrict to DEP */ 16 /* photcode data - must by of type DEP; options.photcode is equiv PRI/SEC photcode */ 17 /* this function requires incoming stars to have the same photcode.equiv value */ 20 18 Nsecfilt = GetPhotcodeNsecfilt (); 21 Nsec = (code[0].type == PHOT_DEP) ? GetPhotcodeNsec (code[0].equiv) : GetPhotcodeNsec (code[0].code); 22 /* this function requires incoming stars to have the same photcode */ 19 Nsec = GetPhotcodeNsec (options.photcode); 23 20 24 21 /** allocate local arrays (stars) **/ … … 41 38 42 39 /* project onto rectilinear grid with 1 arcsec pixels. the choice of ZEA projection has the 43 advantage that every point in R,D has a mapping to a unique X,Y. However, note that not all 44 possible X,Y points map back to R,D and the local plate scale changes substantially far from 45 the projection pole. a better mapping might be ARC, not yet implemented (see 46 coordops.update.c). We keep the original crpix1,2 and crref1,2. For mosaic astrometry, the 47 grid should be w.r.t. the tangent-plane, not chip coords */ 48 49 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) { 50 tcoords = mosaic[0]; 51 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 52 tcoords.pc1_1 = tcoords.pc2_2 = 1.0; 53 tcoords.pc1_2 = tcoords.pc2_1 = 0.0; 54 tcoords.Npolyterms = 1; 55 strcpy (tcoords.ctype, "RA---ZEA"); 40 * advantage that every point in R,D has a mapping to a unique X,Y. However, note that not all 41 * possible X,Y points map back to R,D and the local plate scale changes substantially far from 42 * the projection pole. a better mapping might be ARC, not yet implemented (see 43 * coordops.update.c). We use the center of the region (catalog) for crval1,2. 44 */ 45 tcoords.crval1 = 0.5*(region[0].Rmin + region[0].Rmax); 46 if (region[0].Rmax < 90) { 47 tcoords.crval2 = 0.5*(region[0].Dmin + region[0].Dmax); 56 48 } else { 57 tcoords = image[0].coords; 58 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 59 tcoords.pc1_1 = tcoords.pc2_2 = 1.0; 60 tcoords.pc1_2 = tcoords.pc2_1 = 0.0; 61 tcoords.Npolyterms = 1; 62 strcpy (tcoords.ctype, "RA---ZEA"); 63 } 49 tcoords.crval2 = 90.0; 50 } 51 tcoords.crpix1 = 0; 52 tcoords.crpix2 = 0; 53 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 54 tcoords.pc1_1 = tcoords.pc2_2 = 1.0; 55 tcoords.pc1_2 = tcoords.pc2_1 = 0.0; 56 tcoords.Npolyterms = 1; 57 strcpy (tcoords.ctype, "RA---ZEA"); 64 58 65 59 /* build spatial index (RA sort) referencing input array sequence */ … … 80 74 free (Y2); 81 75 free (N2); 82 return ;76 return (0); 83 77 } 84 78 if (Nstars > 1) sort_lists (X1, Y1, N1, Nstars); … … 102 96 103 97 /* choose a radius for matches */ 104 if (options.radius == 0) { 105 RADIUS = options.Nsigma * 0.02 * image[0].cerror; /* 0.02 corrects cerror to arcsec from storage units */ 106 } else { 107 RADIUS = options.radius; /* provided by config */ 108 } 98 RADIUS = options.radius; /* provided by config */ 109 99 RADIUS2 = RADIUS*RADIUS; 110 111 /* correct instrumental mags for exposure time */112 MTIME = (image[0].exptime > 0) ? 2.500*log10(image[0].exptime) : 0.0;113 100 114 101 /** find matched stars **/ … … 170 157 /* add to end of measurement list */ 171 158 add_meas_link (&catalog[0].average[n], next_meas, Nmeas, NMEAS); 172 ohana_memcheck (0);173 159 174 /* calculate accurate per-star airmass, if required */175 secz = airmass (image[0].secz_PS, stars[N].R, stars[N].D, image[0].sidtime, image[0].latitude);176 177 160 /** add measurements for this star **/ 178 161 /** dR,dD now represent arcsec **/ … … 196 179 } 197 180 catalog[0].measure[Nmeas].dD_PS = 3600.0*(catalog[0].average[n].D - stars[N].D); 198 catalog[0].measure[Nmeas].M_PS = MIN (stars[N].M + MTIME, NO_MAG);199 catalog[0].measure[Nmeas].dM_PS = MIN (stars[N].dM, NO_ERR); /* error in input files stored in thousandths of mag */200 catalog[0].measure[Nmeas].Mcal_PS = image[0].Mcal_PS;201 catalog[0].measure[Nmeas].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */181 catalog[0].measure[Nmeas].M_PS = stars[N].M; 182 catalog[0].measure[Nmeas].dM_PS = stars[N].dM; /* error in input files stored in thousandths of mag */ 183 catalog[0].measure[Nmeas].Mcal_PS = stars[N].Mcal; 184 catalog[0].measure[Nmeas].t = stars[N].t; 202 185 catalog[0].measure[Nmeas].averef = n; 203 186 catalog[0].measure[Nmeas].source = stars[N].code; /* photcode */ 204 187 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 205 188 catalog[0].measure[Nmeas].flags = 0; 206 catalog[0].measure[Nmeas].dt_PS = MTIME;207 catalog[0].measure[Nmeas].airmass_PS = s ecz;208 209 catalog[0].measure[Nmeas].Mgal_PS = MIN (stars[N].Mgal + MTIME, NO_MAG);189 catalog[0].measure[Nmeas].dt_PS = stars[N].dt; 190 catalog[0].measure[Nmeas].airmass_PS = stars[N].airmass; 191 192 catalog[0].measure[Nmeas].Mgal_PS = stars[N].Mgal; 210 193 catalog[0].measure[Nmeas].FWx = MIN (100*stars[N].fx, NO_MAG); 211 194 catalog[0].measure[Nmeas].FWy = MIN (100*stars[N].fy, NO_MAG); … … 234 217 Nmeas ++; 235 218 i++; 236 ohana_memcheck (0);237 }238 ohana_memcheck (0);239 240 /** add reference for undetected catalog stars **/241 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) RegisterMosaic (mosaic);242 for (j = 0; (j < Nave) && !options.skip_missed; j++) {243 n = N2[j];244 if (catalog[0].found[n] < 0) {245 /* make sure there is space for next entry */246 if (Nmiss >= NMISS) {247 NMISS = Nmiss + 1000;248 REALLOCATE (next_miss, int, NMISS);249 REALLOCATE (catalog[0].missing, Missing, NMISS);250 }251 252 /* should the catalog star be on this image? project into image coords */253 if (!in_image (catalog[0].average[n].R, catalog[0].average[n].D, image)) continue;254 add_miss_link (&catalog[0].average[n], next_miss, Nmiss);255 256 /* calculate time of exposure for this coordinate in the image */257 RD_to_XY (&X, &Y, catalog[0].average[n].R, catalog[0].average[n].D, &image[0].coords);258 catalog[0].missing[Nmiss].t = image[0].tzero + 1e-4*Y*image[0].trate; /* trate is in 0.1 msec / row */259 catalog[0].average[n].Nn ++;260 Nmiss ++;261 }262 219 } 263 220 … … 279 236 N = N1[i]; 280 237 if (stars[N].found >= 0) continue; 281 if (!IN_CATALOG (stars[N].R, stars[N].D)) continue; 282 283 secz = airmass (image[0].secz_PS, stars[N].R, stars[N].D, image[0].sidtime, image[0].latitude); 238 if (!IN_REGION (stars[N].R, stars[N].D)) continue; 284 239 285 240 catalog[0].average[Nave].R = stars[N].R; … … 313 268 catalog[0].measure[Nmeas].dR_PS = 0.0; 314 269 catalog[0].measure[Nmeas].dD_PS = 0.0; 315 catalog[0].measure[Nmeas].M_PS = MIN (stars[N].M + MTIME, NO_MAG);316 catalog[0].measure[Nmeas].dM_PS = MIN (stars[N].dM, NO_ERR);317 catalog[0].measure[Nmeas].Mcal_PS = image[0].Mcal_PS;318 catalog[0].measure[Nmeas].t = image[0].tzero + 1e-4*stars[N].Y*image[0].trate; /* trate is in 0.1 msec / row */270 catalog[0].measure[Nmeas].M_PS = stars[N].M; 271 catalog[0].measure[Nmeas].dM_PS = stars[N].dM; 272 catalog[0].measure[Nmeas].Mcal_PS = stars[N].Mcal; 273 catalog[0].measure[Nmeas].t = stars[N].t; 319 274 catalog[0].measure[Nmeas].averef = Nave; 320 275 catalog[0].measure[Nmeas].source = stars[N].code; /* photcode */ 321 276 catalog[0].measure[Nmeas].dophot = stars[N].dophot; 322 277 catalog[0].measure[Nmeas].flags = 0; 323 catalog[0].measure[Nmeas].dt_PS = MTIME;324 catalog[0].measure[Nmeas].airmass_PS = s ecz;325 326 catalog[0].measure[Nmeas].Mgal_PS = MIN (stars[N].Mgal + MTIME, NO_MAG);278 catalog[0].measure[Nmeas].dt_PS = stars[N].dt; 279 catalog[0].measure[Nmeas].airmass_PS = stars[N].airmass; 280 281 catalog[0].measure[Nmeas].Mgal_PS = stars[N].Mgal; 327 282 catalog[0].measure[Nmeas].FWx = MIN (100*stars[N].fx, NO_MAG); 328 283 catalog[0].measure[Nmeas].FWy = MIN (100*stars[N].fy, NO_MAG); … … 332 287 Mval = (Nsec == -1) ? &catalog[0].average[Nave].M : &catalog[0].secfilt[Nave*Nsecfilt+Nsec].M_PS; 333 288 if (*Mval == NO_MAG) *Mval = Mcat; 334 335 /** now add references from all previous non-detection observations of this spot on the sky */336 for (j = 0; (j < Noverlap) && !options.skip_missed; j++) {337 /* make sure there is space for next entry */338 if (Nmiss >= NMISS) {339 NMISS = Nmiss + 1000;340 REALLOCATE (next_miss, int, NMISS);341 REALLOCATE (catalog[0].missing, Missing, NMISS);342 }343 if (!FindMosaicForImage (overlap, Noverlap, j)) continue;344 if (!in_image (catalog[0].average[Nave].R, catalog[0].average[Nave].D, &overlap[j])) continue;345 add_miss_link (&catalog[0].average[Nave], next_miss, Nmiss);346 347 /* get time of exposure of this portion of the image */348 RD_to_XY (&X, &Y, catalog[0].average[Nave].R, catalog[0].average[Nave].D, &overlap[j].coords);349 catalog[0].missing[Nmiss].t = overlap[j].tzero + 1e-4*Y*overlap[j].trate; /* rough guess at time */350 catalog[0].average[Nave].Nn ++;351 Nmiss ++;352 }353 289 354 290 /* next[Nmeas] should always be -1 in this context (it is always the only … … 362 298 REALLOCATE (catalog[0].average, Average, Nave); 363 299 REALLOCATE (catalog[0].measure, Measure, Nmeas); 364 REALLOCATE (catalog[0].missing, Missing, Nmiss);365 300 366 301 if (options.nosort) { … … 370 305 catalog[0].measure = sort_measure (catalog[0].average, Nave, catalog[0].measure, Nmeas, next_meas); 371 306 } 372 catalog[0].missing = sort_missing (catalog[0].average, Nave, catalog[0].missing, Nmiss, next_miss);373 /* missing is REQUIRED to be sorted */374 307 375 308 /* note stars which have been found in this catalog */ … … 385 318 catalog[0].Naverage = Nave; 386 319 catalog[0].Nmeasure = Nmeas; 387 catalog[0].Nmissing = Nmiss; 388 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas, Nmiss: %d %d %d %d, (%d matches)\n", NstarsIn, Nave, Nmeas, Nmiss, Nmatch); 320 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: %d %d %d, (%d matches)\n", Nstars, Nave, Nmeas, Nmatch); 389 321 390 322 free (catalog[0].found);
Note:
See TracChangeset
for help on using the changeset viewer.
