Changeset 29938 for trunk/Ohana/src/libdvo
- Timestamp:
- Dec 5, 2010, 10:04:42 PM (16 years ago)
- Location:
- trunk/Ohana/src/libdvo
- Files:
-
- 7 edited
-
include/dvo.h (modified) (5 diffs)
-
src/dvo_catalog.c (modified) (3 diffs)
-
src/dvo_catalog_mef.c (modified) (4 diffs)
-
src/dvo_catalog_split.c (modified) (4 diffs)
-
src/dvo_photcode_ops.c (modified) (1 diff)
-
src/fits_db.c (modified) (1 diff)
-
src/mosaic_astrom.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/include/dvo.h
r29001 r29938 58 58 // these are used as NAN for types of int values 59 59 typedef enum { 60 NAN_S_CHAR = 0x7f,61 NAN_U_CHAR = 0xff, // was NO_ERR62 NAN_S_SHORT = 0x7fff, // was NO_MAG63 NAN_U_SHORT = 0xffff,64 NAN_S_INT = 0x7fffffff,65 NAN_U_INT =0xffffffff,60 NAN_S_CHAR = 0x7f, 61 NAN_U_CHAR = 0xff, // was NO_ERR 62 NAN_S_SHORT = 0x7fff, // was NO_MAG 63 NAN_U_SHORT = 0xffff, 64 NAN_S_INT = 0x7fffffff, 65 NAN_U_INT = (signed int) 0xffffffff, 66 66 } DVO_INT_NAN; 67 67 … … 135 135 /* Average.code values -- these values are 32 bit (as of PS1_V1) */ 136 136 typedef enum { 137 ID_STAR_FEW = 0x00000001, // used within relphot: skip star 138 ID_STAR_POOR = 0x00000002, // used within relphot: skip star 139 ID_PROPER = 0x00000400, // star with large proper motion 140 ID_TRANSIENT = 0x00001000, // is this mutually exclusive with USNO? 141 ID_VARIABLE = 0x00002000, // not currently set? 142 ID_ASTEROID = 0x00002000, // identified with an asteroid 143 ID_BAD_OBJECT = 0x00004000, // if all measurements are bad, set this bit 137 ID_STAR_FEW = 0x00000001, // used within relphot: skip star 138 ID_STAR_POOR = 0x00000002, // used within relphot: skip star 139 ID_PROPER = 0x00000400, // star with large proper motion 140 ID_TRANSIENT = 0x00001000, // is this mutually exclusive with USNO? 141 ID_VARIABLE = 0x00002000, // not currently set? 142 ID_ASTEROID = 0x00002000, // identified with an asteroid 143 ID_BAD_OBJECT = 0x00004000, // if all measurements are bad, set this bit 144 144 ID_MOVING = 0x00008000, // is a moving object 145 ID_ROCK = 0x0000a000, // 0x8000 + 0x2000 146 ID_GHOST = 0x0000c001, // 0x8000 + 0x4000 + 0x0001 147 ID_TRAIL = 0x0000c002, // 0x8000 + 0x4000 + 0x0002 148 ID_BLEED = 0x0000c003, // 0x8000 + 0x4000 + 0x0003 149 ID_COSMIC = 0x0000c004, // 0x8000 + 0x4000 + 0x0004 145 ID_ROCK = 0x0000a000, // 0x8000 + 0x2000 146 ID_GHOST = 0x0000c001, // 0x8000 + 0x4000 + 0x0001 147 ID_TRAIL = 0x0000c002, // 0x8000 + 0x4000 + 0x0002 148 ID_BLEED = 0x0000c003, // 0x8000 + 0x4000 + 0x0003 149 ID_COSMIC = 0x0000c004, // 0x8000 + 0x4000 + 0x0004 150 150 ID_STAR_FIT_AVE = 0x00010000, // average position fitted 151 151 ID_STAR_FIT_PM = 0x00020000, // proper motion fitted … … 156 156 ID_OBJ_EXT = 0x01000000, // extended in our data (eg, PS) 157 157 ID_OBJ_EXT_ALT = 0x02000000, // extended in external data (eg, 2MASS) 158 ID_OBJ_GOOD = 0x04000000, // good-quality measurement in our data (eg, PS)159 ID_OBJ_GOOD_ALT = 0x08000000, // good-quality measurement in external data (eg, 2MASS)158 ID_OBJ_GOOD = 0x04000000, // good-quality measurement in our data (eg,PS) 159 ID_OBJ_GOOD_ALT = 0x08000000, // good-quality measurement in external data (eg, 2MASS) 160 160 } DVOAverageFlags; 161 161 … … 233 233 *** that is just silly, and bad: convert to using Nsec_mem, Nsec_disk, Nsec_off. 234 234 *** unless we always require the secfilt and average entries to be loaded sychronously. 235 */235 */ 236 236 237 237 /* pointers to split data files */ … … 293 293 int isRegisteredMosaic (void); 294 294 off_t GetRegisteredMosaic (void); 295 off_t *GetChipMatch (void); 295 296 int GetMosaicCoords (Coords *coords); 296 297 int FindMosaicForImage (Image *images, off_t Nimages, off_t entry); -
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r27580 r29938 302 302 int dvo_catalog_save (Catalog *catalog, char VERBOSE) { 303 303 304 int status = FALSE; 305 304 306 // set the 'sorted' header keyword 305 307 gfits_modify_alt (&catalog[0].header, "SORTED", "%t", 1, catalog[0].sorted); … … 308 310 switch (catalog[0].catmode) { 309 311 case DVO_MODE_RAW: 310 dvo_catalog_save_raw (catalog, VERBOSE);312 status = dvo_catalog_save_raw (catalog, VERBOSE); 311 313 break; 312 314 case DVO_MODE_MEF: 313 dvo_catalog_save_mef (catalog, VERBOSE);315 status = dvo_catalog_save_mef (catalog, VERBOSE); 314 316 break; 315 317 case DVO_MODE_SPLIT: 316 dvo_catalog_save_split (catalog, VERBOSE);318 status = dvo_catalog_save_split (catalog, VERBOSE); 317 319 break; 318 320 default: … … 320 322 exit (2); 321 323 } 322 return ( TRUE);324 return (status); 323 325 } 324 326 -
trunk/Ohana/src/libdvo/src/dvo_catalog_mef.c
r29001 r29938 66 66 /* read Average table data (or skip) */ 67 67 if (catalog[0].catflags & LOAD_AVES) { 68 if (!gfits_fread_ftable_data (f, &ftable )) {68 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) { 69 69 if (VERBOSE) fprintf (stderr, "can't read table average data"); 70 70 return (FALSE); … … 94 94 /* read Measure table data */ 95 95 if (catalog[0].catflags & LOAD_MEAS) { 96 if (!gfits_fread_ftable_data (f, &ftable )) {96 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) { 97 97 if (VERBOSE) fprintf (stderr, "can't read table measure data"); 98 98 return (FALSE); … … 119 119 /* read Missing table data */ 120 120 if (catalog[0].catflags & LOAD_MISS) { 121 if (!gfits_fread_ftable_data (f, &ftable )) {121 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) { 122 122 if (VERBOSE) fprintf (stderr, "can't read table missing data"); 123 123 return (FALSE); … … 149 149 /* read secfilt table data */ 150 150 if (catalog[0].catflags & LOAD_SECF) { 151 if (!gfits_fread_ftable_data (f, &ftable )) {151 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) { 152 152 if (VERBOSE) fprintf (stderr, "can't read table secfilt data"); 153 153 return (FALSE); -
trunk/Ohana/src/libdvo/src/dvo_catalog_split.c
r29001 r29938 218 218 } 219 219 /* read Average table data : format is irrelevant here */ 220 if (!gfits_fread_ftable_data (catalog[0].f, &ftable )) {220 if (!gfits_fread_ftable_data (catalog[0].f, &ftable, FALSE)) { 221 221 if (VERBOSE) fprintf (stderr, "can't read table average data"); 222 222 return (FALSE); … … 249 249 // XXX this allows an empty Measure catalog with non-empty Average catalog : is that OK? 250 250 /* read Measure table data */ 251 if (!gfits_fread_ftable_data (catalog[0].measure_catalog[0].f, &ftable )) {251 if (!gfits_fread_ftable_data (catalog[0].measure_catalog[0].f, &ftable, FALSE)) { 252 252 if (VERBOSE) fprintf (stderr, "can't read table measure data\n"); 253 253 return (FALSE); … … 279 279 if ((status != DVO_CAT_OPEN_EMPTY) && (catalog[0].catflags & LOAD_MISS)) { 280 280 /* read Missing table data */ 281 if (!gfits_fread_ftable_data (catalog[0].missing_catalog[0].f, &ftable )) {281 if (!gfits_fread_ftable_data (catalog[0].missing_catalog[0].f, &ftable, FALSE)) { 282 282 if (VERBOSE) fprintf (stderr, "can't read table missing data\n"); 283 283 return (FALSE); … … 313 313 if ((status != DVO_CAT_OPEN_EMPTY) && (catalog[0].catflags & LOAD_SECF)) { 314 314 /* read secfilt table data */ 315 if (!gfits_fread_ftable_data (catalog[0].secfilt_catalog[0].f, &ftable )) {315 if (!gfits_fread_ftable_data (catalog[0].secfilt_catalog[0].f, &ftable, FALSE)) { 316 316 if (VERBOSE) fprintf (stderr, "can't read table secfilt data\n"); 317 317 return (FALSE); -
trunk/Ohana/src/libdvo/src/dvo_photcode_ops.c
r29182 r29938 557 557 } 558 558 } 559 if (entry == -1) { 560 // entry is missing fail (no printfs in this file) 561 free(map); 562 return(FALSE); 563 } 559 // if (entry == -1) { 560 // // entry is missing fail (no printfs in this file) 561 // free(map); 562 // return(FALSE); 563 // } 564 565 // if entry is still -1, we will skip this one (not map into the output db) 564 566 map[i] = entry; 565 567 } -
trunk/Ohana/src/libdvo/src/fits_db.c
r28246 r29938 83 83 return (FALSE); 84 84 } 85 if (!gfits_fread_ftable_data (db[0].f, &db[0].ftable )) {85 if (!gfits_fread_ftable_data (db[0].f, &db[0].ftable, FALSE)) { 86 86 fprintf (stderr, "can't read table data"); 87 87 gfits_db_free (db); -
trunk/Ohana/src/libdvo/src/mosaic_astrom.c
r27435 r29938 17 17 } 18 18 19 /* what is the currently registered mosaic image? */ 20 off_t *GetChipMatch () { 21 return (ChipMatch); 22 } 23 19 24 /* given an image array and a current entry of type WRP, find matching DIS & Register it */ 20 25 int FindMosaicForImage (Image *images, off_t Nimages, off_t entry) { … … 40 45 if (strcmp(&images[entry].coords.ctype[4], "-WRP")) { 41 46 /* not a wrp image, do nothing */ 42 return ( TRUE); /* error or not */47 return (entry + 1); /* error or not */ 43 48 } 44 49 … … 52 57 RegisterMosaic (&images[i].coords); 53 58 iDIS = i; 54 return ( TRUE);59 return (i + 1); 55 60 } 56 61 … … 62 67 RegisterMosaic (&images[i].coords); 63 68 iDIS = i; 64 return ( TRUE);69 return (i + 1); 65 70 } 66 71 return (FALSE); … … 74 79 if (strcmp(&images[entry].coords.ctype[4], "-WRP")) { 75 80 /* not a wrp image, do nothing */ 76 return ( TRUE); /* error or not? */81 return (entry + 1); /* error or not? */ 77 82 } 78 83 … … 85 90 RegisterMosaic (&images[N].coords); 86 91 iDIS = N; 87 return ( TRUE);92 return (N + 1); 88 93 } 89 94 … … 165 170 SortDISindex (DIStzero, DISentry, Ndis); 166 171 172 // ChipMatch has a few possible values: 173 // -3 : image is a mosaic (DIS) 174 // -2 : image is an unassigned WRP image 175 // -1 : image is not a WRP or DIS images 176 // >= 0 : value is the mosaic seq number for this WRP image 177 167 178 /* find all matched WRP images */ 168 179 ALLOCATE (ChipMatch, off_t, Nimages); 169 180 for (i = 0; i < Nimages; i++) { 170 181 ChipMatch[i] = -1; 182 if (!strcmp(&images[i].coords.ctype[4], "-DIS")) { 183 ChipMatch[i] = -3; 184 continue; 185 } 171 186 if (strcmp(&images[i].coords.ctype[4], "-WRP")) continue; 172 187
Note:
See TracChangeset
for help on using the changeset viewer.
