Changeset 41676 for trunk/Ohana/src/libfits/table/F_get_column.c
- Timestamp:
- Jul 1, 2021, 1:58:44 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/table/F_get_column.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/table/F_get_column.c
r41474 r41676 310 310 C - complex float 311 311 M - complex double 312 P - var leng htarray descrpt (64 bit)312 P - var length array descrpt (64 bit) 313 313 314 314 all can be preceeded by integer N which specified number … … 341 341 342 342 if (!gfits_table_format (format, type, Nval, &Nbytes)) return (FALSE); 343 *Nval = 1;344 343 345 344 return (TRUE); … … 379 378 gfits_scan (header, "NAXIS2", OFF_T_FMT, 1, &Ny); 380 379 381 /* scan columns to find insert point */ 382 Nstart = 0; 383 for (i = 1; i < N; i++) { 384 snprintf (field, 256, "TFORM%d", i); 385 gfits_scan (header, field, "%s", 1, format); 386 gfits_table_format (format, tmp, &Nv, &Nb); 387 Nstart += Nv*Nb; 380 // find the starting byte for this column 381 // FITS ASCII table is supposed to have TBCOLn to specify the starting point 382 // but if it is missing, we can try to find by counting 383 snprintf (field, 256, "TBCOL%d", N); 384 int status = gfits_scan (header, field, "%d", 1, &Nstart); 385 if (!status) { 386 /* scan columns to find insert point */ 387 Nstart = 0; 388 for (i = 1; i < N; i++) { 389 snprintf (field, 256, "TFORM%d", i); 390 gfits_scan (header, field, "%s", 1, format); 391 gfits_table_format (format, tmp, &Nv, &Nb); 392 Nstart += Nv*Nb; 393 } 394 } else { 395 Nstart --; 388 396 } 389 397 390 398 /* allocate temporary line, init pointers */ 391 ALLOCATE (line, char, Nval +1);392 bzero (line, Nval +1);399 ALLOCATE (line, char, Nval*Nbytes+1); 400 bzero (line, Nval*Nbytes+1); 393 401 Pin = table[0].buffer + Nstart; 394 402
Note:
See TracChangeset
for help on using the changeset viewer.
