Changeset 5445
- Timestamp:
- Oct 24, 2005, 8:47:45 PM (21 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 19 edited
-
addstar/Makefile (modified) (3 diffs)
-
addstar/doc/notes.txt (modified) (1 diff)
-
addstar/include/addstar.h (modified) (6 diffs)
-
addstar/src/ConfigInit.c (modified) (1 diff)
-
addstar/src/NewRefcat.c (modified) (2 diffs)
-
addstar/src/SkyRegionUtils.c (modified) (3 diffs)
-
addstar/src/UpdateDatabase_Image.c (modified) (4 diffs)
-
addstar/src/UpdateDatabase_Refcat.c (modified) (3 diffs)
-
addstar/src/UpdateDatabase_Reflist.c (modified) (4 diffs)
-
addstar/src/addstar.c (modified) (6 diffs)
-
addstar/src/addstarc.c (modified) (1 diff)
-
addstar/src/addstard.c (modified) (1 diff)
-
addstar/src/args_client.c (modified) (1 diff)
-
addstar/src/args_server.c (modified) (1 diff)
-
addstar/src/getgsc.c (modified) (1 diff)
-
addstar/src/load_pt_catalog.c (modified) (1 diff)
-
addstar/src/mkcatalog.c (modified) (1 diff)
-
libautocode/def/SkyRegion.d (modified) (2 diffs)
-
libdvo/src/skyregion_io.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/Makefile
r5443 r5445 18 18 INCS = -I$(INC) -I$(LINC) -I$(XINC) 19 19 LIBS = -L$(LLIB) -ldvo -lFITS -lohana -lz -lm 20 CFLAGS = $(INCS) -g 20 CFLAGS = $(INCS) -g -Wall -Werror 21 21 LFLAGS = $(LIBS) 22 22 … … 110 110 $(SRC)/gcatalog.$(ARCH).o \ 111 111 $(SRC)/gimages.$(ARCH).o \ 112 $(SRC)/gregion_image.$(ARCH).o \113 $(SRC)/gregion_match.$(ARCH).o \114 $(SRC)/gregion_patch.$(ARCH).o \115 $(SRC)/gregion_star.$(ARCH).o \116 112 $(SRC)/image-db.$(ARCH).o \ 117 113 $(SRC)/in_image.$(ARCH).o \ … … 119 115 $(SRC)/load_subpix.$(ARCH).o \ 120 116 $(SRC)/mkcatalog.$(ARCH).o \ 121 $(SRC)/RegionOps.$(ARCH).o \122 117 $(SRC)/replace_match.$(ARCH).o \ 123 118 $(SRC)/SetSignals.$(ARCH).o \ 119 $(SRC)/SkyRegionUtils.$(ARCH).o \ 120 $(SRC)/SkyListForStars.$(ARCH).o \ 124 121 $(SRC)/sort_lists.$(ARCH).o \ 125 122 $(SRC)/update_coords.$(ARCH).o \ -
trunk/Ohana/src/addstar/doc/notes.txt
r5439 r5445 1 2 2005.10.24 3 4 I have changed addstar to use the new, more flexible, SkyRegion 5 concept to define the sky layout rather than just the GSCRegion 6 files. This includes the ability to subdivide the existing 7 GSCRegion concept, and to have a more flexible sky table 8 arrangement. 9 10 Names of catalog files are a bit tricky. The SkyRegion functions 11 return base names without fullpath or extensions (ie, n0000/0012). 12 There are a few places in addstar which need the fullname: 13 14 SkyListExitingSubset () requires the path and adds .cpt 15 16 load_pt_catalog () takes the path and adds .cpt. it also allocates 17 a filename entry for catalog, which is freed later in the loop in 18 addstars 19 20 mkcatalog uses the name in the catalog structure and replaces .cpt 21 with .cpm, .cpn, .cps as needed. 22 23 1 24 2 25 todo: -
trunk/Ohana/src/addstar/include/addstar.h
r5443 r5445 39 39 char HOSTNAME[80]; 40 40 int NVALID, *VALID_IP; 41 char SKY_TABLE[256]; 41 42 int SKY_DEPTH; /** XXX EAM : depth of catalog tables, fix usage */ 43 SkyTable *ServerSky; 42 44 43 45 /* used to select entries from header (gstars or parse_time) (KEEP) */ … … 71 73 int VERBOSE; 72 74 73 /* modify server behav oir (make this an addstar cleanup mode?) */75 /* modify server behavior (make this an addstar cleanup mode?) */ 74 76 int FORCE_READ; 75 77 … … 115 117 void help PROTO(()); 116 118 int in_image PROTO((double r, double d, Image *image)); 117 int load_pt_catalog PROTO((Catalog *catalog, SkyRegion *region )); /*** choose new name ***/119 int load_pt_catalog PROTO((Catalog *catalog, SkyRegion *region, char *path)); /*** choose new name ***/ 118 120 void load_subpix PROTO(()); 119 121 void lock_image_db PROTO((FITS_DB *db, char *filename)); … … 132 134 time_t short_date_to_sec PROTO((char *date)); 133 135 void sort_lists PROTO((float *X, float *Y, int *S, int N)); 134 void sort_regions PROTO((GSCRegion *region, int N));135 136 void sort_stars PROTO((Stars *stars, int N)); 136 137 int str_to_radec PROTO((double *ra, double *dec, char *str1, char *str2)); … … 154 155 Missing *sort_missing (Average *average, int Naverage, Missing *missing, int Nmissing, int *next_miss); 155 156 157 /* functions which use GSCRegion, now deprecated */ 158 void sort_regions PROTO((GSCRegion *region, int N)); 156 159 GSCRegion *LoadRegions PROTO((int *nregions)); 157 160 int FindDecBand PROTO((double dec, double *DEC0, double *DEC1)); … … 193 196 int UpdateDatabase_Image (AddstarClientOptions *options, Image *image, Coords *mosaic, Stars *stars, int Nstars); 194 197 int UpdateDatabase_Reflist (AddstarClientOptions *options, Stars *stars, int Nstars); 195 int UpdateDatabase_Refcat (AddstarClientOptions *options, GSCRegion *UserPatch, char *refcat);198 int UpdateDatabase_Refcat (AddstarClientOptions *options, SkyRegion *UserPatch, char *refcat); 196 199 197 200 SkyList *SkyListForStars (SkyTable *table, int depth, Stars *stars, int Nstars); 198 SkyList *SkyListExistingSubset (SkyList *input );201 SkyList *SkyListExistingSubset (SkyList *input, char *path); 199 202 int SkyListSetPath (SkyList *list, char *path); 203 SkyTable *SkyTableLoadOptimal (); -
trunk/Ohana/src/addstar/src/ConfigInit.c
r5443 r5445 58 58 if (!ScanConfig (config, "SKY_DEPTH", "%d", 0, &SKY_DEPTH)) { 59 59 SKY_DEPTH = 2; 60 } 61 if (!ScanConfig (config, "SKY_TABLE", "%s", 0, SKY_TABLE)) { 62 SKY_TABLE[0] = 0; 60 63 } 61 64 -
trunk/Ohana/src/addstar/src/NewRefcat.c
r5348 r5445 6 6 AddstarClientOptions *options; 7 7 IOBuffer message; 8 GSCRegion *patch;8 SkyRegion *patch; 9 9 10 10 /* accept incoming data set */ … … 18 18 } 19 19 20 if (!Recv_ GSCRegion (BindSocket, &patch, &N)) {20 if (!Recv_SkyRegion (BindSocket, &patch, &N)) { 21 21 fprintf (stderr, "error: problem receiving patch\n"); 22 22 goto reject; -
trunk/Ohana/src/addstar/src/SkyRegionUtils.c
r5443 r5445 1 1 # include "addstar.h" 2 2 3 SkyList *SkyListExistingSubset (SkyList *input ) {3 SkyList *SkyListExistingSubset (SkyList *input, char *path) { 4 4 5 5 int i, status, Nsubset, NSUBSET; 6 char filename[256]; 6 7 SkyList *subset; 7 8 struct stat filestats; … … 14 15 /* match the basename against the GSCRegion file names */ 15 16 for (i = 0; i < input[0].Nregions; i++) { 16 status = stat (input[0].regions[i][0].name, &filestats); 17 sprintf (filename, "%s/%s.cpt", path, input[0].regions[i][0].name); 18 status = stat (filename, &filestats); 17 19 if ((status == -1) && (errno == ENOENT)) continue; 18 20 /* give an error for other conditions? */ … … 41 43 return (TRUE); 42 44 } 45 46 int SkyTableSetDepth (SkyTable *sky, int depth) { 47 48 int i; 49 50 for (i = 0; i < sky[0].Nregions; i++) { 51 sky[0].regions[i].table = (sky[0].regions[i].depth == depth); 52 } 53 return (TRUE); 54 } 55 56 SkyTable *SkyTableLoadOptimal () { 57 58 char filename[256]; 59 struct stat filestat; 60 SkyTable *sky; 61 int status; 62 63 /* first option: CATDIR/SkyTable.fits */ 64 sprintf (filename, "%s/SkyTable.fits", CATDIR); 65 check_permissions (filename); 66 67 /* check for file existance */ 68 status = stat (filename, &filestat); 69 if (status == 0) { /* file exists, are permissions OK? */ 70 sky = SkyTableLoad (filename, VERBOSE); 71 if (sky == NULL) { 72 fprintf (stderr, "error loading sky table\n"); 73 exit (1); 74 } 75 return (sky); 76 } 77 78 /* first option: SKY_TABLE */ 79 if (SKY_TABLE[0]) { 80 status = stat (SKY_TABLE, &filestat); 81 if (status == 0) { /* file exists, are permissions OK? */ 82 sky = SkyTableLoad (SKY_TABLE, VERBOSE); 83 if (sky == NULL) { 84 fprintf (stderr, "error loading sky table\n"); 85 exit (1); 86 } 87 SkyTableSetDepth (sky, SKY_DEPTH); 88 89 /* write CATDIR copy */ 90 sprintf (filename, "%s/SkyTable.fits", CATDIR); 91 check_permissions (filename); 92 SkyTableSave (sky, filename); 93 fits_convert_SkyRegion (sky[0].regions, sizeof (SkyTable), sky[0].Nregions); 94 return (sky); 95 } 96 } 97 98 sky = SkyTableFromGSC (GSCFILE, SKY_DEPTH, VERBOSE); 99 if (sky == NULL) { 100 fprintf (stderr, "error loading sky table\n"); 101 exit (1); 102 } 103 104 /* write CATDIR copy */ 105 sprintf (filename, "%s/SkyTable.fits", CATDIR); 106 check_permissions (filename); 107 SkyTableSave (sky, filename); 108 fits_convert_SkyRegion (sky[0].regions, sizeof (SkyRegion), sky[0].Nregions); 109 110 return (sky); 111 } -
trunk/Ohana/src/addstar/src/UpdateDatabase_Image.c
r5348 r5445 3 3 int UpdateDatabase_Image (AddstarClientOptions *options, Image *image, Coords *mosaic, Stars *stars, int Nstars) { 4 4 5 int i, Noverlap , Nregions;5 int i, Noverlap; 6 6 Image *overlap; 7 7 Catalog catalog; 8 GSCRegion *regions; 8 SkyList *skylist; 9 10 /* this should be loaded by addstard on start -- keep static? */ 11 /* need to load the correct sky table (GSC default or local verison) */ 12 // sky = SkyTableFromGSC (GSCFILE, SKY_DEPTH, VERBOSE); 9 13 10 14 if (options[0].update) { … … 14 18 } 15 19 16 regions = NULL;17 18 20 if (options[0].mode != M_IMAGE) { 19 21 fprintf (stderr, "error: expecting only IMAGE mode\n"); … … 42 44 43 45 /* find correpsonding regions for image */ 44 regions = gregion_image (image, mosaic, &Nregions);46 skylist = SkyListByImage (ServerSky, -1, image, mosaic); 45 47 46 48 /* reduce regions to existing subset, if necessary */ 49 SkyListSetPath (skylist, CATDIR); 47 50 if (options[0].only_match || options[0].existing_regions) { 48 regions = gregion_match (regions, &Nregions); 51 SkyList *tmp; 52 tmp = SkyListExistingSubset (skylist); 53 SkyListFree (skylist); 54 skylist = tmp; 49 55 } 50 if (VERBOSE) fprintf (stderr, "writing to %d regions\n", Nregions);56 if (VERBOSE) fprintf (stderr, "writing to %d regions\n", skylist[0].Nregions); 51 57 52 for (i = 0; i < Nregions; i++) {58 for (i = 0; i < skylist[0].Nregions; i++) { 53 59 54 load_pt_catalog (&catalog, ®ions[i]);60 load_pt_catalog (&catalog, skylist[0].regions[i]); 55 61 56 62 /* for only_match, skip empty catalogs XXX EAM : this leaves behind empty files */ … … 61 67 62 68 if (options[0].closest) { 63 find_matches_closest ( ®ions[i], stars, Nstars, &catalog, image, overlap, Noverlap, mosaic, options[0]);69 find_matches_closest (skylist[0].regions[i], stars, Nstars, &catalog, image, overlap, Noverlap, mosaic, options[0]); 64 70 } else { 65 find_matches ( ®ions[i], stars, Nstars, &catalog, image, overlap, Noverlap, mosaic, options[0]);71 find_matches (skylist[0].regions[i], stars, Nstars, &catalog, image, overlap, Noverlap, mosaic, options[0]); 66 72 } 67 73 -
trunk/Ohana/src/addstar/src/UpdateDatabase_Refcat.c
r5348 r5445 1 1 # include "addstar.h" 2 2 3 int UpdateDatabase_Refcat (AddstarClientOptions *options, GSCRegion *patch, char *refcat) {3 int UpdateDatabase_Refcat (AddstarClientOptions *options, SkyRegion *patch, char *refcat) { 4 4 5 int i, Nstars, Nsubset , Nregions;5 int i, Nstars, Nsubset; 6 6 Catalog catalog; 7 GSCRegion *regions;8 7 Stars *stars, **subset; 8 // SkyTable *sky; 9 SkyList *skylist; 10 11 /* this should be loaded by addstard on start -- keep static? */ 12 /* need to load the correct sky table (GSC default or local verison) */ 13 /* XXX EAM : check on memory usage */ 14 // sky = SkyTableFromGSC (GSCFILE, SKY_DEPTH, VERBOSE); 9 15 10 16 if (options[0].update) { … … 39 45 40 46 /* find correpsonding regions for image */ 41 regions = gregion_patch (patch, &Nregions);47 skylist = SkyListByPatch (ServerSky, -1, patch); 42 48 43 49 /* reduce regions to existing subset, if necessary */ 50 SkyListSetPath (skylist, CATDIR); 44 51 if (options[0].only_match || options[0].existing_regions) { 45 regions = gregion_match (regions, &Nregions); 52 SkyList *tmp; 53 tmp = SkyListExistingSubset (skylist); 54 SkyListFree (skylist); 55 skylist = tmp; 46 56 } 47 if (VERBOSE) fprintf (stderr, "writing to %d regions\n", Nregions);57 if (VERBOSE) fprintf (stderr, "writing to %d regions\n", skylist[0].Nregions); 48 58 49 for (i = 0; i < Nregions; i++) {59 for (i = 0; i < skylist[0].Nregions; i++) { 50 60 51 load_pt_catalog (&catalog, ®ions[i]);61 load_pt_catalog (&catalog, skylist[0].regions[i]); 52 62 53 63 /* for only_match, skip empty catalogs XXX EAM : this leaves behind empty files */ … … 58 68 59 69 /* load stars from corresponding catalog */ 60 stars = grefcat (refcat, ®ions[i], options[0].photcode, &Nstars);70 stars = grefcat (refcat, skylist[0].regions[i], options[0].photcode, &Nstars); 61 71 62 subset = find_subset ( ®ions[i], stars, Nstars, &Nsubset);63 find_matches_refstars ( ®ions[i], subset, Nsubset, &catalog, options[0]);72 subset = find_subset (skylist[0].regions[i], stars, Nstars, &Nsubset); 73 find_matches_refstars (skylist[0].regions[i], subset, Nsubset, &catalog, options[0]); 64 74 if (Nsubset) free (subset); 65 75 -
trunk/Ohana/src/addstar/src/UpdateDatabase_Reflist.c
r5348 r5445 3 3 int UpdateDatabase_Reflist (AddstarClientOptions *options, Stars *stars, int Nstars) { 4 4 5 int i, Nsubset , Nregions;5 int i, Nsubset; 6 6 Catalog catalog; 7 GSCRegion *regions;8 7 Stars **subset; 8 SkyList *skylist; 9 10 /* this should be loaded by addstard on start -- keep static? */ 11 /* need to load the correct sky table (GSC default or local verison) */ 12 // sky = SkyTableFromGSC (GSCFILE, SKY_DEPTH, VERBOSE); 9 13 10 14 if (options[0].update) { … … 19 23 } 20 24 21 /* check on directory, create if needed */25 /* check on directory, create if needed XXX : move to utils */ 22 26 { 23 27 int status, cmode; … … 39 43 40 44 /* find correpsonding regions for image */ 41 regions = gregion_stars (stars, Nstars, &Nregions);45 skylist = SkyListForStars (ServerSky, -1, stars, Nstars); 42 46 43 47 /* reduce regions to existing subset, if necessary */ 48 SkyListSetPath (skylist, CATDIR); 44 49 if (options[0].only_match || options[0].existing_regions) { 45 regions = gregion_match (regions, &Nregions); 50 SkyList *tmp; 51 tmp = SkyListExistingSubset (skylist); 52 SkyListFree (skylist); 53 skylist = tmp; 46 54 } 47 if (VERBOSE) fprintf (stderr, "writing to %d regions\n", Nregions);55 if (VERBOSE) fprintf (stderr, "writing to %d regions\n", skylist[0].Nregions); 48 56 49 for (i = 0; i < Nregions; i++) {57 for (i = 0; i < skylist[0].Nregions; i++) { 50 58 51 load_pt_catalog (&catalog, ®ions[i]);59 load_pt_catalog (&catalog, skylist[0].regions[i]); 52 60 53 61 /* for only_match, skip empty catalogs XXX EAM : this leaves behind empty files */ … … 57 65 } 58 66 59 subset = find_subset ( ®ions[i], stars, Nstars, &Nsubset);60 find_matches_refstars ( ®ions[i], subset, Nsubset, &catalog, options[0]);67 subset = find_subset (skylist[0].regions[i], stars, Nstars, &Nsubset); 68 find_matches_refstars (skylist[0].regions[i], subset, Nsubset, &catalog, options[0]); 61 69 if (Nsubset) free (subset); 62 70 -
trunk/Ohana/src/addstar/src/addstar.c
r5443 r5445 4 4 5 5 int Nm, Na, Ns; 6 int i, Nstars, Noverlap, N regions, Nsubset, Naverage, Nmeasure;6 int i, Nstars, Noverlap, Nsubset, Naverage, Nmeasure; 7 7 Stars *stars, **subset; 8 8 Image image, *overlap; … … 13 13 SkyTable *sky; 14 14 SkyList *skylist; 15 SkyRegion *regions;16 15 17 16 double dtime; … … 24 23 options = args (argc, argv, options); 25 24 26 sky = SkyTable FromGSC (GSCFILE, SKY_DEPTH, VERBOSE);27 25 sky = SkyTableLoadOptimal (); 26 28 27 stars = NULL; 29 28 overlap = NULL; 30 regions = NULL;31 29 set_db (&db); 32 30 if (options.update) { … … 57 55 break; 58 56 } 59 SkyListSetPath (skylist, CATDIR);60 57 if (options.only_match || options.existing_regions) { 61 58 SkyList *tmp; 62 tmp = SkyListExistingSubset (skylist );59 tmp = SkyListExistingSubset (skylist, CATDIR); 63 60 SkyListFree (skylist); 64 61 skylist = tmp; … … 75 72 gettimeofday (&t1, NULL); 76 73 77 load_pt_catalog (&catalog, skylist[0].regions[i] );74 load_pt_catalog (&catalog, skylist[0].regions[i], CATDIR); 78 75 79 76 /* for only_match, skip empty catalogs XXX EAM : this leaves behind empty files */ 80 77 if ((catalog.Nave_disk == 0) && options.only_match) { 81 78 unlock_catalog (&catalog); 79 free (catalog.filename); 82 80 continue; 83 81 } … … 128 126 unlock_catalog (&catalog); 129 127 } 128 free (catalog.filename); 130 129 131 130 gettimeofday (&t2, NULL); -
trunk/Ohana/src/addstar/src/addstarc.c
r5382 r5445 47 47 SendCommand (BindSocket, 5, "REFCT"); 48 48 Send_AddstarClientOptions (BindSocket, &options, 1, TRUE); 49 Send_ GSCRegion (BindSocket, &UserPatch, 1, TRUE);49 Send_SkyRegion (BindSocket, &UserPatch, 1, TRUE); 50 50 SendMessage (BindSocket, argv[1]); 51 51 break; -
trunk/Ohana/src/addstar/src/addstard.c
r5347 r5445 10 10 options = ConfigInit (&argc, argv); 11 11 args_server (argc, argv); 12 13 /* store the sky table in a global? */ 14 ServerSky = SkyTableLoadOptimal (); 12 15 13 16 /* if we separate the incoming data from db update, spawn db thread here */ -
trunk/Ohana/src/addstar/src/args_client.c
r5347 r5445 27 27 /*** provide additional data ***/ 28 28 /* restrict to a portion of the sky? (REFCAT only) */ 29 UserPatch.R A[0]= 0;30 UserPatch.R A[1]= 360;31 UserPatch.D EC[0]= -90;32 UserPatch.D EC[1]= +90;29 UserPatch.Rmin = 0; 30 UserPatch.Rmax= 360; 31 UserPatch.Dmin = -90; 32 UserPatch.Dmax = +90; 33 33 if ((N = get_argument (argc, argv, "-region"))) { 34 34 remove_argument (N, &argc, argv); 35 UserPatch.R A[0]= atof (argv[N]);36 remove_argument (N, &argc, argv); 37 UserPatch.R A[1]= atof (argv[N]);38 remove_argument (N, &argc, argv); 39 UserPatch.D EC[0]= atof (argv[N]);40 remove_argument (N, &argc, argv); 41 UserPatch.D EC[1]= atof (argv[N]);35 UserPatch.Rmin = atof (argv[N]); 36 remove_argument (N, &argc, argv); 37 UserPatch.Rmax = atof (argv[N]); 38 remove_argument (N, &argc, argv); 39 UserPatch.Dmin = atof (argv[N]); 40 remove_argument (N, &argc, argv); 41 UserPatch.Dmax = atof (argv[N]); 42 42 remove_argument (N, &argc, argv); 43 43 } -
trunk/Ohana/src/addstar/src/args_server.c
r5347 r5445 13 13 14 14 /* restrict to a portion of the sky? (REFCAT only) */ 15 UserPatch.R A[0]= 0;16 UserPatch.R A[1]= 360;17 UserPatch.D EC[0]= -90;18 UserPatch.D EC[1]= +90;15 UserPatch.Rmin = 0; 16 UserPatch.Rmax = 360; 17 UserPatch.Dmin = -90; 18 UserPatch.Dmax = +90; 19 19 if ((N = get_argument (argc, argv, "-region"))) { 20 20 remove_argument (N, &argc, argv); 21 UserPatch.R A[0]= atof (argv[N]);21 UserPatch.Rmin = atof (argv[N]); 22 22 remove_argument (N, &argc, argv); 23 UserPatch.R A[1]= atof (argv[N]);23 UserPatch.Rmax = atof (argv[N]); 24 24 remove_argument (N, &argc, argv); 25 UserPatch.D EC[0]= atof (argv[N]);25 UserPatch.Dmin = atof (argv[N]); 26 26 remove_argument (N, &argc, argv); 27 UserPatch.D EC[1]= atof (argv[N]);27 UserPatch.Dmax = atof (argv[N]); 28 28 remove_argument (N, &argc, argv); 29 29 } -
trunk/Ohana/src/addstar/src/getgsc.c
r5443 r5445 8 8 Stars *getgsc (SkyRegion *patch, int *NSTARS) { 9 9 10 int i, Ngsc, N regions, Nstars;10 int i, Ngsc, Nstars; 11 11 Stars *gsc; 12 12 Stars *stars; 13 13 SkyList *skylist; 14 14 SkyTable *sky; 15 char *tmp;16 15 17 16 NAMED_PHOTCODE (GSC_M, "GSC_M"); -
trunk/Ohana/src/addstar/src/load_pt_catalog.c
r5443 r5445 1 1 # include "addstar.h" 2 2 3 int load_pt_catalog (Catalog *catalog, SkyRegion *region ) {3 int load_pt_catalog (Catalog *catalog, SkyRegion *region, char *path) { 4 4 5 ch eck_permissions (region[0].name);5 char filename[256]; 6 6 7 /* don't free region before catalog! */ 8 catalog[0].filename = region[0].name; 9 if (VERBOSE) fprintf (stderr, "adding to %s\n", region[0].name); 7 sprintf (filename, "%s/%s.cpt", path, region[0].name); 8 9 check_permissions (filename); 10 if (VERBOSE) fprintf (stderr, "adding to %s\n", filename); 11 12 catalog[0].filename = strcreate (filename); 10 13 11 14 switch (lock_catalog (catalog, LCK_XCLD)) { -
trunk/Ohana/src/addstar/src/mkcatalog.c
r5443 r5445 7 7 time_t now; 8 8 9 if (VERBOSE) fprintf (stderr, "new catalog file: %s\n", region[0].name);9 if (VERBOSE) fprintf (stderr, "new catalog file: %s\n", catalog[0].filename); 10 10 11 11 /* set the recommended CATFORMAT */ -
trunk/Ohana/src/libautocode/def/SkyRegion.d
r5440 r5445 2 2 EXTNAME SKY_REGION 3 3 TYPE BINTABLE 4 SIZE 2924 SIZE 56 5 5 6 6 FIELD Rmin, R_MIN, float, … … 15 15 FIELD child, CHILD, char, does this entry have children? 16 16 FIELD table, TABLE, char, does this entry have a table? 17 FIELD name, NAME, char[2 57],name / filename17 FIELD name, NAME, char[21], name / filename -
trunk/Ohana/src/libdvo/src/skyregion_io.c
r5441 r5445 29 29 return (NULL); 30 30 } 31 if (!fits_fread_ftable (f, &ftable, "SKY_REGION S")) {31 if (!fits_fread_ftable (f, &ftable, "SKY_REGION")) { 32 32 if (VERBOSE) fprintf (stderr, "can't read Sky Region table\n"); 33 33 fits_free_header (&header); … … 47 47 } 48 48 49 int SkyTableSave (SkyTable * table, char *filename) {49 int SkyTableSave (SkyTable *skytable, char *filename) { 50 50 51 fprintf (stderr, "not yet defined\n"); 51 Header header; 52 Matrix matrix; 53 Header theader; 54 FTable ftable; 55 FILE *f; 52 56 57 /* make phu header (no matrix needed) */ 58 ftable.header = &theader; 59 fits_init_header (&header); 60 header.extend = TRUE; 61 fits_create_header (&header); 62 fits_create_matrix (&header, &matrix); 63 64 fits_table_set_SkyRegion (&ftable, skytable[0].regions, skytable[0].Nregions); 65 66 f = fopen (filename, "w"); 67 if (f == (FILE *) NULL) { 68 fprintf (stderr, "cannot open %s for output\n", filename); 69 exit (1); 70 } 71 72 fits_fwrite_header (f, &header); 73 fits_fwrite_matrix (f, &matrix); 74 fits_fwrite_Theader (f, &theader); 75 fits_fwrite_table (f, &ftable); 76 fclose (f); 77 78 return (TRUE); 53 79 } 54 80
Note:
See TracChangeset
for help on using the changeset viewer.
