Changeset 38367
- Timestamp:
- Jun 4, 2015, 5:44:39 PM (11 years ago)
- Location:
- branches/eam_branches/ohana.20150429/src/opihi
- Files:
-
- 3 edited
-
cmd.data/read_vectors.c (modified) (2 diffs)
-
lib.data/SplineOps.c (modified) (1 diff)
-
lib.shell/VectorIO.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/opihi/cmd.data/read_vectors.c
r38341 r38367 522 522 523 523 dump_cmp_table (&table, "rd cmp"); 524 525 int Nfields; 526 if (!gfits_scan (&header, "TFIELDS", "%d", 1, &Nfields)) ESCAPE ("cannot find TFIELDS in header"); 527 for (i = 0; i < Nfields; i++) { 528 gfits_byteswap_varlength_column (&table, i+1); 529 } 524 530 if (!gfits_uncompress_table (&table, &rawtable)) ESCAPE ("failed to uncompress table"); 525 531 dump_raw_table (&rawtable, "rd raw"); … … 541 547 if (Binary) { 542 548 if (!gfits_get_bintable_column_type (outheader, argv[i], type, &Nval)) ESCAPE ("requested field not found"); 543 if (!gfits_get_bintable_column (outheader, outtable, argv[i], &data)) ESCAPE ("error reading data from specified field");549 if (!gfits_get_bintable_column_raw (outheader, outtable, argv[i], &data, IsCompressed)) ESCAPE ("error reading data from specified field"); 544 550 } else { 545 551 if (!gfits_get_table_column_type (outheader, argv[i], type)) ESCAPE ("requested field not found"); -
branches/eam_branches/ohana.20150429/src/opihi/lib.data/SplineOps.c
r34584 r38367 178 178 gfits_create_table (&theader, &ftable); 179 179 180 gfits_set_bintable_column_reformat (&theader, &ftable, "X_KNOT", "double", myspline->xk, myspline->Nknots); 181 gfits_set_bintable_column_reformat (&theader, &ftable, "Y_KNOT", "double", myspline->yk, myspline->Nknots); 182 gfits_set_bintable_column_reformat (&theader, &ftable, "DY2_DX", "double", myspline->y2, myspline->Nknots); 180 // NOTE: if we want to compress the output table, use native byte order here (last element) 181 gfits_set_bintable_column_reformat (&theader, &ftable, "X_KNOT", "double", myspline->xk, myspline->Nknots, FALSE); 182 gfits_set_bintable_column_reformat (&theader, &ftable, "Y_KNOT", "double", myspline->yk, myspline->Nknots, FALSE); 183 gfits_set_bintable_column_reformat (&theader, &ftable, "DY2_DX", "double", myspline->y2, myspline->Nknots, FALSE); 183 184 184 185 if (!append) { -
branches/eam_branches/ohana.20150429/src/opihi/lib.shell/VectorIO.c
r38341 r38367 2 2 3 3 // write a set of vectors to a FITS FTable structure (vectors names become fits column names) 4 static int WriteVectorTable (FTable *ftable, char *extname, Vector **vec, int Nvec, char *format ) {4 static int WriteVectorTable (FTable *ftable, char *extname, Vector **vec, int Nvec, char *format, char nativeOrder) { 5 5 6 6 int j; … … 59 59 for (j = 0; j < Nvec; j++) { 60 60 if (vec[j][0].type == OPIHI_FLT) { 61 gfits_set_bintable_column_reformat (theader, ftable, vec[j][0].name, "double", vec[j][0].elements.Flt, vec[j][0].Nelements );61 gfits_set_bintable_column_reformat (theader, ftable, vec[j][0].name, "double", vec[j][0].elements.Flt, vec[j][0].Nelements, nativeOrder); 62 62 } else { 63 gfits_set_bintable_column_reformat (theader, ftable, vec[j][0].name, "int", vec[j][0].elements.Int, vec[j][0].Nelements );63 gfits_set_bintable_column_reformat (theader, ftable, vec[j][0].name, "int", vec[j][0].elements.Int, vec[j][0].Nelements, nativeOrder); 64 64 } 65 65 } … … 130 130 131 131 rawtable.header = &rawheader; 132 if (!WriteVectorTable (&rawtable, extname, vec, Nvec, format)) goto escape; 132 if (!WriteVectorTable (&rawtable, extname, vec, Nvec, format, (compress != NULL))) goto escape; 133 // NOTE : for compression, the table is constructed in native by order 133 134 134 135 FTable *outtable = &rawtable; … … 139 140 140 141 dump_raw_table (&rawtable, "wd raw"); 141 if (!gfits_compress_table (&rawtable, &cmptable, 10, compress)) goto escape; 142 if (!gfits_compress_table (&rawtable, &cmptable, 0, compress)) goto escape; 143 144 int i, Nfields; 145 if (!gfits_scan (&cmpheader, "TFIELDS", "%d", 1, &Nfields)) goto escape; 146 for (i = 0; i < Nfields; i++) { 147 gfits_byteswap_varlength_column (&cmptable, i+1); 148 } 142 149 dump_cmp_table (&cmptable, "wd cmp"); 143 150
Note:
See TracChangeset
for help on using the changeset viewer.
