Changeset 42059
- Timestamp:
- Feb 24, 2022, 3:27:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20211108/Ohana/src/opihi/cmd.data/read_vectors.c
r41673 r42059 629 629 } 630 630 if (listFields) { 631 read_table_fields (&header, IsCompressed, VERBOSE);631 int tstatus = read_table_fields (&header, IsCompressed, VERBOSE); 632 632 if (CCDKeyword != NULL) free (CCDKeyword); 633 633 gfits_free_header (&header); 634 return TRUE; 634 if (!tstatus) { gprint (GP_ERR, "error reading table fields\n"); } 635 return tstatus; 635 636 } 636 637 if (IsCompressed) { … … 855 856 char field[32], varname[32], type[80], comment[80], format[80], unit[80], null[80], nval[80]; 856 857 857 gfits_scan (header, "TFIELDS", "%d", 1, &Nfields); 858 858 if (!gfits_scan (header, "TFIELDS", "%d", 1, &Nfields)) { 859 if (VERBOSE) gprint (GP_ERR, "cannot read TFIELDS from header\n"); 860 set_int_variable ("table:Nx", header->Naxis[0]); 861 set_int_variable ("table:Ny", header->Naxis[1]); 862 set_int_variable ("table:Nfields", 0); 863 set_int_variable ("tfields:n", 0); 864 return TRUE; 865 } 866 859 867 set_int_variable ("table:Nx", header->Naxis[0]); 860 868 set_int_variable ("table:Ny", header->Naxis[1]); … … 872 880 873 881 snprintf (field, 32, "TTYPE%d", i); 874 gfits_scan (header, field, "%s", 1, type); 882 if (!gfits_scan (header, field, "%s", 1, type)) { 883 if (VERBOSE) gprint (GP_ERR, "cannot read %s from header\n", field); 884 } 875 885 876 886 snprintf (varname, 32, "tfields:%d", i - 1); 877 887 set_str_variable (varname, type); 878 888 879 gfits_scan_alt (header, field, "%C", 1, comment); 889 gfits_scan_alt (header, field, "%C", 1, comment); 880 890 881 891 if (!isCompressed) { … … 884 894 snprintf (field, 32, "ZFORM%d", i); 885 895 } 886 gfits_scan (header, field, "%s", 1, format); 896 if (!gfits_scan (header, field, "%s", 1, format)) { 897 if (VERBOSE) gprint (GP_ERR, "cannot read %s from header\n", field); 898 } 887 899 888 900 snprintf (field, 32, "TUNIT%d", i); … … 895 907 if (VERBOSE) gprint (GP_LOG, "%-18s %-15s %-18s %-6s %-8s %-8s %-32s\n", type, varname, unit, format, null, nval, comment); 896 908 } 897 898 899 909 return TRUE; 900 910 }
Note:
See TracChangeset
for help on using the changeset viewer.
