Changeset 39359
- Timestamp:
- Feb 18, 2016, 5:36:14 PM (10 years ago)
- Location:
- trunk/Ohana/src/libdvo
- Files:
-
- 3 edited
-
include/dvo.h (modified) (1 diff)
-
src/dvo_catalog.c (modified) (2 diffs)
-
src/dvo_catalog_split.c (modified) (28 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/include/dvo.h
r39319 r39359 13 13 14 14 /* DVO table modes */ 15 typedef enum {DVO_COMPRESS_NONE = 0, DVO_COMPRESS_NONE_1, DVO_COMPRESS_NONE_2, DVO_COMPRESS_AUTO, DVO_COMPRESS_ GZIP_1, DVO_COMPRESS_GZIP_2, DVO_COMPRESS_RICE_1} DVOCatCompress; //15 typedef enum {DVO_COMPRESS_NONE = 0, DVO_COMPRESS_NONE_1, DVO_COMPRESS_NONE_2, DVO_COMPRESS_AUTO, DVO_COMPRESS_AUTO_1, DVO_COMPRESS_AUTO_2, DVO_COMPRESS_GZIP_1, DVO_COMPRESS_GZIP_2, DVO_COMPRESS_RICE_1} DVOCatCompress; // 16 16 17 17 /* DVO table formats */ -
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r39332 r39359 76 76 if (!strcasecmp (catcompress, "NONE")) return (DVO_COMPRESS_NONE); 77 77 if (!strcasecmp (catcompress, "AUTO")) return (DVO_COMPRESS_AUTO); 78 if (!strcasecmp (catcompress, "AUTO_1")) return (DVO_COMPRESS_AUTO_1); 79 if (!strcasecmp (catcompress, "AUTO_2")) return (DVO_COMPRESS_AUTO_2); 78 80 if (!strcasecmp (catcompress, "NONE_1")) return (DVO_COMPRESS_NONE_1); 79 81 if (!strcasecmp (catcompress, "NONE_2")) return (DVO_COMPRESS_NONE_2); … … 93 95 case DVO_COMPRESS_AUTO: 94 96 compress_string = strcreate("AUTO"); 97 break; 98 case DVO_COMPRESS_AUTO_1: 99 compress_string = strcreate("AUTO_1"); 100 break; 101 case DVO_COMPRESS_AUTO_2: 102 compress_string = strcreate("AUTO_2"); 95 103 break; 96 104 case DVO_COMPRESS_GZIP_1: -
trunk/Ohana/src/libdvo/src/dvo_catalog_split.c
r39327 r39359 1 1 # include <dvo.h> 2 2 # define OHANA_MEMCHECK 0 3 4 void gfits_compress_timing (); 5 void gfits_uncompress_timing (); 3 6 4 7 // return options: … … 88 91 } 89 92 90 int dvo_catalog_save_subcat (Catalog *catalog, FTable *ftable, off_t start, off_t Nrows, off_t Ndisk, off_t Ntotal ) {93 int dvo_catalog_save_subcat (Catalog *catalog, FTable *ftable, off_t start, off_t Nrows, off_t Ndisk, off_t Ntotal, int VERBOSE) { 91 94 92 95 if (OHANA_MEMCHECK) ohana_memcheck (TRUE); … … 152 155 return (FALSE); 153 156 } 157 if (VERBOSE) gfits_compress_timing (); 154 158 if (!byteswap_varlength_ftable (&cmpheader, &cmptable)) { 155 159 fprintf (stderr, "failed to swap varlength column\n"); … … 341 345 return FALSE; 342 346 } 347 if (VERBOSE) gfits_uncompress_timing (); 343 348 if (OHANA_MEMCHECK) ohana_memcheck (TRUE); 344 349 … … 929 934 if (OHANA_MEMCHECK) ohana_memcheck (TRUE); 930 935 931 if (!dvo_catalog_save_subcat (catalog, &ftable, start, Nrows, catalog[0].Naverage_disk, Naverage_disk_new )) {936 if (!dvo_catalog_save_subcat (catalog, &ftable, start, Nrows, catalog[0].Naverage_disk, Naverage_disk_new, VERBOSE)) { 932 937 fprintf (stderr, "failure writing Average table\n"); 933 938 goto failure; … … 978 983 // write out Measure table 979 984 catalog->measure_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 980 if (!dvo_catalog_save_subcat (catalog[0].measure_catalog, &ftable, start, Nrows, catalog[0].Nmeasure_disk, Nmeasure_disk_new )) {985 if (!dvo_catalog_save_subcat (catalog[0].measure_catalog, &ftable, start, Nrows, catalog[0].Nmeasure_disk, Nmeasure_disk_new, VERBOSE)) { 981 986 fprintf (stderr, "trouble writing Measure table\n"); 982 987 goto failure; … … 1007 1012 // write out Missing table (must write out entire table) 1008 1013 catalog->missing_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1009 if (!dvo_catalog_save_subcat (catalog[0].missing_catalog, &ftable, 0, catalog[0].Nmissing, catalog[0].Nmissing, catalog[0].Nmissing )) {1014 if (!dvo_catalog_save_subcat (catalog[0].missing_catalog, &ftable, 0, catalog[0].Nmissing, catalog[0].Nmissing, catalog[0].Nmissing, VERBOSE)) { 1010 1015 fprintf (stderr, "trouble writing Missing Table\n"); 1011 1016 goto failure; … … 1044 1049 // write out SecFilt table 1045 1050 catalog->secfilt_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1046 if (!dvo_catalog_save_subcat (catalog[0].secfilt_catalog, &ftable, start, Nrows, catalog[0].Nsecfilt_disk, Nsecfilt_disk_new )) {1051 if (!dvo_catalog_save_subcat (catalog[0].secfilt_catalog, &ftable, start, Nrows, catalog[0].Nsecfilt_disk, Nsecfilt_disk_new, VERBOSE)) { 1047 1052 fprintf (stderr, "failure writing SecFilt table\n"); 1048 1053 goto failure; … … 1075 1080 // write out Lensing table 1076 1081 catalog->lensing_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1077 if (!dvo_catalog_save_subcat (catalog[0].lensing_catalog, &ftable, start, Nrows, catalog[0].Nlensing_disk, Nlensing_disk_new )) {1082 if (!dvo_catalog_save_subcat (catalog[0].lensing_catalog, &ftable, start, Nrows, catalog[0].Nlensing_disk, Nlensing_disk_new, VERBOSE)) { 1078 1083 fprintf (stderr, "trouble writing Lensing table\n"); 1079 1084 goto failure; … … 1106 1111 // write out Lensobj table 1107 1112 catalog->lensobj_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1108 if (!dvo_catalog_save_subcat (catalog[0].lensobj_catalog, &ftable, start, Nrows, catalog[0].Nlensobj_disk, Nlensobj_disk_new )) {1113 if (!dvo_catalog_save_subcat (catalog[0].lensobj_catalog, &ftable, start, Nrows, catalog[0].Nlensobj_disk, Nlensobj_disk_new, VERBOSE)) { 1109 1114 fprintf (stderr, "trouble writing Lensobj table\n"); 1110 1115 goto failure; … … 1137 1142 // write out StarPar table 1138 1143 catalog->starpar_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1139 if (!dvo_catalog_save_subcat (catalog[0].starpar_catalog, &ftable, start, Nrows, catalog[0].Nstarpar_disk, Nstarpar_disk_new )) {1144 if (!dvo_catalog_save_subcat (catalog[0].starpar_catalog, &ftable, start, Nrows, catalog[0].Nstarpar_disk, Nstarpar_disk_new, VERBOSE)) { 1140 1145 fprintf (stderr, "trouble writing StarPar table\n"); 1141 1146 goto failure; … … 1168 1173 // write out GalPhot table 1169 1174 catalog->galphot_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1170 if (!dvo_catalog_save_subcat (catalog[0].galphot_catalog, &ftable, start, Nrows, catalog[0].Ngalphot_disk, Ngalphot_disk_new )) {1175 if (!dvo_catalog_save_subcat (catalog[0].galphot_catalog, &ftable, start, Nrows, catalog[0].Ngalphot_disk, Ngalphot_disk_new, VERBOSE)) { 1171 1176 fprintf (stderr, "trouble writing GalPhot table\n"); 1172 1177 goto failure; … … 1270 1275 } 1271 1276 1272 if (!dvo_catalog_save_subcat (catalog, &ftable, start, Nrows, catalog[0].Naverage_disk, Naverage_disk_new )) {1277 if (!dvo_catalog_save_subcat (catalog, &ftable, start, Nrows, catalog[0].Naverage_disk, Naverage_disk_new, VERBOSE)) { 1273 1278 fprintf (stderr, "failure writing Average table\n"); 1274 1279 goto failure; … … 1308 1313 1309 1314 // write out Measure table 1310 if (!dvo_catalog_save_subcat (catalog[0].measure_catalog, &ftable, start, Nrows, catalog[0].Nmeasure_disk, Nmeasure_disk_new )) {1315 if (!dvo_catalog_save_subcat (catalog[0].measure_catalog, &ftable, start, Nrows, catalog[0].Nmeasure_disk, Nmeasure_disk_new, VERBOSE)) { 1311 1316 fprintf (stderr, "trouble writing Measure table\n"); 1312 1317 goto failure; … … 1331 1336 1332 1337 // write out Missing table (must write out entire table) 1333 if (!dvo_catalog_save_subcat (catalog[0].missing_catalog, &ftable, 0, catalog[0].Nmissing, catalog[0].Nmissing, catalog[0].Nmissing )) {1338 if (!dvo_catalog_save_subcat (catalog[0].missing_catalog, &ftable, 0, catalog[0].Nmissing, catalog[0].Nmissing, catalog[0].Nmissing, VERBOSE)) { 1334 1339 fprintf (stderr, "trouble writing Missing Table\n"); 1335 1340 goto failure; … … 1360 1365 1361 1366 // write out SecFilt table 1362 if (!dvo_catalog_save_subcat (catalog[0].secfilt_catalog, &ftable, start, Nrows, catalog[0].Nsecfilt_disk, Nsecfilt_disk_new )) {1367 if (!dvo_catalog_save_subcat (catalog[0].secfilt_catalog, &ftable, start, Nrows, catalog[0].Nsecfilt_disk, Nsecfilt_disk_new, VERBOSE)) { 1363 1368 fprintf (stderr, "failure writing SecFilt table\n"); 1364 1369 goto failure; … … 1388 1393 1389 1394 // write out Lensing table 1390 if (!dvo_catalog_save_subcat (catalog[0].lensing_catalog, &ftable, start, Nrows, catalog[0].Nlensing_disk, Nlensing_disk_new )) {1395 if (!dvo_catalog_save_subcat (catalog[0].lensing_catalog, &ftable, start, Nrows, catalog[0].Nlensing_disk, Nlensing_disk_new, VERBOSE)) { 1391 1396 fprintf (stderr, "trouble writing Lensing table\n"); 1392 1397 goto failure; … … 1417 1422 1418 1423 // write out Lensobj table 1419 if (!dvo_catalog_save_subcat (catalog[0].lensobj_catalog, &ftable, start, Nrows, catalog[0].Nlensobj_disk, Nlensobj_disk_new )) {1424 if (!dvo_catalog_save_subcat (catalog[0].lensobj_catalog, &ftable, start, Nrows, catalog[0].Nlensobj_disk, Nlensobj_disk_new, VERBOSE)) { 1420 1425 fprintf (stderr, "trouble writing Lensobj table\n"); 1421 1426 goto failure; … … 1446 1451 1447 1452 // write out StarPar table 1448 if (!dvo_catalog_save_subcat (catalog[0].starpar_catalog, &ftable, start, Nrows, catalog[0].Nstarpar_disk, Nstarpar_disk_new )) {1453 if (!dvo_catalog_save_subcat (catalog[0].starpar_catalog, &ftable, start, Nrows, catalog[0].Nstarpar_disk, Nstarpar_disk_new, VERBOSE)) { 1449 1454 fprintf (stderr, "trouble writing StarPar table\n"); 1450 1455 goto failure; … … 1475 1480 1476 1481 // write out GalPhot table 1477 if (!dvo_catalog_save_subcat (catalog[0].galphot_catalog, &ftable, start, Nrows, catalog[0].Ngalphot_disk, Ngalphot_disk_new )) {1482 if (!dvo_catalog_save_subcat (catalog[0].galphot_catalog, &ftable, start, Nrows, catalog[0].Ngalphot_disk, Ngalphot_disk_new, VERBOSE)) { 1478 1483 fprintf (stderr, "trouble writing GalPhot table\n"); 1479 1484 goto failure; … … 1625 1630 if (OHANA_MEMCHECK) ohana_memcheck (TRUE); 1626 1631 1627 if (!dvo_catalog_save_subcat (catalog, &ftable, start, Nrows, catalog[0].Naverage_disk, Naverage_disk_new )) {1632 if (!dvo_catalog_save_subcat (catalog, &ftable, start, Nrows, catalog[0].Naverage_disk, Naverage_disk_new, VERBOSE)) { 1628 1633 fprintf (stderr, "failure writing Average table\n"); 1629 1634 goto failure; … … 1675 1680 // write out Measure table 1676 1681 catalog->measure_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1677 if (!dvo_catalog_save_subcat (catalog[0].measure_catalog, &ftable, start, Nrows, catalog[0].Nmeasure_disk, Nmeasure_disk_new )) {1682 if (!dvo_catalog_save_subcat (catalog[0].measure_catalog, &ftable, start, Nrows, catalog[0].Nmeasure_disk, Nmeasure_disk_new, VERBOSE)) { 1678 1683 fprintf (stderr, "trouble writing Measure table\n"); 1679 1684 goto failure; … … 1707 1712 // write out Missing table (must write out entire table) 1708 1713 catalog->missing_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1709 if (!dvo_catalog_save_subcat (catalog[0].missing_catalog, &ftable, 0, catalog[0].Nmissing, catalog[0].Nmissing, catalog[0].Nmissing )) {1714 if (!dvo_catalog_save_subcat (catalog[0].missing_catalog, &ftable, 0, catalog[0].Nmissing, catalog[0].Nmissing, catalog[0].Nmissing, VERBOSE)) { 1710 1715 fprintf (stderr, "trouble writing Missing Table\n"); 1711 1716 goto failure; … … 1744 1749 // write out SecFilt table 1745 1750 catalog->secfilt_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1746 if (!dvo_catalog_save_subcat (catalog[0].secfilt_catalog, &ftable, start, Nrows, catalog[0].Nsecfilt_disk, Nsecfilt_disk_new )) {1751 if (!dvo_catalog_save_subcat (catalog[0].secfilt_catalog, &ftable, start, Nrows, catalog[0].Nsecfilt_disk, Nsecfilt_disk_new, VERBOSE)) { 1747 1752 fprintf (stderr, "failure writing SecFilt table\n"); 1748 1753 goto failure; … … 1775 1780 // write out Lensing table 1776 1781 catalog->lensing_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1777 if (!dvo_catalog_save_subcat (catalog[0].lensing_catalog, &ftable, start, Nrows, catalog[0].Nlensing_disk, Nlensing_disk_new )) {1782 if (!dvo_catalog_save_subcat (catalog[0].lensing_catalog, &ftable, start, Nrows, catalog[0].Nlensing_disk, Nlensing_disk_new, VERBOSE)) { 1778 1783 fprintf (stderr, "trouble writing Lensing table\n"); 1779 1784 goto failure; … … 1806 1811 // write out Lensobj table 1807 1812 catalog->lensobj_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1808 if (!dvo_catalog_save_subcat (catalog[0].lensobj_catalog, &ftable, start, Nrows, catalog[0].Nlensobj_disk, Nlensobj_disk_new )) {1813 if (!dvo_catalog_save_subcat (catalog[0].lensobj_catalog, &ftable, start, Nrows, catalog[0].Nlensobj_disk, Nlensobj_disk_new, VERBOSE)) { 1809 1814 fprintf (stderr, "trouble writing Lensobj table\n"); 1810 1815 goto failure; … … 1837 1842 // write out StarPar table 1838 1843 catalog->starpar_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1839 if (!dvo_catalog_save_subcat (catalog[0].starpar_catalog, &ftable, start, Nrows, catalog[0].Nstarpar_disk, Nstarpar_disk_new )) {1844 if (!dvo_catalog_save_subcat (catalog[0].starpar_catalog, &ftable, start, Nrows, catalog[0].Nstarpar_disk, Nstarpar_disk_new, VERBOSE)) { 1840 1845 fprintf (stderr, "trouble writing StarPar table\n"); 1841 1846 goto failure; … … 1868 1873 // write out GalPhot table 1869 1874 catalog->galphot_catalog->catcompress = catalog->catcompress; // XXX this is a bit of a hack, should be done in an api 1870 if (!dvo_catalog_save_subcat (catalog[0].galphot_catalog, &ftable, start, Nrows, catalog[0].Ngalphot_disk, Ngalphot_disk_new )) {1875 if (!dvo_catalog_save_subcat (catalog[0].galphot_catalog, &ftable, start, Nrows, catalog[0].Ngalphot_disk, Ngalphot_disk_new, VERBOSE)) { 1871 1876 fprintf (stderr, "trouble writing GalPhot table\n"); 1872 1877 goto failure;
Note:
See TracChangeset
for help on using the changeset viewer.
