Changeset 41429
- Timestamp:
- Oct 16, 2020, 9:49:13 AM (6 years ago)
- Location:
- trunk/Ohana/src/dvosplit
- Files:
-
- 32 added
- 5 edited
-
include/dvosplit.h (modified) (2 diffs)
-
src/ConfigInit.c (modified) (1 diff)
-
src/args.c (modified) (2 diffs)
-
src/dvosplit.c (modified) (8 diffs)
-
src/dvosplitsky.c (modified) (1 diff)
-
test (added)
-
test/.dvo (added)
-
test/catdir.example (added)
-
test/catdir.example/.dvo (added)
-
test/catdir.example/.mana (added)
-
test/catdir.example/ImageIndex.fits (added)
-
test/catdir.example/Images.dat (added)
-
test/catdir.example/Photcodes.dat (added)
-
test/catdir.example/SkyTable.fits (added)
-
test/catdir.example/gdb.script (added)
-
test/catdir.example/s2230 (added)
-
test/catdir.example/s2230/6791.01.cpm (added)
-
test/catdir.example/s2230/6791.01.cpn (added)
-
test/catdir.example/s2230/6791.01.cps (added)
-
test/catdir.example/s2230/6791.01.cpt (added)
-
test/catdir.example/s2230/6792.07.cpm (added)
-
test/catdir.example/s2230/6792.07.cpn (added)
-
test/catdir.example/s2230/6792.07.cps (added)
-
test/catdir.example/s2230/6792.07.cpt (added)
-
test/catdir.example/s2230/6805.11.cpm (added)
-
test/catdir.example/s2230/6805.11.cpn (added)
-
test/catdir.example/s2230/6805.11.cps (added)
-
test/catdir.example/s2230/6805.11.cpt (added)
-
test/catdir.example/s2230/6806.06.cpm (added)
-
test/catdir.example/s2230/6806.06.cpn (added)
-
test/catdir.example/s2230/6806.06.cps (added)
-
test/catdir.example/s2230/6806.06.cpt (added)
-
test/catdir.example/s2230/6821.10.cpm (added)
-
test/catdir.example/s2230/6821.10.cpn (added)
-
test/catdir.example/s2230/6821.10.cps (added)
-
test/catdir.example/s2230/6821.10.cpt (added)
-
test/example.sh (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/dvosplit/include/dvosplit.h
r40561 r41429 24 24 int FULL_TABLE; 25 25 int VERBOSE; 26 int SKIP_EXIST; // do not re-split existing files 26 27 char *OUTDIR; 27 28 char *CATMODE; /* raw, mef, split, mysql */ … … 42 43 int split_averages PROTO((Catalog *incatalog, SkyList *outlist, Catalog *outcatalogs)); 43 44 int split_measures PROTO((Catalog *incatalog, SkyList *outlist, Catalog *outcatalogs, AveLinks *avelinks)); 44 void GetConfig (char *config, char *field, char *format, int N, void *ptr); 45 void GetConfig PROTO((char *config, char *field, char *format, int N, void *ptr)); 46 47 void dvosplit_free PROTO((SkyTable *sky, SkyList *skylist)); -
trunk/Ohana/src/dvosplit/src/ConfigInit.c
r33656 r41429 21 21 SetZeroPoint (ZERO_POINT); 22 22 23 FreeConfigFile(); 23 24 free (config); 24 25 free (file); -
trunk/Ohana/src/dvosplit/src/args.c
r37807 r41429 71 71 } 72 72 73 /* extra error messages */ 74 SKIP_EXIST = FALSE; 75 if ((N = get_argument (argc, argv, "-skip-exist"))) { 76 SKIP_EXIST = TRUE; 77 remove_argument (N, &argc, argv); 78 } 79 73 80 if (argc == 3) { 74 81 if (CONFIRM) { … … 86 93 fprintf (stderr, "USAGE: dvosplit (catdir) (newlevel) [-outdir outdir] [-region (Rmin) (Rmax) (Dmin) (Dmax)]\n"); 87 94 exit (2); 95 } 96 97 // XXX need to free sky 98 void dvosplit_free (SkyTable *sky, SkyList *skylist) { 99 FREE (OUTDIR); 100 FREE (CATMODE); 101 FREE (CATFORMAT); 102 103 SkyTableFree (sky); 104 SkyListFree(skylist); 105 FreePhotcodeTable(); 106 107 ohana_memcheck (VERBOSE); 108 ohana_memdump (VERBOSE); 88 109 } 89 110 -
trunk/Ohana/src/dvosplit/src/dvosplit.c
r40561 r41429 1 1 # include "dvosplit.h" 2 3 void dvosplit_free_outlist (SkyList *outlist); 2 4 3 5 // dvosplit (catdir) (outlevel) [-outdir (outcat)} [-region Rmin Rmax Dmin Dmax] … … 55 57 for (i = 0; i < skylist[0].Nregions; i++) { 56 58 if (VERBOSE) fprintf (stderr, "%s\n", skylist[0].regions[i][0].name); 57 fprintf (stderr, "reading from %s\n", skylist[0].regions[i][0].name);59 // fprintf (stderr, "reading from %s\n", skylist[0].regions[i][0].name); 58 60 59 61 // if !LocalCopy, always copy the file … … 67 69 68 70 if (LocalCopy && (skylist[0].regions[i][0].depth == OUT_DEPTH)) continue; 71 72 if (SKIP_EXIST) { 73 int allFound = TRUE; 74 for (j = 0; allFound && (j < outlist[0].Nregions); j++) { 75 // check that outlist[0].filename[j] exists 76 struct stat filestat; 77 int fstatus = stat (outlist[0].filename[j], &filestat); 78 if (fstatus) allFound = FALSE; 79 } 80 if (allFound) { 81 fprintf (stderr, "skipping %s, already split\n", skylist[0].regions[i][0].name); 82 dvosplit_free_outlist (outlist); 83 continue; 84 } 85 } 69 86 70 87 // set the parameters which guide catalog open/load/create … … 85 102 dvo_catalog_unlock (&incatalog); 86 103 dvo_catalog_free (&incatalog); 104 if (SKIP_EXIST) dvosplit_free_outlist (outlist); 87 105 continue; 88 106 } 107 108 // find the list of output filenames (do not yet open) 109 // we need to check if we have already done the split 89 110 90 111 // change sky.regions[i].depth for these regions … … 104 125 105 126 dvo_catalog_unlock (&incatalog); 127 dvo_catalog_free (&incatalog); 106 128 107 129 for (j = 0; j < outlist[0].Nregions; j++) { … … 110 132 dvo_catalog_save (&outcatalogs[j], VERBOSE); 111 133 dvo_catalog_unlock (&outcatalogs[j]); 134 dvo_catalog_free (&outcatalogs[j]); 112 135 } 136 FREE (outcatalogs); 113 137 114 138 // adjust depth … … 134 158 exit (1); 135 159 } 160 free (filename); 136 161 137 162 if (!LocalCopy) { … … 146 171 } 147 172 173 free (CATDIR); 174 dvosplit_free (sky, skylist); 148 175 exit (0); 149 176 } 177 178 void dvosplit_free_outlist (SkyList *outlist) { 179 180 // free outlist & continue 181 for (int j = 0; j < outlist[0].Nregions; j++) { 182 free (outlist[0].filename[j]); 183 } 184 // free the rest of the list 185 SkyListFree (outlist); 186 return; 187 } -
trunk/Ohana/src/dvosplit/src/dvosplitsky.c
r41425 r41429 23 23 // load the sky table for the existing database 24 24 SkyTable *sky = SkyTableLoadOptimal (CATDIR, NULL, NULL, TRUE, SKY_DEPTH_HST, VERBOSE); 25 // SkyTableSetFilenames (sky, CATDIR, "cpt"); XXX probably not needed 25 if (!sky) { 26 fprintf (stderr, "ERROR: failed to read sky table from %s\n", CATDIR); 27 exit (2); 28 } 26 29 27 30 // for L4 entries in a certain ra,dec range, generate L5 entries:
Note:
See TracChangeset
for help on using the changeset viewer.
