Changeset 35760
- Timestamp:
- Jul 3, 2013, 2:15:56 PM (13 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 7 edited
-
src/SEDops.c (modified) (2 diffs)
-
src/addstar_create_ID.c (modified) (2 diffs)
-
src/airmass.c (modified) (2 diffs)
-
src/args.c (modified) (1 diff)
-
src/mkcmf.c (modified) (3 diffs)
-
src/resort_catalog.c (modified) (3 diffs)
-
test/relphot.dvo (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/SEDops.c
r16040 r35760 86 86 int SEDfitInit (SEDtable *table) { 87 87 88 Xgraph = K iiOpen ("kapa", "sedstar");88 Xgraph = KapaOpen ("kapa", "sedstar"); 89 89 KapaInitGraph (&graphdata); 90 90 SetLimitsRaw (table[0].wavecode, NULL, table[0].Nfilter, &graphdata); … … 114 114 free (fitmags); 115 115 free (fiterrs); 116 K iiClose (Xgraph);116 KapaClose (Xgraph); 117 117 return (TRUE); 118 118 } -
trunk/Ohana/src/addstar/src/addstar_create_ID.c
r34405 r35760 10 10 /*** update the image table ***/ 11 11 /* setup image table format and lock */ 12 // gfits_db_init (&db); 12 13 db.mode = dvo_catalog_catmode (CATMODE); 13 14 db.format = dvo_catalog_catformat (CATFORMAT); … … 19 20 if (VERBOSE) fprintf (stderr, "can't find %s, creating a new one\n", ImageCat); 20 21 dvo_image_create (&db, GetZeroPoint()); 21 } else { 22 if (!dvo_image_load (&db, VERBOSE, FORCE_READ)) { 23 Shutdown ("can't read image catalog %s", db.filename); 24 } 25 if (!dvo_image_createID (&db.header)) { 26 fprintf (stderr, "failed to add database ID\n"); 27 exit (1); 28 } 22 // if (!gfits_table_to_vtable (&db[0].ftable, &db[0].vtable, 0, 0)) return (FALSE); 23 dvo_image_save (&db, VERBOSE); 24 dvo_image_unlock (&db); 25 return TRUE; 26 } 27 28 if (!dvo_image_load (&db, VERBOSE, FORCE_READ)) { 29 Shutdown ("can't read image catalog %s", db.filename); 30 } 31 if (!dvo_image_createID (&db.header)) { 32 fprintf (stderr, "failed to add database ID\n"); 33 exit (1); 29 34 } 30 35 fseeko (db.f, 0, SEEK_SET); -
trunk/Ohana/src/addstar/src/airmass.c
r21508 r35760 6 6 AirmassQuality = quality; 7 7 } 8 9 static int Nbad_airmass = 0; 8 10 9 11 float airmass (float secz_image, double ra, double dec, double st, double latitude) { … … 23 25 cosz = sin (rdec) * sin (rlat) + cos (rdec) * cos (RAD_DEG*hour) * cos (rlat); 24 26 secz = 1.000 / cosz; 27 28 if (!isfinite(secz)) { 29 Nbad_airmass ++; 30 } 31 if (Nbad_airmass > 1) { 32 fprintf (stderr, "*** WARNING *** NaN airmass for detection\n"); 33 fprintf (stderr, "*** ra, dec : %f, %f | st : %f | lat : %f | cosz : %f\n", ra, dec, st, latitude, cosz); 34 } 35 if (Nbad_airmass > 10) { 36 fprintf (stderr, "*** ERROR *** more than 10 NaN airmass values for detections, giving up\n"); 37 fprintf (stderr, " (use -quick-airmass to use image airmass)\n"); 38 exit (2); 39 } 40 25 41 return (secz); 26 42 } -
trunk/Ohana/src/addstar/src/args.c
r35579 r35760 419 419 fprintf (stderr, " addstar -pmm (filename)"); 420 420 fprintf (stderr, " insert pmm table into database\n\n"); 421 fprintf (stderr, " addstar -create-id"); 422 fprintf (stderr, " add a dvodb ID to the image table (and exit)\n\n"); 421 423 422 424 fprintf (stderr, " optional flags:\n"); -
trunk/Ohana/src/addstar/src/mkcmf.c
r35108 r35760 184 184 } 185 185 186 // init the random seed 187 { 188 struct timeval now; 189 gettimeofday (&now, NULL); 190 long A = now.tv_sec + now.tv_usec * 1000000; 191 srand48(A); 192 } 193 186 194 /* bore site center guess */ 187 195 strcpy (coords.ctype, "DEC--TAN"); … … 379 387 380 388 int i; 381 long A, B;382 389 double val, x, dx, dx1, dx2, dx3, df; 383 390 double mean, sigma; … … 386 393 if (Ngaussint == Nbin) return; 387 394 388 A = time(NULL);389 // XXX this is expensive if called a lot (1 sec min)390 // for (B = 0; A == time(NULL); B++);391 B = A + 10000;392 srand48(B);395 // A = time(NULL); 396 // // XXX this is expensive if called a lot (1 sec min) 397 // // for (B = 0; A == time(NULL); B++); 398 // B = A + 10000; 399 // srand48(B); 393 400 394 401 Ngaussint = Nbin; -
trunk/Ohana/src/addstar/src/resort_catalog.c
r34088 r35760 32 32 void SortAveMeasMatch (off_t *MEAS, off_t *AVE, off_t N) { 33 33 34 # define SWAPFUNC(A,B){ off_t tmp_meas; off_t tmp_ave; \35 tmp_meas = MEAS[A]; MEAS[A] = MEAS[B]; MEAS[B] = tmp_meas; \36 tmp_ave = AVE[A]; AVE[A] = AVE[B]; AVE[B] = tmp_ave; \34 # define SWAPFUNC(A,B){ off_t tmp_meas; off_t tmp_ave; \ 35 tmp_meas = MEAS[A]; MEAS[A] = MEAS[B]; MEAS[B] = tmp_meas; \ 36 tmp_ave = AVE[A]; AVE[A] = AVE[B]; AVE[B] = tmp_ave; \ 37 37 } 38 38 # define COMPARE(A,B)(AVE[A] < AVE[B]) … … 42 42 } 43 43 44 # define MARKTIME(MSG,...) { \45 float dtime;\46 gettimeofday (&stop, (void *) NULL);\47 dtime = DTIME (stop, start); start = stop;\48 fprintf (stderr, MSG, __VA_ARGS__); }44 # define MARKTIME(MSG,...) { \ 45 float dtime; \ 46 gettimeofday (&stop, (void *) NULL); \ 47 dtime = DTIME (stop, start); start = stop; \ 48 fprintf (stderr, MSG, __VA_ARGS__); } 49 49 50 50 // XXX : where is the time going? perhaps the ALLOCATE? … … 91 91 if (catalog[0].catformat >= DVO_FORMAT_PS1_V1) { 92 92 // earlier formats did not carry the objID or catID, so they are not available (we could assign on load, but we don't) 93 myAssert(average[averageSeq[i]].catID == measure[measureSeq[i]].catID, "object / detection mismatch"); 94 # if (1) 93 95 myAssert(average[averageSeq[i]].objID == measure[measureSeq[i]].objID, "object / detection mismatch"); 94 myAssert(average[averageSeq[i]].catID == measure[measureSeq[i]].catID, "object / detection mismatch"); 96 # else 97 // for reasons I do not understand, the mini dvodbs generated on stsci1X had a handful of detections with an inconsistency between averef and objID. 98 // this happened for 28 detections in the dbs on /data/stsci1?.0/eugene/dvo3pi.20130616, but not at all (as far as I know) in the rest of LAP DVO 99 if (average[averageSeq[i]].objID != measure[measureSeq[i]].objID) { 100 fprintf (stderr, "R"); 101 measure[measureSeq[i]].objID = average[averageSeq[i]].objID; // XXX I don't really like this... 102 } 103 # endif 95 104 } 96 105 } -
trunk/Ohana/src/addstar/test/relphot.dvo
r27582 r35760 38 38 mkinput $offset:$i 39 39 exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time $i\:00:00 -radec $RA $DEC -type $1 40 exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 40 exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass 41 41 end 42 42 43 echo relphot -D CATDIR catdir.test r -region {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} -update -nloop 10.0 43 44 exec relphot -D CATDIR catdir.test r -region {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} -update -nloop 10.0 >& /dev/null 44 45 … … 52 53 end 53 54 54 exec rm test.cmf test.in.txt55 exec rm -r catdir.test55 #exec rm test.cmf test.in.txt 56 #exec rm -r catdir.test 56 57 57 58 tapDONE
Note:
See TracChangeset
for help on using the changeset viewer.
