Changeset 5320 for trunk/Ohana/src/libdvo
- Timestamp:
- Oct 13, 2005, 2:37:39 PM (21 years ago)
- Location:
- trunk/Ohana/src/libdvo
- Files:
-
- 5 edited
-
include/dvo.h (modified) (3 diffs)
-
src/dvo_catalog.c (modified) (2 diffs)
-
src/dvo_catalog_mef.c (modified) (5 diffs)
-
src/dvo_catalog_raw.c (modified) (6 diffs)
-
src/dvo_catalog_split.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/include/dvo.h
r5241 r5320 145 145 int catmode; /* storage mode (raw, mef, split, mysql) */ 146 146 int catformat; /* storage format (elixir, panstarrs, etc) */ 147 int catflags; /* choices to be loaded */ 147 148 int sorted; /* is measure table average-sorted? */ 148 149 … … 181 182 int lock_catalog (Catalog *catalog, int lockmode); 182 183 int unlock_catalog (Catalog *catalog); 183 int load_catalog (Catalog *catalog, char mode,int VERBOSE);184 int load_catalog (Catalog *catalog, int VERBOSE); 184 185 int save_catalog (Catalog *catalog, char VERBOSE); 185 186 int update_catalog (Catalog *catalog, char VERBOSE); … … 292 293 int SecFiltToFtable (FTable *ftable, SecFilt *secfilt, int Nsecfilt, int format); 293 294 294 int load_catalog_raw (Catalog *catalog, char mode,int VERBOSE);295 int load_catalog_raw (Catalog *catalog, int VERBOSE); 295 296 int save_catalog_raw (Catalog *catalog, char VERBOSE); 296 int load_catalog_mef (Catalog *catalog, char mode,int VERBOSE);297 int load_catalog_mef (Catalog *catalog, int VERBOSE); 297 298 int save_catalog_mef (Catalog *catalog, char VERBOSE); 298 int load_catalog_split (Catalog *catalog, char mode,int VERBOSE);299 int load_catalog_split (Catalog *catalog, int VERBOSE); 299 300 int save_catalog_split (Catalog *catalog, char VERBOSE); 300 301 int update_catalog_split (Catalog *catalog, char VERBOSE); -
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r5241 r5320 35 35 } 36 36 37 int load_catalog (Catalog *catalog, char mode,int VERBOSE) {37 int load_catalog (Catalog *catalog, int VERBOSE) { 38 38 39 39 int Naxis, split; … … 63 63 case DVO_MODE_RAW: 64 64 if (VERBOSE) fprintf (stderr, "reading catalog (mode DVO_MODE_RAW)\n"); 65 load_catalog_raw (catalog, mode,VERBOSE);65 load_catalog_raw (catalog, VERBOSE); 66 66 break; 67 67 case DVO_MODE_MEF: 68 68 if (VERBOSE) fprintf (stderr, "reading catalog (mode DVO_MODE_MEF)\n"); 69 load_catalog_mef (catalog, mode,VERBOSE);69 load_catalog_mef (catalog, VERBOSE); 70 70 break; 71 71 case DVO_MODE_SPLIT: 72 72 if (VERBOSE) fprintf (stderr, "reading catalog (mode DVO_MODE_SPLIT)\n"); 73 load_catalog_split (catalog, mode,VERBOSE);73 load_catalog_split (catalog, VERBOSE); 74 74 break; 75 75 default: -
trunk/Ohana/src/libdvo/src/dvo_catalog_mef.c
r5241 r5320 1 1 # include <dvo.h> 2 2 3 int load_catalog_mef (Catalog *catalog, char mode,int VERBOSE) {3 int load_catalog_mef (Catalog *catalog, int VERBOSE) { 4 4 5 5 int Nitems, Nbytes, Nexpect, Naverage, Nmeasure, Nmissing, Nsecfilt; … … 39 39 } 40 40 /* read Average table data (or skip) */ 41 if ( mode& LOAD_AVES) {41 if (catalog[0].catflags & LOAD_AVES) { 42 42 if (!fits_fread_ftable_data (f, &ftable)) { 43 43 if (VERBOSE) fprintf (stderr, "can't read table average data"); … … 61 61 } 62 62 /* read Measure table data */ 63 if ( mode& LOAD_MEAS) {63 if (catalog[0].catflags & LOAD_MEAS) { 64 64 if (!fits_fread_ftable_data (f, &ftable)) { 65 65 if (VERBOSE) fprintf (stderr, "can't read table measure data"); … … 81 81 } 82 82 /* read Missing table data */ 83 if ( mode& LOAD_MISS) {83 if (catalog[0].catflags & LOAD_MISS) { 84 84 if (!fits_fread_ftable_data (f, &ftable)) { 85 85 if (VERBOSE) fprintf (stderr, "can't read table missing data"); … … 105 105 } 106 106 /* read secfilt table data */ 107 if ( mode& LOAD_SECF) {107 if (catalog[0].catflags & LOAD_SECF) { 108 108 if (!fits_fread_ftable_data (f, &ftable)) { 109 109 if (VERBOSE) fprintf (stderr, "can't read table secfilt data"); -
trunk/Ohana/src/libdvo/src/dvo_catalog_raw.c
r5241 r5320 3 3 /* read data from raw-style catalog file; set data format values based on file */ 4 4 5 int load_catalog_raw (Catalog *catalog, char mode,int VERBOSE) {5 int load_catalog_raw (Catalog *catalog, int VERBOSE) { 6 6 7 7 int Nitems, nitems; … … 113 113 114 114 /* read and convert the averages (use a macro to clean this up?) */ 115 if ( mode& LOAD_AVES) {115 if (catalog[0].catflags & LOAD_AVES) { 116 116 catalog[0].average = ReadRawAverage (catalog[0].f, catalog[0].Naverage, catalog[0].catformat); 117 117 } else { … … 122 122 123 123 /* read and convert the measures (use a macro to clean this up?) */ 124 if ( mode& LOAD_MEAS) {124 if (catalog[0].catflags & LOAD_MEAS) { 125 125 catalog[0].measure = ReadRawMeasure (catalog[0].f, catalog[0].Nmeasure, catalog[0].catformat); 126 126 } else { … … 131 131 132 132 /* read and convert missing */ 133 if ( mode& LOAD_MISS) {133 if (catalog[0].catflags & LOAD_MISS) { 134 134 ALLOCATE (catalog[0].missing, Missing, MAX (catalog[0].Nmissing, 1)); 135 135 Nitems = catalog[0].Nmissing; … … 147 147 148 148 /* read and convert secfilt */ 149 if ( mode& LOAD_SECF) {149 if (catalog[0].catflags & LOAD_SECF) { 150 150 Nitems = catalog[0].Naverage * catalog[0].Nsecfilt; 151 151 catalog[0].secfilt = ReadRawSecFilt (catalog[0].f, Nitems, catalog[0].catformat); … … 160 160 161 161 /* check data integrity */ 162 if ( mode& LOAD_AVES) {162 if (catalog[0].catflags & LOAD_AVES) { 163 163 for (i = Nmeas = Nmiss = 0; i < catalog[0].Naverage; i++) { 164 164 Nmeas += catalog[0].average[i].Nm; -
trunk/Ohana/src/libdvo/src/dvo_catalog_split.c
r5241 r5320 1 1 # include <dvo.h> 2 2 3 int load_catalog_split (Catalog *catalog, char mode,int VERBOSE) {3 int load_catalog_split (Catalog *catalog, int VERBOSE) { 4 4 5 5 int Nitems, Nexpect, Naverage, Nmeasure, Nmissing, Nsecfilt; … … 36 36 /*** Average Table ***/ 37 37 38 if ( mode& LOAD_AVES) {38 if (catalog[0].catflags & LOAD_AVES) { 39 39 /* move pointer past header -- must be already read (load_catalog) */ 40 40 fseek (catalog[0].f, catalog[0].header.size, SEEK_SET); … … 66 66 67 67 /* (Full Load) */ 68 if ( mode& LOAD_MEAS) {68 if (catalog[0].catflags & LOAD_MEAS) { 69 69 ALLOCATE (measure, Catalog, 1); 70 70 … … 111 111 112 112 /* (Meta Load) */ 113 if ( mode& LOAD_MEAS_META) {113 if (catalog[0].catflags & LOAD_MEAS_META) { 114 114 ALLOCATE (measure, Catalog, 1); 115 115 … … 143 143 144 144 missing = NULL; 145 if ( mode& LOAD_MISS) {145 if (catalog[0].catflags & LOAD_MISS) { 146 146 ALLOCATE (missing, Catalog, 1); 147 147 … … 190 190 191 191 secfilt = NULL; 192 if ( mode& LOAD_SECF) {192 if (catalog[0].catflags & LOAD_SECF) { 193 193 ALLOCATE (secfilt, Catalog, 1); 194 194
Note:
See TracChangeset
for help on using the changeset viewer.
