Changeset 8342
- Timestamp:
- Aug 14, 2006, 6:27:39 PM (20 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 11 edited
-
doc/dvotools.txt (modified) (1 diff)
-
src/addstar/Makefile (modified) (3 diffs)
-
src/addstar/src/addstar.c (modified) (5 diffs)
-
src/addstar/src/wcatalog.c (modified) (2 diffs)
-
src/libdvo/Makefile (modified) (1 diff)
-
src/libdvo/include/dvo.h (modified) (2 diffs)
-
src/libdvo/src/dvo_catalog.c (modified) (11 diffs)
-
src/libdvo/src/dvo_catalog_create.c (modified) (6 diffs)
-
src/libdvo/src/dvo_catalog_split.c (modified) (4 diffs)
-
src/libdvo/src/dvo_image.c (modified) (1 diff)
-
src/libdvo/src/skyregion_gsc.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/doc/dvotools.txt
r7689 r8342 4 4 photometric and astrometric calibrations needed by Pan-STARRS, ie the 5 5 AP Survey. 6 7 dvo DB manipulations: 8 9 - create a subset of a database (restrict by magnitude limits, time, 10 region, etc) 11 - re-organize the table structure using a new SkyTable file 12 - remove the automatic extension of the secfilt table; make a mode to 13 add a new secondary filter 14 15 dvo DB organization mods: 16 17 - drop the primary photcodes and put all primaries in the 'secfilt' table 18 - construct a FITS table for the photcodes 19 - tables for the camera and filter data which is currently in the config 20 - tools to update the photcode table 6 21 7 22 addstar : need a few additional new variations on the addstar concept -
trunk/Ohana/src/addstar/Makefile
r7780 r8342 35 35 $(SRC)/find_subset.$(ARCH).o \ 36 36 $(SRC)/fakeimage.$(ARCH).o \ 37 $(SRC)/gcatalog.$(ARCH).o \38 37 $(SRC)/get2mass.$(ARCH).o \ 39 38 $(SRC)/get2mass_as.$(ARCH).o \ … … 49 48 $(SRC)/gimages.$(ARCH).o \ 50 49 $(SRC)/gstars.$(ARCH).o \ 51 $(SRC)/image-db.$(ARCH).o \52 50 $(SRC)/in_image.$(ARCH).o \ 53 $(SRC)/load_pt_catalog.$(ARCH).o \54 51 $(SRC)/load_subpix.$(ARCH).o \ 55 $(SRC)/mkcatalog.$(ARCH).o \56 52 $(SRC)/opening_angle.$(ARCH).o \ 57 53 $(SRC)/parse_time.$(ARCH).o \ … … 61 57 $(SRC)/sort_lists.$(ARCH).o \ 62 58 $(SRC)/update_coords.$(ARCH).o \ 63 $(SRC)/wcatalog.$(ARCH).o \64 59 $(SRC)/Shutdown.$(ARCH).o \ 65 60 $(SRC)/SkyTableFromTychoIndex.$(ARCH).o \ -
trunk/Ohana/src/addstar/src/addstar.c
r8328 r8342 30 30 overlap = NULL; 31 31 set_db (&db); 32 if (options.update) {33 catalog.catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF;34 } else {35 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;36 }37 32 38 33 /* we use the image table to lock db access -- perhaps this is not necessary? */ 34 db.mode = dvo_catalog_catmode (CATMODE); 35 db.format = dvo_catalog_catformat (CATFORMAT); 39 36 status = dvo_image_lock (&db, ImageCat, 3600.0, LCK_XCLD); 40 37 if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename); … … 61 58 62 59 if (db.dbstate == LCK_EMPTY) { 63 create_image_db (&db);60 dvo_image_create (&db, ZeroPt); 64 61 } else { 65 62 if (!dvo_image_load (&db, VERBOSE, FORCE_READ)) { … … 94 91 for (i = 0; i < skylist[0].Nregions; i++) { 95 92 93 // set the parameters which guide catalog open/load/create 94 catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 95 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 96 96 catalog.filename = skylist[0].filename[i]; 97 catalog.catformat = dvo_catalog_format (CATFORMAT); // set the default catformat from config data 98 catalog.catmode = dvo_catalog_mode (CATMODE); // set the default catmode from config data 99 catalog.lockmode = LCK_XCLD; 100 dvo_catalog_open (&catalog, skylist[0].regions[i], Nsecfilt, "w"); 97 catalog.Nsecfilt = GetPhotcodeNsecfilt (); 98 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 99 if (options.update) catalog.catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF; 101 100 102 /* for only_match, skip empty catalogs XXX EAM : this leaves behind empty files */ 101 // an error exit status here is a significant error 102 if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) { 103 fprintf (stderr, "ERROR: failure to open/create catalog file %s\n", catalog.filename); 104 exit (2); 105 } 106 107 // Nave_disk == 0 implies an empty catalog file 108 // for only_match, skip empty catalogs 103 109 if ((catalog.Nave_disk == 0) && options.only_match) { 104 110 dvo_catalog_unlock (&catalog); 105 free (catalog.filename); // can this be done within the dvo_catalog_free function??106 111 dvo_catalog_free (&catalog); 107 112 continue; … … 138 143 } 139 144 140 if (Nsubset == 0) { 141 // XXX remove empty catalogs 142 unlock_catalog (&catalog); 143 } else { 145 // write out catalog, if appropriate 146 if (Nsubset && !options.only_images) { 144 147 SetProtect (TRUE); 145 if (!options.only_images) dvo_catalog_save (&catalog);148 dvo_catalog_save (&catalog, VERBOSE); 146 149 SetProtect (FALSE); 147 dvo_catalog_unlock (&catalog);148 150 } 151 dvo_catalog_unlock (&catalog); 149 152 dvo_catalog_free (&catalog); 150 free (catalog.filename); // XXX ????151 153 152 154 if (options.mode == M_REFCAT) free (stars); 153 155 } 154 156 157 // XXX is it necessary to lock the image catalog during this entire process? 155 158 if (options.calibrate) { FindCalibration (&image); } 156 159 157 160 if (db.dbstate == LCK_EMPTY) { 158 create_image_db (&db); 161 if (VERBOSE) fprintf (stderr, "can't find %s, creating a new one\n", ImageCat); 162 dvo_image_create (&db, ZeroPt); 159 163 } 160 164 … … 173 177 gettimeofday (&stop, NULL); 174 178 dtime = DTIME (stop, start); 175 fprintf (stderr, "SUCCESS: elapsed time %9.4f sec for %5d stars, %6 d average, %7d measure\n", dtime, Nstars, Naverage, Nmeasure);179 fprintf (stderr, "SUCCESS: elapsed time %9.4f sec for %5d stars, %6lld average, %7lld measure\n", dtime, Nstars, Naverage, Nmeasure); 176 180 exit (0); 177 181 } -
trunk/Ohana/src/addstar/src/wcatalog.c
r8001 r8342 5 5 /* output CATMODE and CATFORMAT are set by mkcatalog 6 6 or by mode and format of existing data */ 7 8 /* should this be moved into save_catalog?? */9 gfits_modify (&catalog[0].header, "SORTED", "%t", 1, catalog[0].sorted);10 7 11 8 /* if partial load, must use update */ … … 23 20 } 24 21 25 void free_catalog (Catalog *catalog) {26 27 /* free, initialize data structures */28 if (catalog[0].average != NULL) {29 free (catalog[0].average);30 catalog[0].Naverage = 0;31 }32 if (catalog[0].measure != NULL) {33 free (catalog[0].measure);34 catalog[0].Nmeasure = 0;35 }36 if (catalog[0].missing != NULL) {37 free (catalog[0].missing);38 catalog[0].Nmissing = 0;39 }40 if (catalog[0].secfilt != NULL) {41 free (catalog[0].secfilt);42 catalog[0].Nsecfilt = 0;43 }44 gfits_free_header (&catalog[0].header);45 } -
trunk/Ohana/src/libdvo/Makefile
r8295 r8342 37 37 $(SRC)/dvo_catalog_mef.$(ARCH).o \ 38 38 $(SRC)/dvo_catalog_split.$(ARCH).o \ 39 $(SRC)/dvo_catalog_create.$(ARCH).o \ 39 40 $(SRC)/dvo_convert.$(ARCH).o \ 40 41 $(SRC)/dvo_convert_elixir.$(ARCH).o \ -
trunk/Ohana/src/libdvo/include/dvo.h
r8328 r8342 268 268 269 269 /** dvo_catalog APIs */ 270 void dvo_catalog_init (Catalog *catalog); 271 void dvo_catalog_create (SkyRegion *region, Catalog *catalog, int Nsecfilt, char *catformat, char *catmode); 270 void dvo_catalog_init (Catalog *catalog, int complete); 271 void dvo_catalog_create (SkyRegion *region, Catalog *catalog, int Nsecfilt); 272 void dvo_catalog_free (Catalog *catalog); 273 int dvo_catalog_check (Catalog *catalog, int Nsecfilt, int extend); 272 274 int dvo_catalog_lock (Catalog *catalog, int lockmode); 273 275 int dvo_catalog_unlock (Catalog *catalog); 274 276 int dvo_catalog_load (Catalog *catalog, int VERBOSE); 277 int dvo_catalog_open (Catalog *catalog, SkyRegion *region, int VERBOSE, char *iomode); 275 278 int dvo_catalog_save (Catalog *catalog, char VERBOSE); 276 279 int dvo_catalog_update (Catalog *catalog, char VERBOSE); 280 int dvo_catalog_catformat (char *catformat); 281 int dvo_catalog_catmode (char *catmode); 277 282 278 283 /* catmode-specific APIs */ … … 333 338 int dvo_image_save_raw (FITS_DB *db, int VERBOSE); 334 339 int dvo_image_addrows (FITS_DB *db, Image *new, int Nnew); 340 void dvo_image_create (FITS_DB *db, double ZeroPoint); 335 341 336 342 int FtableToImage (FTable *ftable, Header *theader, int *format); -
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r8328 r8342 1 # include <ohana.h>2 1 # include <dvo.h> 3 2 # define DEBUG 1 4 3 5 void dvo_catalog_init (Catalog *catalog) { 6 7 catalog[0].f = NULL; 8 catalog[0].filename = NULL; 9 10 gfits_init_header (&catalog[0].header); 11 4 int dvo_catalog_catformat (char *catformat) { 5 6 /* set the specified CATFORMAT */ 7 if (!strcasecmp (catformat, "INTERNAL")) return (DVO_FORMAT_INTERNAL); 8 if (!strcasecmp (catformat, "LONEOS")) return (DVO_FORMAT_LONEOS); 9 if (!strcasecmp (catformat, "ELIXIR")) return (DVO_FORMAT_ELIXIR); 10 if (!strcasecmp (catformat, "PANSTARRS")) return (DVO_FORMAT_PANSTARRS); 11 if (!strcasecmp (catformat, "PMTEST")) return (DVO_FORMAT_PMTEST); 12 return (DVO_FORMAT_UNDEF); 13 } 14 15 int dvo_catalog_catmode (char *catmode) { 16 17 /* set the specified CATMODE */ 18 if (!strcasecmp (catmode, "RAW")) return (DVO_MODE_RAW); 19 if (!strcasecmp (catmode, "MEF")) return (DVO_MODE_MEF); 20 if (!strcasecmp (catmode, "SPLIT")) return (DVO_MODE_SPLIT); 21 return (DVO_MODE_UNDEF); 22 } 23 24 // init all data, or just catalog data 25 void dvo_catalog_init (Catalog *catalog, int complete) { 26 27 // the following are used to guide open/create/load 28 if (complete) { 29 catalog[0].f = NULL; 30 catalog[0].filename = NULL; 31 32 catalog[0].lockmode = 0; 33 catalog[0].catmode = 0; 34 catalog[0].catformat = 0; 35 catalog[0].catflags = 0; 36 catalog[0].sorted = 0; 37 38 gfits_init_header (&catalog[0].header); 39 } 40 41 // the following describe the catalog files on disk 12 42 catalog[0].average = NULL; 13 43 catalog[0].measure = NULL; … … 30 60 catalog[0].secfilt_catalog = NULL; 31 61 32 /* extra catalog information */33 catalog[0].lockmode = 0;34 catalog[0].catmode = 0;35 catalog[0].catformat = 0;36 catalog[0].catflags = 0;37 catalog[0].sorted = 0;38 39 62 /* pointers for data manipulation */ 40 63 catalog[0].found = NULL; … … 71 94 int dvo_catalog_unlock (Catalog *catalog) { 72 95 73 int dbstate; 96 int fd, dbstate; 97 struct stat filestat; 74 98 75 99 if (catalog[0].f == (FILE *) NULL) return (2); 76 100 // fprintf (stderr, "unlocking: %s\n", catalog[0].filename); 101 102 // attempt to unlink an empty file 103 fd = fileno (catalog[0].f); 104 if (fstat (fd, &filestat)) { 105 if (filestat.st_size == 0) { 106 unlink (catalog[0].filename); 107 } 108 } 109 77 110 fclearlockfile (catalog[0].filename, catalog[0].f, catalog[0].lockmode, &dbstate); 78 111 … … 85 118 } 86 119 87 int dvo_catalog_open (Catalog *catalog, int NSECFILT, int VERBOSE, int MODE) { 88 120 // open an existing catalog file or or create a new one as needed (iomode == "w") 121 // returns FALSE if a catalog could not be opened 122 // returns TRUE if the catalog was empty 123 int dvo_catalog_open (Catalog *catalog, SkyRegion *region, int VERBOSE, char *iomode) { 124 125 int Nsecfilt; 126 int readonly; 127 128 readonly = -1; 129 if (!strcasecmp (iomode, "r")) readonly = TRUE; 130 if (!strcasecmp (iomode, "w")) readonly = FALSE; 131 if (readonly == -1) return (FALSE); 132 133 catalog[0].lockmode = LCK_XCLD; 134 if (readonly) catalog[0].lockmode = LCK_SOFT; 135 136 // XXX make a backup? always? 89 137 if (!check_file_access (catalog[0].filename, TRUE, VERBOSE)) { 90 if (VERBOSE) fprintf (stderr, "no permission to access % f\n", catalog[0].filename);138 if (VERBOSE) fprintf (stderr, "no permission to access %s\n", catalog[0].filename); 91 139 return (FALSE); 92 140 } … … 94 142 if (VERBOSE) fprintf (stderr, "adding to %s\n", catalog[0].filename); 95 143 144 // save the expected Nsecfilt value for testing 145 Nsecfilt = catalog[0].Nsecfilt; 146 96 147 switch (dvo_catalog_lock (catalog, catalog[0].lockmode)) { 97 148 case 0: … … 110 161 break; 111 162 case 2: 112 if ( MODE == DVO_READ_ONLY) return (FALSE);113 dvo_catalog_create (region, catalog, N SECFILT); /* fills in new header info */163 if (readonly) return (TRUE); 164 dvo_catalog_create (region, catalog, Nsecfilt); /* fills in new header info */ 114 165 if (VERBOSE) fprintf (stderr, "creating new file %s\n", catalog[0].filename); 115 166 break; … … 118 169 } 119 170 171 // load an existing dvo_catalog currenly, the catmode information is carried per 172 // catalog. the user-set value of catmode will set the output mode for new 173 // tables an old table will keep its mode. 120 174 int dvo_catalog_load (Catalog *catalog, int VERBOSE) { 121 175 122 int Naxis, split ;176 int Naxis, split, status; 123 177 char measure[80]; 124 178 125 /** we will have to check catmode for MYSQL before reading from the file **/ 126 127 gfits_fread_header (catalog[0].f, &catalog[0].header); 179 // load the main catalog header, determine characteristics 180 if (!gfits_fread_header (catalog[0].f, &catalog[0].header)) { 181 if (VERBOSE) fprintf (stderr, "failure to read main catalog header\n"); 182 return (FALSE); 183 } 184 // check if the table has been sorted or not 185 status = gfits_scan (&catalog[0].header, "SORTED", "%t", 1, &catalog[0].sorted); 186 if (!status) catalog[0].sorted = TRUE; 187 188 // determine catmode 128 189 if (!gfits_scan (&catalog[0].header, "NAXIS", "%d", 1, &Naxis)) { 129 190 if (VERBOSE) fprintf (stderr, "can't determine catalog db mode\n"); 130 191 return (FALSE); 131 192 } 193 catalog[0].catmode = DVO_MODE_MEF; 132 194 split = gfits_scan (&catalog[0].header, "MEASURE", "%s", 1, measure); 133 134 /* currenly, the catmode information is carried per table.135 the user-set value of catmode will set the output mode for new tables136 an old table will keep its mode137 */138 139 /* check if the table has been sorted or not */140 status = gfits_scan (&catalog[0].header, "SORTED", "%t", 1, &catalog[0].sorted);141 if (!status) catalog[0].sorted = TRUE;142 143 catalog[0].catmode = DVO_MODE_MEF;144 catalog[0].catformat = DVO_FORMAT_UNDEF;145 195 if (split) catalog[0].catmode = DVO_MODE_SPLIT; 146 196 if (Naxis == 2) catalog[0].catmode = DVO_MODE_RAW; 147 197 /* don't use Naxis == 2 and split mode! */ 198 199 // catformat determined in dvo_catalog_load_XXX function 200 catalog[0].catformat = DVO_FORMAT_UNDEF; 148 201 149 202 catalog[0].average = NULL; … … 172 225 } 173 226 227 // write out the data, unlink if empty? 174 228 int dvo_catalog_save (Catalog *catalog, char VERBOSE) { 229 230 // set the 'sorted' header keyword 231 gfits_modify (&catalog[0].header, "SORTED", "%t", 1, catalog[0].sorted); 232 233 if (catalog[0].Nmeas_off != 0) { 234 if (!dvo_catalog_update (catalog, VERBOSE)) { 235 return (FALSE); 236 } 237 return (TRUE); 238 } 175 239 176 240 switch (catalog[0].catmode) { … … 210 274 break; 211 275 default: 276 fprintf (stderr, "failure updating catalog\n"); 212 277 fprintf (stderr, "invalid catalog mode\n"); 213 278 exit (2); … … 222 287 223 288 if (catalog[0].Nsecfilt == Nsecfilt) return (TRUE); 224 225 289 if (catalog[0].Nsecfilt > Nsecfilt) return (FALSE); 226 227 290 if ((catalog[0].Nsecfilt < Nsecfilt) && !extend) return (FALSE); 228 291 229 292 if ((catalog[0].Nsecfilt < Nsecfilt) && extend) { 230 231 293 Nextra = Nsecfilt - catalog[0].Nsecfilt; 232 294 insec = catalog[0].secfilt; … … 251 313 } 252 314 315 void dvo_catalog_free (Catalog *catalog) { 316 317 /* free, initialize data structures */ 318 if (catalog[0].average != NULL) { 319 free (catalog[0].average); 320 catalog[0].Naverage = 0; 321 } 322 if (catalog[0].measure != NULL) { 323 free (catalog[0].measure); 324 catalog[0].Nmeasure = 0; 325 } 326 if (catalog[0].missing != NULL) { 327 free (catalog[0].missing); 328 catalog[0].Nmissing = 0; 329 } 330 if (catalog[0].secfilt != NULL) { 331 free (catalog[0].secfilt); 332 catalog[0].Nsecfilt = 0; 333 } 334 gfits_free_header (&catalog[0].header); 335 // free (catalog[0].filename); 336 } 337 253 338 /* 254 339 mode : items to read (LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF) -
trunk/Ohana/src/libdvo/src/dvo_catalog_create.c
r8328 r8342 1 # include <ohana.h>2 1 # include <dvo.h> 3 2 # define DEBUG 1 4 3 5 4 // create a new dvo catalog file (if split, lock extra files as well?) 6 void dvo_catalog_create (SkyRegion *region, Catalog *catalog, int Nsecfilt, char *catformat, char *catmode) { 5 // catalog internals which must be set: 6 // catalog[0].filename 7 // catalog[0].catmode 8 // catalog[0].catformat (used by dvo_catalog_save) 9 // catalog[0].lockmode 10 void dvo_catalog_create (SkyRegion *region, Catalog *catalog, int Nsecfilt) { 7 11 8 int length , status;12 int length; 9 13 char *path, *root, *file, *line; 10 14 time_t now; … … 12 16 if (DEBUG) fprintf (stderr, "new catalog file: %s\n", catalog[0].filename); 13 17 14 dvo_catalog_init (catalog); 15 16 /* set the recommended CATFORMAT */ 17 catalog[0].catformat = DVO_FORMAT_UNDEF; 18 if (!strcasecmp (catformat, "INTERNAL")) catalog[0].catformat = DVO_FORMAT_INTERNAL; 19 if (!strcasecmp (catformat, "LONEOS")) catalog[0].catformat = DVO_FORMAT_LONEOS; 20 if (!strcasecmp (catformat, "ELIXIR")) catalog[0].catformat = DVO_FORMAT_ELIXIR; 21 if (!strcasecmp (catformat, "PANSTARRS")) catalog[0].catformat = DVO_FORMAT_PANSTARRS; 22 if (!strcasecmp (catformat, "PMTEST")) catalog[0].catformat = DVO_FORMAT_PMTEST; 23 if (catalog[0].catformat == DVO_FORMAT_UNDEF) { 24 fprintf (stderr, "invalid output catalog format\n"); 25 exit (1); 26 } 27 28 /* set the recommended CATMODE */ 29 catalog[0].catmode = DVO_MODE_UNDEF; 30 if (!strcasecmp (catmode, "RAW")) catalog[0].catmode = DVO_MODE_RAW; 31 if (!strcasecmp (catmode, "MEF")) catalog[0].catmode = DVO_MODE_MEF; 32 if (!strcasecmp (catmode, "SPLIT")) catalog[0].catmode = DVO_MODE_SPLIT; 33 if (catalog[0].catmode == DVO_MODE_UNDEF) { 34 fprintf (stderr, "invalid output catalog mode\n"); 35 exit (1); 36 } 18 // init the data values, not the internals listed above 19 dvo_catalog_init (catalog, FALSE); 37 20 38 21 /* for RAW mode, make header a fake image */ … … 52 35 /* define measure catalog file */ 53 36 ALLOCATE (catalog[0].measure_catalog, Catalog, 1); 54 dvo_catalog_init (catalog[0].measure_catalog );37 dvo_catalog_init (catalog[0].measure_catalog, TRUE); 55 38 56 39 /* create basic data for measure catalog file */ … … 64 47 /* define missing catalog file */ 65 48 ALLOCATE (catalog[0].missing_catalog, Catalog, 1); 66 dvo_catalog_init (catalog[0].missing_catalog );49 dvo_catalog_init (catalog[0].missing_catalog, TRUE); 67 50 68 51 /* create basic data for missing catalog file */ … … 76 59 /* define secfilt catalog file */ 77 60 ALLOCATE (catalog[0].secfilt_catalog, Catalog, 1); 78 dvo_catalog_init (catalog[0].secfilt_catalog );61 dvo_catalog_init (catalog[0].secfilt_catalog, TRUE); 79 62 80 63 /* create basic data for secfilt catalog file */ … … 90 73 // lock the additional split files 91 74 // XXX clear residual locks if we fail 92 if ( lock_catalog(catalog[0].measure_catalog, catalog[0].lockmode) != 2) {75 if (dvo_catalog_lock (catalog[0].measure_catalog, catalog[0].lockmode) != 2) { 93 76 fprintf (stderr, "error with file lock\n"); 94 77 exit (2); 95 78 } 96 if ( lock_catalog(catalog[0].missing_catalog, catalog[0].lockmode) != 2) {79 if (dvo_catalog_lock (catalog[0].missing_catalog, catalog[0].lockmode) != 2) { 97 80 fprintf (stderr, "error with file lock\n"); 98 81 exit (2); 99 82 } 100 if ( lock_catalog(catalog[0].secfilt_catalog, catalog[0].lockmode) != 2) {83 if (dvo_catalog_lock (catalog[0].secfilt_catalog, catalog[0].lockmode) != 2) { 101 84 fprintf (stderr, "error with file lock\n"); 102 85 exit (2); -
trunk/Ohana/src/libdvo/src/dvo_catalog_split.c
r8328 r8342 78 78 79 79 /* lock & open catalog file */ 80 if ( lock_catalog(measure, catalog[0].lockmode) != 1) {80 if (dvo_catalog_lock (measure, catalog[0].lockmode) != 1) { 81 81 fprintf (stderr, "cannot access measure file %s\n", measure[0].filename); 82 82 exit (2); … … 123 123 124 124 /* lock & open catalog file */ 125 if ( lock_catalog(measure, catalog[0].lockmode) != 1) {125 if (dvo_catalog_lock (measure, catalog[0].lockmode) != 1) { 126 126 fprintf (stderr, "cannot access measure file %s\n", measure[0].filename); 127 127 exit (2); … … 158 158 159 159 /* lock & open catalog file */ 160 if ( lock_catalog(missing, catalog[0].lockmode) != 1) {160 if (dvo_catalog_lock (missing, catalog[0].lockmode) != 1) { 161 161 fprintf (stderr, "cannot access missing file %s\n", missing[0].filename); 162 162 exit (2); … … 208 208 209 209 /* lock & open catalog file */ 210 if ( lock_catalog(secfilt, catalog[0].lockmode) != 1) {210 if (dvo_catalog_lock (secfilt, catalog[0].lockmode) != 1) { 211 211 fprintf (stderr, "cannot access secfilt file %s\n", secfilt[0].filename); 212 212 exit (2); -
trunk/Ohana/src/libdvo/src/dvo_image.c
r7080 r8342 148 148 return (TRUE); 149 149 } 150 151 void dvo_image_create (FITS_DB *db, double ZeroPoint) { 152 153 /* create new header */ 154 gfits_init_header (&db[0].header); 155 156 /* check the mode */ 157 switch (db[0].mode) { 158 case DVO_MODE_RAW: 159 /* make header a fake image */ 160 db[0].header.bitpix = 16; 161 db[0].header.Naxes = 2; 162 db[0].header.Naxis[0] = 1; 163 db[0].header.Naxis[1] = 1; 164 gfits_create_header (&db[0].header); 165 break; 166 case DVO_MODE_MEF: 167 case DVO_MODE_SPLIT: 168 db[0].header.extend = TRUE; 169 gfits_create_header (&db[0].header); 170 db[0].mode = DVO_MODE_MEF; 171 break; 172 default: 173 fprintf (stderr, "invalid output catalog mode\n"); 174 exit (1); 175 } 176 177 /* check the format */ 178 if (db[0].format == DVO_FORMAT_UNDEF) { 179 fprintf (stderr, "invalid output catalog format\n"); 180 exit (1); 181 } 182 183 gfits_create_matrix (&db[0].header, &db[0].matrix); 184 gfits_table_set_Image (&db[0].ftable, NULL, 0); 185 186 gfits_modify (&db[0].header, "NIMAGES", "%d", 1, 0); 187 gfits_modify (&db[0].header, "ZERO_PT", "%lf", 1, ZeroPoint); 188 189 if (db[0].format == DVO_FORMAT_INTERNAL) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "INTERNAL"); 190 if (db[0].format == DVO_FORMAT_LONEOS) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "LONEOS"); 191 if (db[0].format == DVO_FORMAT_ELIXIR) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "ELIXIR"); 192 if (db[0].format == DVO_FORMAT_PANSTARRS) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PANSTARRS"); 193 if (db[0].format == DVO_FORMAT_PMTEST) gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PMTEST"); 194 195 return; 196 } -
trunk/Ohana/src/libdvo/src/skyregion_gsc.c
r8328 r8342 41 41 42 42 int i, j, skipLines, Nzones; 43 char temp[80], name[80];44 43 45 44 Header theader; 46 45 FTable ftable; 47 46 SkyTable *skytable; 48 SkyRegion *regions;49 47 SkyTable *band; 50 48 SkyTable L0, L1, L2, L3, L4; … … 202 200 void SkyTableSort (SkyTable *table) { 203 201 204 int i, j, k,l, ir, N;202 int i, j, l, ir, N; 205 203 SkyRegion *regions; 206 204 SkyRegion tempregion; … … 251 249 252 250 float Dmin, Dmax, dDec; 253 int i, Nz, NZ, N div, Nregions;251 int i, Nz, NZ, Nregions; 254 252 SkyRegion *regions; 255 253 SkyRegionZone *zones;
Note:
See TracChangeset
for help on using the changeset viewer.
