Changeset 31663 for trunk/Ohana/src/libdvo
- Timestamp:
- Jun 22, 2011, 12:33:45 AM (15 years ago)
- Location:
- trunk/Ohana/src/libdvo
- Files:
-
- 4 edited
-
include/dvo.h (modified) (1 diff)
-
src/coordops.c (modified) (4 diffs)
-
src/dvo_catalog.c (modified) (1 diff)
-
src/dvo_catalog_split.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/include/dvo.h
r31635 r31663 78 78 # define LOAD_MISS 0x04 79 79 # define LOAD_SECF 0x08 80 # define LOAD_MEAS_META 0x10 80 # define SKIP_AVES 0x10 81 # define SKIP_MEAS 0x20 82 # define SKIP_MISS 0x40 83 # define SKIP_SECF 0x80 84 85 // # define LOAD_MEAS_META 0x100 -- is this used?? 81 86 82 87 /* photometry code types */ -
trunk/Ohana/src/libdvo/src/coordops.c
r29001 r31663 440 440 int GetCoords (Coords *coords, Header *header) { 441 441 442 int status, itmp, Polynomial, Polyterm;443 double Lambda, rotate, scale;442 int status, status1, status2, itmp, Polynomial, Polyterm; 443 double Lambda, rotate, rotate1, rotate2, scale; 444 444 double equinox; 445 445 char *ctype; … … 456 456 mode = COORD_TYPE_NONE; 457 457 { 458 int haveCTYPE, haveCDELT, haveCROTA, haveC Dij, havePCij, haveRAo;458 int haveCTYPE, haveCDELT, haveCROTA, haveCROTA1, haveCROTA2, haveCDij, havePCij, haveRAo; 459 459 float tmp; 460 460 char stmp[80]; … … 463 463 // set: (CDELTi + CROTAi), (CDELTi + PCij), (CDij), 464 464 465 haveCTYPE = gfits_scan (header, "CTYPE2", "%s", 1, stmp); 466 haveCDELT = gfits_scan (header, "CDELT1", "%f", 1, &tmp); 467 haveCROTA = gfits_scan (header, "CROTA1", "%f", 1, &tmp); 468 haveCDij = gfits_scan (header, "CD1_1", "%f", 1, &tmp); 469 havePCij = gfits_scan (header, "PC001001", "%f", 1, &tmp); 470 haveRAo = gfits_scan (header, "RA_O", "%f", 1, &tmp); 465 haveCTYPE = gfits_scan (header, "CTYPE2", "%s", 1, stmp); 466 haveCDELT = gfits_scan (header, "CDELT1", "%f", 1, &tmp); 467 haveCROTA1 = gfits_scan (header, "CROTA1", "%f", 1, &tmp); 468 haveCROTA2 = gfits_scan (header, "CROTA2", "%f", 1, &tmp); 469 haveCDij = gfits_scan (header, "CD1_1", "%f", 1, &tmp); 470 havePCij = gfits_scan (header, "PC001001", "%f", 1, &tmp); 471 haveRAo = gfits_scan (header, "RA_O", "%f", 1, &tmp); 471 472 473 haveCROTA = haveCROTA1 || haveCROTA2; 474 472 475 if (haveCTYPE && havePCij && haveCDELT) { mode = COORD_TYPE_PC; goto gotit; } 473 476 if (haveCTYPE && haveCROTA && haveCDELT) { mode = COORD_TYPE_ROT; goto gotit; } … … 540 543 status &= gfits_scan (header, "CDELT2", "%f", 1, &coords[0].cdelt2); 541 544 542 status &= gfits_scan (header, "CROTA2", "%lf", 1, &rotate); 545 status1 = gfits_scan (header, "CROTA1", "%lf", 1, &rotate1); 546 status2 = gfits_scan (header, "CROTA2", "%lf", 1, &rotate2); 547 status &= status1 || status2; 548 549 rotate = rotate2; 550 if (status1 && !status2) rotate = rotate1; 551 if (!status1 && !status2) rotate = 0.0; 552 543 553 Lambda = coords[0].cdelt2 / coords[0].cdelt1; 544 554 coords[0].pc1_1 = cos(rotate*RAD_DEG); -
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r29938 r31663 90 90 catalog[0].secfilt = NULL; 91 91 92 catalog[0].averageT = NULL; 93 catalog[0].measureT = NULL; 94 92 95 catalog[0].objID = 0; 93 96 catalog[0].catID = 0; -
trunk/Ohana/src/libdvo/src/dvo_catalog_split.c
r31450 r31663 172 172 header.buffer = NULL; 173 173 primary = NULL; 174 status = FALSE; 174 175 175 176 /* get the components from the header - these duplicate information in the split files (NAXIS2) */ … … 239 240 240 241 /*** Measure Table ***/ 241 status = dvo_catalog_open_subcat (catalog, &catalog[0].measure_catalog, ftable.header, "MEASURE", VERBOSE); 242 if (status == DVO_CAT_OPEN_FAIL) { 243 return (FALSE); 244 } 245 if ((status == DVO_CAT_OPEN_EMPTY) && (catalog[0].Nmeas_disk > 0)) { 246 return (FALSE); 242 if (!(catalog[0].catflags & SKIP_MEAS)) { 243 // unless we specify 'skip', we still need to load the 244 status = dvo_catalog_open_subcat (catalog, &catalog[0].measure_catalog, ftable.header, "MEASURE", VERBOSE); 245 if (status == DVO_CAT_OPEN_FAIL) { 246 return (FALSE); 247 } 248 if ((status == DVO_CAT_OPEN_EMPTY) && (catalog[0].Nmeas_disk > 0)) { 249 return (FALSE); 250 } 247 251 } 248 252 if ((status != DVO_CAT_OPEN_EMPTY) && (catalog[0].catflags & LOAD_MEAS)) { … … 262 266 } else { 263 267 // XXX is it necessary to generate a template header here? 268 // XXX this is a memory leak, right? 269 if (catalog[0].measure_catalog) { 270 gfits_free_header (&catalog[0].measure_catalog[0].header); 271 } else { 272 ALLOCATE (catalog[0].measure_catalog, Catalog, 1); 273 dvo_catalog_init (catalog[0].measure_catalog, TRUE); 274 } 264 275 gfits_create_header (&catalog[0].measure_catalog[0].header); 265 276 ALLOCATE (catalog[0].measure, Measure, 1);
Note:
See TracChangeset
for help on using the changeset viewer.
