Changeset 15732
- Timestamp:
- Dec 4, 2007, 12:32:27 PM (18 years ago)
- Location:
- branches/eam_branch_20071130/Ohana/src
- Files:
-
- 39 edited
-
addstar/src/SEDfit.c (modified) (1 diff)
-
addstar/src/UpdateDatabase_Image.c (modified) (4 diffs)
-
addstar/src/UpdateDatabase_Refcat.c (modified) (3 diffs)
-
addstar/src/UpdateDatabase_Reflist.c (modified) (3 diffs)
-
addstar/src/addstar.c (modified) (1 diff)
-
addstar/src/find_matches.c (modified) (1 diff)
-
addstar/src/find_matches_closest.c (modified) (1 diff)
-
addstar/src/find_matches_refstars.c (modified) (1 diff)
-
addstar/src/load2mass_catalog.c (modified) (1 diff)
-
addstar/src/sedstar.c (modified) (1 diff)
-
delstar/src/delete_imagefile.c (modified) (1 diff)
-
delstar/src/delete_imagename.c (modified) (1 diff)
-
delstar/src/delete_orphans.c (modified) (1 diff)
-
delstar/src/delete_times.c (modified) (1 diff)
-
delstar/src/find_matches.c (modified) (1 diff)
-
dvosplit/src/split_averages.c (modified) (2 diffs)
-
gastro/src/getptolemy.c (modified) (1 diff)
-
gastro2/src/getptolemy.c (modified) (1 diff)
-
getstar/src/getstar.c (modified) (2 diffs)
-
getstar/src/select_by_region.c (modified) (1 diff)
-
libdvo/src/dvo_catalog.c (modified) (2 diffs)
-
libdvo/src/dvo_catalog_mef.c (modified) (3 diffs)
-
libdvo/src/dvo_catalog_raw.c (modified) (1 diff)
-
libdvo/src/dvo_catalog_split.c (modified) (21 diffs)
-
libfits/include/gfitsio.h (modified) (1 diff)
-
libfits/table/F_read_T.c (modified) (1 diff)
-
markrock/src/markrock.c (modified) (1 diff)
-
markstar/src/markstar.c (modified) (1 diff)
-
mosastro/src/getptolemy.c (modified) (1 diff)
-
photdbc/src/join_stars.c (modified) (2 diffs)
-
photdbc/src/make_subcatalog.c (modified) (2 diffs)
-
photdbc/src/photdbc.c (modified) (1 diff)
-
relastro/src/bcatalog.c (modified) (2 diffs)
-
relastro/src/load_catalogs.c (modified) (1 diff)
-
relastro/src/reload_catalogs.c (modified) (1 diff)
-
relphot/src/bcatalog.c (modified) (2 diffs)
-
relphot/src/load_catalogs.c (modified) (1 diff)
-
relphot/src/reload_catalogs.c (modified) (1 diff)
-
uniphot/src/update.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20071130/Ohana/src/addstar/src/SEDfit.c
r15509 r15732 210 210 } 211 211 } 212 outcat[0].Naverage = Nave; 213 outcat[0].Nmeasure = Nmeas; 212 outcat[0].Naverage = Nave; 213 outcat[0].Nmeasure = Nmeas; 214 outcat[0].Nsecf_mem = Nave*Nsec; 214 215 215 216 free (sourceValue.mags); -
branches/eam_branch_20071130/Ohana/src/addstar/src/UpdateDatabase_Image.c
r15723 r15732 13 13 14 14 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 15 if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_M EAS_META | LOAD_MISS | LOAD_SECF;15 if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF; 16 16 17 17 // XXX this is probably not needed anymore … … 49 49 catalog.Nsecfilt = GetPhotcodeNsecfilt (); 50 50 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 51 if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_M EAS_META | LOAD_MISS | LOAD_SECF;51 if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF; 52 52 53 53 // an error exit status here is a significant error … … 57 57 } 58 58 59 // Nave _disk == 0 implies an empty catalog file59 // Naves_disk == 0 implies an empty catalog file 60 60 // for only_match, skip empty catalogs 61 if ((catalog.Nave _disk == 0) && options[0].only_match) {61 if ((catalog.Naves_disk == 0) && options[0].only_match) { 62 62 dvo_catalog_unlock (&catalog); 63 63 dvo_catalog_free (&catalog); … … 73 73 if (!options[0].only_images) { 74 74 SetProtect (TRUE); 75 dvo_catalog_save (&catalog, VERBOSE); 75 if (options[0].update) { 76 dvo_catalog_update (&catalog, VERBOSE); 77 } else { 78 dvo_catalog_save (&catalog, VERBOSE); 79 } 76 80 SetProtect (FALSE); 77 81 } -
branches/eam_branch_20071130/Ohana/src/addstar/src/UpdateDatabase_Refcat.c
r14401 r15732 37 37 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 38 38 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 39 if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_M EAS_META | LOAD_MISS | LOAD_SECF;39 if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF; 40 40 41 41 // an error exit status here is a significant error … … 45 45 } 46 46 47 // Nave _disk == 0 implies an empty catalog file47 // Naves_disk == 0 implies an empty catalog file 48 48 // for only_match, skip empty catalogs 49 if ((catalog.Nave _disk == 0) && options[0].only_match) {49 if ((catalog.Naves_disk == 0) && options[0].only_match) { 50 50 dvo_catalog_unlock (&catalog); 51 51 dvo_catalog_free (&catalog); … … 62 62 if (!options[0].only_images) { 63 63 SetProtect (TRUE); 64 dvo_catalog_save (&catalog, VERBOSE); 64 if (options[0].update) { 65 dvo_catalog_update (&catalog, VERBOSE); 66 } else { 67 dvo_catalog_save (&catalog, VERBOSE); 68 } 65 69 SetProtect (FALSE); 66 70 } -
branches/eam_branch_20071130/Ohana/src/addstar/src/UpdateDatabase_Reflist.c
r14401 r15732 37 37 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 38 38 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 39 if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_M EAS_META | LOAD_MISS | LOAD_SECF;39 if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF; 40 40 41 41 // an error exit status here is a significant error … … 46 46 47 47 /* for only_match, skip empty catalogs XXX EAM : this leaves behind empty files */ 48 if ((catalog.Nave _disk == 0) && options[0].only_match) {48 if ((catalog.Naves_disk == 0) && options[0].only_match) { 49 49 dvo_catalog_unlock (&catalog); 50 50 dvo_catalog_free (&catalog); … … 58 58 if (!options[0].only_images) { 59 59 SetProtect (TRUE); 60 dvo_catalog_save (&catalog, VERBOSE); 60 if (options[0].update) { 61 dvo_catalog_update (&catalog, VERBOSE); 62 } else { 63 dvo_catalog_save (&catalog, VERBOSE); 64 } 61 65 SetProtect (FALSE); 62 66 } -
branches/eam_branch_20071130/Ohana/src/addstar/src/addstar.c
r15731 r15732 105 105 } 106 106 107 // Nave _disk == 0 implies an empty catalog file107 // Naves_disk == 0 implies an empty catalog file 108 108 // for only_match, skip empty catalogs 109 if ((catalog.Nave _disk == 0) && options.only_match) {109 if ((catalog.Naves_disk == 0) && options.only_match) { 110 110 dvo_catalog_unlock (&catalog); 111 111 dvo_catalog_free (&catalog); -
branches/eam_branch_20071130/Ohana/src/addstar/src/find_matches.c
r15509 r15732 361 361 catalog[0].Naverage = Nave; 362 362 catalog[0].Nmeasure = Nmeas; 363 catalog[0].Nsecf_mem = Nave*Nsecfilt; 363 364 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: %d %d %d, (%d matches)\n", Nstars, Nave, Nmeas, Nmatch); 364 365 -
branches/eam_branch_20071130/Ohana/src/addstar/src/find_matches_closest.c
r15509 r15732 362 362 catalog[0].Naverage = Nave; 363 363 catalog[0].Nmeasure = Nmeas; 364 catalog[0].Nsecf_mem = Nave*Nsecfilt; 364 365 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: %d %d %d, (%d matches)\n", Nstars, Nave, Nmeas, Nmatch); 365 366 -
branches/eam_branch_20071130/Ohana/src/addstar/src/find_matches_refstars.c
r15509 r15732 372 372 catalog[0].Nmeasure = Nmeas; 373 373 catalog[0].Nmissing = Nmiss; 374 catalog[0].Nsecf_mem = Nave*Nsecfilt; 374 375 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas, Nmiss: %d %d %d %d, (%d matches)\n", Nstars, Nave, Nmeas, Nmiss, Nmatch); 375 376 return (Nmatch); -
branches/eam_branch_20071130/Ohana/src/addstar/src/load2mass_catalog.c
r15509 r15732 79 79 catalog[0].Naverage = Nave; 80 80 catalog[0].Nmeasure = Nmeas; 81 catalog[0].Nsecf_mem = Nave*Nsec; 81 82 return (TRUE); 82 83 } -
branches/eam_branch_20071130/Ohana/src/addstar/src/sedstar.c
r8361 r15732 34 34 } 35 35 36 // Nave _disk == 0 implies an empty catalog file37 if ((incatalog.Nave _disk == 0) && options.only_match) {36 // Naves_disk == 0 implies an empty catalog file 37 if ((incatalog.Naves_disk == 0) && options.only_match) { 38 38 if (VERBOSE) fprintf (stderr, "skipping empty region\n"); 39 39 dvo_catalog_unlock (&incatalog); -
branches/eam_branch_20071130/Ohana/src/delstar/src/delete_imagefile.c
r12332 r15732 33 33 exit (2); 34 34 } 35 if (!catalog.Nave _disk) {35 if (!catalog.Naves_disk) { 36 36 dvo_catalog_unlock (&catalog); 37 37 dvo_catalog_free (&catalog); -
branches/eam_branch_20071130/Ohana/src/delstar/src/delete_imagename.c
r14590 r15732 44 44 exit (2); 45 45 } 46 if (!catalog.Nave _disk) {46 if (!catalog.Naves_disk) { 47 47 dvo_catalog_unlock (&catalog); 48 48 dvo_catalog_free (&catalog); -
branches/eam_branch_20071130/Ohana/src/delstar/src/delete_orphans.c
r8386 r15732 252 252 catalog.Nmeasure = Nmeas; 253 253 catalog.Nmissing = Nmiss; 254 catalog.Nsecf_mem = Nave*Nsecfilt; 255 254 256 if (VERBOSE) fprintf (stderr, " ending with Nave, Nmeas, Nmiss: %d %d %d\n", Nave, Nmeas, Nmiss); 255 257 -
branches/eam_branch_20071130/Ohana/src/delstar/src/delete_times.c
r14401 r15732 64 64 exit (2); 65 65 } 66 if (!catalog.Nave _disk) {66 if (!catalog.Naves_disk) { 67 67 dvo_catalog_unlock (&catalog); 68 68 dvo_catalog_free (&catalog); -
branches/eam_branch_20071130/Ohana/src/delstar/src/find_matches.c
r12332 r15732 234 234 catalog[0].Nmeasure = Nmeas; 235 235 catalog[0].Nmissing = Nmiss; 236 catalog[0].Nsecf_mem = Nave*Nsecfilt; 237 236 238 if (VERBOSE) fprintf (stderr, " ending with Nave, Nmeas, Nmiss: %d %d %d\n", Nave, Nmeas, Nmiss); 237 239 -
branches/eam_branch_20071130/Ohana/src/dvosplit/src/split_averages.c
r15729 r15732 9 9 AveLinks *avelinks; 10 10 11 ALLOCATE (outref, int, incatalog[0].Nave _disk);12 ALLOCATE (outcat, int, incatalog[0].Nave _disk);11 ALLOCATE (outref, int, incatalog[0].Naves_disk); 12 ALLOCATE (outcat, int, incatalog[0].Naves_disk); 13 13 14 14 Nsecfilt = GetPhotcodeNsecfilt (); … … 23 23 // split out the average & secfilt entries: 24 24 incatalog[0].catflags = LOAD_AVES | LOAD_SECF; 25 Nblocks = incatalog[0].Nave _disk / NROWS;25 Nblocks = incatalog[0].Naves_disk / NROWS; 26 26 for (block = 0; block < Nblocks; block++) { 27 27 -
branches/eam_branch_20071130/Ohana/src/gastro/src/getptolemy.c
r12332 r15732 36 36 dvo_catalog_unlock (&catalog); 37 37 38 // Nave _disk == 0 implies an empty catalog file38 // Naves_disk == 0 implies an empty catalog file 39 39 // for only_match, skip empty catalogs 40 if (!catalog.Nave _disk) {40 if (!catalog.Naves_disk) { 41 41 dvo_catalog_free (&catalog); 42 42 continue; -
branches/eam_branch_20071130/Ohana/src/gastro2/src/getptolemy.c
r12332 r15732 38 38 dvo_catalog_unlock (&catalog); 39 39 40 // Nave _disk == 0 implies an empty catalog file40 // Naves_disk == 0 implies an empty catalog file 41 41 // for only_match, skip empty catalogs 42 if (!catalog.Nave _disk) {42 if (!catalog.Naves_disk) { 43 43 dvo_catalog_free (&catalog); 44 44 continue; -
branches/eam_branch_20071130/Ohana/src/getstar/src/getstar.c
r15540 r15732 47 47 exit (2); 48 48 } 49 if (!catalog.Nave _disk) {49 if (!catalog.Naves_disk) { 50 50 dvo_catalog_unlock (&catalog); 51 51 dvo_catalog_free (&catalog); … … 78 78 } 79 79 /* skip empty catalogs */ 80 if (!catalog.Nave _disk) continue;80 if (!catalog.Naves_disk) continue; 81 81 stars = select_by_image (&catalog, &image, 0, 0, stars, &Nstars); 82 82 } -
branches/eam_branch_20071130/Ohana/src/getstar/src/select_by_region.c
r15543 r15732 91 91 output[0].Naverage = Nave; 92 92 output[0].Nmeasure = Nmeas; 93 output[0].Nsecf_mem = Nave*Nsecfilt; 94 93 95 fprintf (stderr, "output catalog has %d stars (%d measures, %d secfilt)\n", 94 96 output[0].Naverage, output[0].Nmeasure, output[0].Nsecfilt); -
branches/eam_branch_20071130/Ohana/src/libdvo/src/dvo_catalog.c
r15731 r15732 357 357 catalog[0].secfilt = outsec; 358 358 catalog[0].Nsecfilt = Nsecfilt; 359 catalog[0].Nsecf_mem = Nsecfilt * catalog[0].Naverage; 359 360 } 360 361 return (TRUE); … … 410 411 case DVO_MODE_MEF: 411 412 if (VERBOSE) fprintf (stderr, "reading catalog (mode DVO_MODE_MEF)\n"); 412 dvo_catalog_load_segment_mef (catalog, VERBOSE, start, Nrows); 413 fprintf (stderr, "cannot do this in mef mode\n"); 414 // dvo_catalog_load_segment_mef (catalog, VERBOSE, start, Nrows); 413 415 break; 414 416 case DVO_MODE_SPLIT: -
branches/eam_branch_20071130/Ohana/src/libdvo/src/dvo_catalog_mef.c
r15728 r15732 59 59 /* old versions of DVO stored one of the average magnitudes in Average. we save this if needed */ 60 60 catalog[0].average = FtableToAverage (&ftable, &Naverage, &catalog[0].catformat, &primary); 61 if (Naverage != catalog[0].Nave rage) {61 if (Naverage != catalog[0].Naves_disk) { 62 62 fprintf (stderr, "Warning: mismatch between Naverage in PHU and Table headers (%d vs %d)\n", Naverage, catalog[0].Naves_disk); 63 63 } … … 86 86 } 87 87 catalog[0].measure = FtableToMeasure (&ftable, &catalog[0].Nmeasure, &catalog[0].catformat); 88 if (Nmeasure != catalog[0].Nmeas ure) {89 fprintf (stderr, "Warning: mismatch between Nmeasure in PHU and Table headers (%d vs %d)\n", Nmeasure, catalog[0].Nmeas ure);88 if (Nmeasure != catalog[0].Nmeas_disk) { 89 fprintf (stderr, "Warning: mismatch between Nmeasure in PHU and Table headers (%d vs %d)\n", Nmeasure, catalog[0].Nmeas_disk); 90 90 } 91 91 catalog[0].Nmeasure = catalog[0].Nmeas_disk; … … 112 112 /* no conversions currently defined */ 113 113 catalog[0].missing = gfits_table_get_Missing (&ftable, &catalog[0].Nmissing, NULL); 114 if (Nmissing != catalog[0].Nmiss ing) {115 fprintf (stderr, "Warning: mismatch between Nmissing in PHU and Table headers (%d vs %d)\n", Nmissing, catalog[0].Nmiss ing);114 if (Nmissing != catalog[0].Nmiss_disk) { 115 fprintf (stderr, "Warning: mismatch between Nmissing in PHU and Table headers (%d vs %d)\n", Nmissing, catalog[0].Nmiss_disk); 116 116 } 117 117 catalog[0].Nmissing = catalog[0].Nmiss_disk; -
branches/eam_branch_20071130/Ohana/src/libdvo/src/dvo_catalog_raw.c
r15731 r15732 171 171 } 172 172 catalog[0].Nsecfilt = Nsecfilt; 173 catalog[0].Nsecf_mem = Ntotal; 173 174 free (primary); 174 175 } -
branches/eam_branch_20071130/Ohana/src/libdvo/src/dvo_catalog_split.c
r15731 r15732 40 40 *mySecfilt = secfilt; 41 41 *myNsecfilt = Nsecfilt; 42 } 43 44 int dvo_catalog_primary_to_secfilt (Catalog *catalog, SecFilt *primary, int Naves) { 45 46 int Ntmpfilt, Nsecfilt, Ntotal, i, j; 47 SecFilt *tmpfilt; 48 49 tmpfilt = catalog[0].secfilt; 50 Ntmpfilt = catalog[0].Nsecfilt; 51 52 // we do NOT modify Nsecf_disk; this operation only modifies in in-memory values 53 54 catalog[0].Nsecfilt ++; 55 Nsecfilt = catalog[0].Nsecfilt; 56 Ntotal = Nsecfilt * Naves; 57 58 catalog[0].Nsecf_mem = Ntotal; 59 60 ALLOCATE (catalog[0].secfilt, SecFilt, Ntotal); 61 for (i = 0; i < Naves; i++) { 62 catalog[0].secfilt[i*Nsecfilt + 0] = primary[i]; 63 for (j = 0; j < Ntmpfilt; j++) { 64 catalog[0].secfilt[i*Nsecfilt + j + 1] = tmpfilt[i*Ntmpfilt + j]; 65 } 66 } 67 free (primary); 68 return (TRUE); 42 69 } 43 70 … … 279 306 fprintf (stderr, "Warning: mismatch between Nsecfilt items in PHU and Table headers (%d vs %d)\n", Nitems, catalog[0].Nsecf_disk); 280 307 } 308 catalog[0].Nsecf_mem = catalog[0].Nsecf_disk; 309 catalog[0].Nsecf_off = 0; 281 310 282 311 /* if primary is defined, we were supplied with one additional average magnitude from Average 283 312 we need to interleave these magnitudes with the secfilt entries just loaded */ 284 313 if (primary != NULL) { 285 int Ntmpfilt, Ntotal, i, j; 286 SecFilt *tmpfilt; 287 tmpfilt = catalog[0].secfilt; 288 Ntmpfilt = catalog[0].Nsecfilt; 289 290 catalog[0].Nsecfilt ++; 291 catalog[0].Nsecf_disk = catalog[0].Nsecfilt * catalog[0].Naves_disk; 292 Nsecfilt = catalog[0].Nsecfilt; 293 294 ALLOCATE (catalog[0].secfilt, SecFilt, catalog[0].Nsecf_disk); 295 for (i = 0; i < catalog[0].Naves_disk; i++) { 296 catalog[0].secfilt[i*Nsecfilt + 0] = primary[i]; 297 for (j = 0; j < Ntmpfilt; j++) { 298 catalog[0].secfilt[i*Nsecfilt + j + 1] = tmpfilt[i*Ntmpfilt + j]; 299 } 300 } 301 free (primary); 314 // this modifies catalog.Nsecf_mem,Nsecfilt 315 dvo_catalog_primary_to_secfilt (catalog, primary, catalog[0].Naves_disk); 302 316 } 303 catalog[0].Nsecf_mem = catalog[0].Nsecf_disk;304 catalog[0].Nsecf_off = 0;305 317 } else { 306 318 if (primary != NULL) { 307 319 free (primary); 308 320 catalog[0].Nsecfilt ++; 309 catalog[0].Nsecf_disk = catalog[0].Nsecfilt * catalog[0].Naves_disk;310 321 } 311 322 gfits_create_header (&catalog[0].secfilt_catalog[0].header); … … 326 337 Header header; 327 338 Matrix matrix; 328 VTable vtable;339 FTable ftable; 329 340 SecFilt *primary; 330 341 331 /* vtable header storage for below */332 vtable.header = &header;333 vtable.buffer = NULL;342 /* ftable header storage for below */ 343 ftable.header = &header; 344 ftable.buffer = NULL; 334 345 header.buffer = NULL; 335 346 … … 351 362 } 352 363 /* read Average table data : format is irrelevant here */ 353 if (!gfits_fread_ vtable_range (catalog[0].f, &vtable, start, Nrows)) {364 if (!gfits_fread_ftable_range (catalog[0].f, &ftable, start, Nrows)) { 354 365 if (VERBOSE) fprintf (stderr, "can't read table average data"); 355 366 return (FALSE); … … 359 370 * one of the average magnitudes in Average. We save this in case it is needed below. NOTE: 360 371 * primary is only used if we read in the secfilt table, otherwise it should be freed */ 361 362 // XXX Vtable version is needed (merge Ftable and Vtable versions?) 363 catalog[0].average = VtableToAverage (&vtable, &Naverage, &catalog[0].catformat, &primary); 364 365 // XXX validate the sizes? start + Nrows < Naves_disk (no other constraints) 372 catalog[0].average = FtableToAverage (&ftable, &Naverage, &catalog[0].catformat, &primary); 366 373 if (Naverage != Nrows) { 374 // XXX this is only an error if Nrows or more are available... 375 // XXX allow Nrows to go beyond end of the data? 367 376 fprintf (stderr, "Warning: mismatch between Naverage in PHU and Table headers (%d vs %d)\n", Naverage, Nrows); 368 377 } … … 387 396 } 388 397 /* read Measure table data : format is irrelevant here */ 389 if (!gfits_fread_ vtable_range (subcat[0].f, &vtable, start, Nrows)) {398 if (!gfits_fread_ftable_range (subcat[0].f, &ftable, start, Nrows)) { 390 399 if (VERBOSE) fprintf (stderr, "can't read table measure data"); 391 400 return (FALSE); … … 393 402 394 403 Nexpect = Nrows * Nsecfilt; 395 catalog[0].secfilt = VtableToSecFilt (&vtable, &Nitems, &catalog[0].catformat);404 catalog[0].secfilt = FtableToSecFilt (&ftable, &Nitems, &catalog[0].catformat); 396 405 if (Nitems != Nexpect) { 397 fprintf (stderr, "Warning: mismatch between Nsecfilt items in PHU and Table headers (%d vs %d)\n", Nitems, catalog[0].Nsecf_disk); 398 } 406 fprintf (stderr, "Warning: mismatch between Nsecfilt items in PHU and Table headers (%d vs %d)\n", Nitems, Nexpect); 407 } 408 catalog[0].Nsecf_mem = Nrows * Nsecfilt; 409 catalog[0].Nsecf_off = start * Nsecfilt; 399 410 400 411 /* if primary is defined, we were supplied with one additional average magnitude from Average 401 412 we need to interleave these magnitudes with the secfilt entries just loaded */ 402 413 if (primary != NULL) { 403 int Ntmpfilt, i, j; 404 SecFilt *tmpfilt; 405 tmpfilt = catalog[0].secfilt; 406 Ntmpfilt = catalog[0].Nsecfilt; 407 408 catalog[0].Nsecfilt ++; 409 catalog[0].Nsecf_disk = catalog[0].Nsecfilt * catalog[0].Naves_disk; 410 Nsecfilt = catalog[0].Nsecfilt; 411 412 // the loaded average rows correspond to the loaded secfilt rows 413 // supplement with the loaded primary secfilt data 414 Nexpect = Nrows * Nsecfilt; 415 ALLOCATE (catalog[0].secfilt, SecFilt, Nexpect); 416 for (i = 0; i < Nrows; i++) { 417 catalog[0].secfilt[i*Nsecfilt + 0] = primary[i]; 418 for (j = 0; j < Ntmpfilt; j++) { 419 catalog[0].secfilt[i*Nsecfilt + j + 1] = tmpfilt[i*Ntmpfilt + j]; 420 } 421 } 422 free (primary); 414 dvo_catalog_primary_to_secfilt (catalog, primary, Nrows); 423 415 } 424 416 gfits_free_header (&header); 425 417 gfits_free_matrix (&matrix); 426 catalog[0].Nsecf_mem = Nexpect;427 catalog[0].Nsecf_off = start * Nsecfilt;428 429 // CAREFUL: note that Nsecf_disk and Nsecf_off are set to the values if there were no primary data430 418 } 431 419 … … 448 436 } 449 437 /* read Measure table data : format is irrelevant here */ 450 if (!gfits_fread_ vtable_range (subcat[0].f, &vtable, start, Nrows)) {438 if (!gfits_fread_ftable_range (subcat[0].f, &ftable, start, Nrows)) { 451 439 if (VERBOSE) fprintf (stderr, "can't read table measure data"); 452 440 return (FALSE); … … 454 442 455 443 /* convert data format to internal : returns number of row read in Nmeasure */ 456 catalog[0].measure = VtableToMeasure (&vtable, &Nmeasure, &catalog[0].catformat);444 catalog[0].measure = FtableToMeasure (&ftable, &Nmeasure, &catalog[0].catformat); 457 445 if (Nmeasure != Nrows) { 458 446 fprintf (stderr, "Warning: mismatch between Nmeasure in PHU and Table headers (%d vs %d)\n", Nmeasure, Nrows); … … 482 470 } 483 471 /* read Missing table data : format is irrelevant here */ 484 if (!gfits_fread_ vtable_range (subcat[0].f, &vtable, start, Nrows)) {472 if (!gfits_fread_ftable_range (subcat[0].f, &ftable, start, Nrows)) { 485 473 if (VERBOSE) fprintf (stderr, "can't read table missing data"); 486 474 return (FALSE); 487 475 } 488 476 489 /* convert data format to internal : returns number of row read in Nmissing*/490 catalog[0].missing = VtableToMissing (&vtable, &Nmissing, &catalog[0].catformat);477 /* no conversions currently defined : this just does the byte swap */ 478 catalog[0].missing = gfits_table_get_Missing (&ftable, &Nmissing, NULL); 491 479 if (Nmissing != Nrows) { 492 480 fprintf (stderr, "Warning: mismatch between Nmissing in PHU and Table headers (%d vs %d)\n", Nmissing, Nrows); … … 568 556 } 569 557 570 if (!dvo_catalog_save_sub set (catalog,ftable, start, Nrows, catalog[0].Naves_disk, Naves_disk_new)) {558 if (!dvo_catalog_save_subcat (catalog, &ftable, start, Nrows, catalog[0].Naves_disk, Naves_disk_new)) { 571 559 fprintf (stderr, "failure writing Average table\n"); 572 560 goto failure; … … 606 594 607 595 // write out Measure table 608 if (!dvo_catalog_save_sub set (catalog[0].measure_catalog,ftable, start, Nrows, catalog[0].Nmeas_disk, Nmeas_disk_new)) {596 if (!dvo_catalog_save_subcat (catalog[0].measure_catalog, &ftable, start, Nrows, catalog[0].Nmeas_disk, Nmeas_disk_new)) { 609 597 fprintf (stderr, "trouble writing Measure table\n"); 610 598 goto failure; … … 629 617 630 618 // write out Missing table (must write out entire table) 631 if (!dvo_catalog_save_sub set (catalog[0].missing_catalog,ftable, 0, catalog[0].Nmissing, catalog[0].Nmissing, catalog[0].Nmissing)) {619 if (!dvo_catalog_save_subcat (catalog[0].missing_catalog, &ftable, 0, catalog[0].Nmissing, catalog[0].Nmissing, catalog[0].Nmissing)) { 632 620 fprintf (stderr, "trouble writing Missing Table\n"); 633 621 goto failure; … … 649 637 assert (first < Nitems); 650 638 assert (catalog[0].Nsecf_disk >= catalog[0].Nsecf_off); 639 // XXX check these for consistency... 651 640 652 641 // convert to external table format … … 654 643 655 644 // write out SecFilt table 656 if (!dvo_catalog_save_sub set (catalog[0].secfilt_catalog,ftable, start, Nrows, catalog[0].Nsecf_disk, Nsecf_disk_new)) {645 if (!dvo_catalog_save_subcat (catalog[0].secfilt_catalog, &ftable, start, Nrows, catalog[0].Nsecf_disk, Nsecf_disk_new)) { 657 646 fprintf (stderr, "failure writing SecFilt table\n"); 658 647 goto failure; … … 688 677 Header header; 689 678 FTable ftable; 690 VTable vtable;691 679 Catalog *catfile; 692 680 SecFilt *primary, *secfilt; … … 750 738 } 751 739 752 if (!dvo_catalog_save_sub set (catalog,ftable, start, Nrows, catalog[0].Naves_disk, Naves_disk_new)) {740 if (!dvo_catalog_save_subcat (catalog, &ftable, start, Nrows, catalog[0].Naves_disk, Naves_disk_new)) { 753 741 fprintf (stderr, "failure writing Average table\n"); 754 742 goto failure; … … 788 776 789 777 // write out Measure table 790 if (!dvo_catalog_save_sub set (catalog[0].measure_catalog,ftable, start, Nrows, catalog[0].Nmeas_disk, Nmeas_disk_new)) {778 if (!dvo_catalog_save_subcat (catalog[0].measure_catalog, &ftable, start, Nrows, catalog[0].Nmeas_disk, Nmeas_disk_new)) { 791 779 fprintf (stderr, "trouble writing Measure table\n"); 792 780 goto failure; … … 815 803 816 804 // write out Missing table (must write out entire table) 817 if (!dvo_catalog_save_sub set (catalog[0].missing_catalog,ftable, 0, catalog[0].Nmissing, catalog[0].Nmissing, catalog[0].Nmissing)) {805 if (!dvo_catalog_save_subcat (catalog[0].missing_catalog, &ftable, 0, catalog[0].Nmissing, catalog[0].Nmissing, catalog[0].Nmissing)) { 818 806 fprintf (stderr, "trouble writing Missing Table\n"); 819 807 goto failure; … … 840 828 841 829 // write out SecFilt table 842 if (!dvo_catalog_save_sub set (catalog[0].secfilt_catalog,ftable, start, Nrows, catalog[0].Nsecf_disk, Nsecf_disk_new)) {830 if (!dvo_catalog_save_subcat (catalog[0].secfilt_catalog, &ftable, start, Nrows, catalog[0].Nsecf_disk, Nsecf_disk_new)) { 843 831 fprintf (stderr, "failure writing SecFilt table\n"); 844 832 goto failure; … … 875 863 /* XXX EAM : update is not efficient. MeasureToFtable should only 876 864 convert the new rows (Nmeas_disk to Nmeasure). the resulting 877 table represents the end rows of the vtable. we need to define865 table represents the end rows of the ftable. we need to define 878 866 the vtable based on the ftable, but with Ny = Nmeasure */ 879 867 -
branches/eam_branch_20071130/Ohana/src/libfits/include/gfitsio.h
r15731 r15732 172 172 int gfits_fread_ftable PROTO((FILE *f, FTable *ftable, char *extname)); 173 173 int gfits_fread_ftable_data PROTO((FILE *f, FTable *ftable)); 174 int gfits_fread_ftable_range PROTO((FILE *f, FTable *ftable, int start, int Nrows)); 174 175 int gfits_fread_vtable PROTO((FILE *f, VTable *vtable, char *extname, int Nrow, int *row)); 175 176 int gfits_fread_vtable_range PROTO((FILE *f, VTable *vtable, int start, int Nrows)); -
branches/eam_branch_20071130/Ohana/src/libfits/table/F_read_T.c
r15487 r15732 63 63 } 64 64 table[0].size = Nbytes; 65 return (TRUE); 66 } 67 68 /*********************** fits read ftable data ***********************************/ 69 int gfits_fread_ftable_range (FILE *f, FTable *table, int start, int Nrows) { 70 71 int Nbytes, Nread, Nskip, Nx, Ny; 72 char *buffer; 73 74 /* find disk table size */ 75 Nx = table[0].header[0].Naxis[0]; 76 Ny = table[0].header[0].Naxis[1]; 77 78 if (start < 0) return (FALSE); 79 if (start + Nrows >= Ny) return (FALSE); 80 81 Nskip = start * Nx; 82 Nbytes = Nrows * Nx; 83 ALLOCATE (table[0].buffer, char, MAX (Nbytes, 1)); 84 85 fseek (f, Nskip, SEEK_CUR); 86 Nread = fread (buffer, sizeof (char), Nbytes, f); 87 if (Nread != Nbytes) { 88 free (buffer); 89 return (FALSE); 90 } 91 92 /* modify structure and header to match actual read rows Ny */ 93 table[0].header[0].Naxis[1] = Nrows; 94 gfits_modify (table[0].header, "NAXIS2", "%d", 1, Nrows); 95 table[0].size = gfits_data_size (table[0].header); 96 65 97 return (TRUE); 66 98 } -
branches/eam_branch_20071130/Ohana/src/markrock/src/markrock.c
r15723 r15732 45 45 exit (2); 46 46 } 47 if (catalog.Nave _disk) {47 if (catalog.Naves_disk) { 48 48 dvo_catalog_unlock (&catalog); 49 49 dvo_catalog_free (&catalog); -
branches/eam_branch_20071130/Ohana/src/markstar/src/markstar.c
r8386 r15732 48 48 exit (2); 49 49 } 50 if (!catalog.Nave _disk) {50 if (!catalog.Naves_disk) { 51 51 dvo_catalog_unlock (&catalog); 52 52 dvo_catalog_free (&catalog); -
branches/eam_branch_20071130/Ohana/src/mosastro/src/getptolemy.c
r12332 r15732 36 36 dvo_catalog_unlock (&catalog); 37 37 38 // Nave _disk == 0 implies an empty catalog file38 // Naves_disk == 0 implies an empty catalog file 39 39 // for only_match, skip empty catalogs 40 if (!catalog.Nave _disk) {40 if (!catalog.Naves_disk) { 41 41 dvo_catalog_free (&catalog); 42 42 continue; -
branches/eam_branch_20071130/Ohana/src/photdbc/src/join_stars.c
r12332 r15732 172 172 173 173 catalog[0].Naverage = Naves; 174 catalog[0].Nsecf_mem = Naves*catalog[0].Nsecfilt; 174 175 } 175 176 … … 181 182 generates a new SecFilt table with empty values 182 183 does NOT update magnitudes 184 output measure table is the same size as the input measure table 185 (measures are just moved around). thus, catalog[0].Nmeasure does not change. 183 186 */ 184 187 -
branches/eam_branch_20071130/Ohana/src/photdbc/src/make_subcatalog.c
r12332 r15732 10 10 11 11 Nsecfilt = GetPhotcodeNsecfilt (); 12 assert (catalog[0].Nsecfilt == Nsecfilt); 12 13 13 14 /* we are moving only the subset of measurements from catalog[0] to subcatalog[0] */ … … 96 97 subcatalog[0].Naverage = Naverage; 97 98 subcatalog[0].Nmeasure = Nmeasure; 98 subcatalog[0].Nsecfilt = catalog[0].Nsecfilt; 99 subcatalog[0].Nsecfilt = Nsecfilt; 100 subcatalog[0].Nsecf_mem = Naverage * Nsecfilt; 99 101 100 102 // XXX for now, don't copy the missing entries (these should be re-computed) -
branches/eam_branch_20071130/Ohana/src/photdbc/src/photdbc.c
r8701 r15732 34 34 } 35 35 // skip empty input catalogs 36 if (!incatalog.Nave _disk) {36 if (!incatalog.Naves_disk) { 37 37 dvo_catalog_unlock (&incatalog); 38 38 dvo_catalog_free (&incatalog); -
branches/eam_branch_20071130/Ohana/src/relastro/src/bcatalog.c
r15723 r15732 6 6 int NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm; 7 7 float mag; 8 9 // XXX PhotNsec as a global is a bad idea; either get it from catalog 10 // or get it from: 11 // Nsecfilt = GetPhotcodeNsecfilt (); 12 // assert (catalog[0].Nsecfilt == Nsecfilt); 8 13 9 14 /* we are moving only the subset of measurements from catalog[0] to subcatalog[0] */ … … 104 109 subcatalog[0].Nmeasure = Nmeasure; 105 110 subcatalog[0].Nsecfilt = catalog[0].Nsecfilt; 111 subcatalog[0].Nsecf_mem = Naverage * PhotNsec; 112 assert (PhotNsec == catalog[0].Nsecfilt); 106 113 107 114 if (VERBOSE) { -
branches/eam_branch_20071130/Ohana/src/relastro/src/load_catalogs.c
r15723 r15732 26 26 exit (1); 27 27 } 28 if (VERBOSE && !pcatalog[0].Nave _disk) fprintf (stderr, "no data in %s, skipping\n", pcatalog[0].filename);28 if (VERBOSE && !pcatalog[0].Naves_disk) fprintf (stderr, "no data in %s, skipping\n", pcatalog[0].filename); 29 29 30 30 // select only the brighter stars -
branches/eam_branch_20071130/Ohana/src/relastro/src/reload_catalogs.c
r12332 r15732 29 29 exit (1); 30 30 } 31 if (VERBOSE && (catalog.Nave _disk == 0)) {31 if (VERBOSE && (catalog.Naves_disk == 0)) { 32 32 fprintf (stderr, "no data in %s, skipping\n", catalog.filename); 33 33 dvo_catalog_unlock (&catalog); -
branches/eam_branch_20071130/Ohana/src/relphot/src/bcatalog.c
r15634 r15732 6 6 int NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm; 7 7 float mag; 8 9 // XXX PhotNsec as a global is a bad idea; either get it from catalog 10 // or get it from: 11 // Nsecfilt = GetPhotcodeNsecfilt (); 12 // assert (catalog[0].Nsecfilt == Nsecfilt); 8 13 9 14 /* we are moving only the subset of measurements from catalog[0] to subcatalog[0] */ … … 105 110 subcatalog[0].Nmeasure = Nmeasure; 106 111 subcatalog[0].Nsecfilt = catalog[0].Nsecfilt; 112 subcatalog[0].Nsecf_mem = Naverage * catalog[0].Nsecfilt; 113 assert (PhotNsec == catalog[0].Nsecfilt); 107 114 108 115 if (VERBOSE) { -
branches/eam_branch_20071130/Ohana/src/relphot/src/load_catalogs.c
r9633 r15732 24 24 exit (1); 25 25 } 26 if (VERBOSE && !tcatalog.Nave _disk) fprintf (stderr, "no data in %s, skipping\n", tcatalog.filename);26 if (VERBOSE && !tcatalog.Naves_disk) fprintf (stderr, "no data in %s, skipping\n", tcatalog.filename); 27 27 28 28 // select only the brighter stars -
branches/eam_branch_20071130/Ohana/src/relphot/src/reload_catalogs.c
r9633 r15732 30 30 exit (1); 31 31 } 32 if (VERBOSE && (catalog.Nave _disk == 0)) {32 if (VERBOSE && (catalog.Naves_disk == 0)) { 33 33 fprintf (stderr, "no data in %s, skipping\n", catalog.filename); 34 34 dvo_catalog_unlock (&catalog); -
branches/eam_branch_20071130/Ohana/src/uniphot/src/update.c
r12332 r15732 52 52 exit (2); 53 53 } 54 if (!catalog.Nave _disk) {54 if (!catalog.Naves_disk) { 55 55 dvo_catalog_unlock (&catalog); 56 56 dvo_catalog_free (&catalog);
Note:
See TracChangeset
for help on using the changeset viewer.
