Changeset 7054 for trunk/Ohana/src/libfits/table/F_create_TH.c
- Timestamp:
- May 3, 2006, 12:01:09 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/table/F_create_TH.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/table/F_create_TH.c
r7039 r7054 7 7 8 8 /*********************** fits create Theader *********************************/ 9 int fits_create_Theader (Header *header, char *type) {9 int gfits_create_Theader (Header *header, char *type) { 10 10 11 11 int i; … … 19 19 strncpy (header[0].buffer, "END", 3); 20 20 21 fits_modify (header, "XTENSION", "%s", 1, type);22 fits_modify (header, "BITPIX", "%d", 1, header[0].bitpix);23 fits_modify (header, "NAXIS", "%d", 1, header[0].Naxes);21 gfits_modify (header, "XTENSION", "%s", 1, type); 22 gfits_modify (header, "BITPIX", "%d", 1, header[0].bitpix); 23 gfits_modify (header, "NAXIS", "%d", 1, header[0].Naxes); 24 24 25 25 for (i = 0; i < header[0].Naxes; i++) { 26 26 sprintf (axis, "NAXIS%d", i + 1); 27 fits_modify (header, axis, "%d", 1, header[0].Naxis[i], 1);27 gfits_modify (header, axis, "%d", 1, header[0].Naxis[i], 1); 28 28 } 29 29 30 30 /* PCOUNT & GCOUNT are not implemented, but they are required to be here */ 31 fits_modify (header, "PCOUNT", "%d", 1, 0);32 fits_modify (header, "GCOUNT", "%d", 1, 1);31 gfits_modify (header, "PCOUNT", "%d", 1, 0); 32 gfits_modify (header, "GCOUNT", "%d", 1, 1); 33 33 if (!strcmp (type, "IMAGE")) { 34 fits_modify (header, "BSCALE", "%lf", 1, header[0].bscale);35 fits_modify (header, "BZERO", "%lf", 1, header[0].bzero);34 gfits_modify (header, "BSCALE", "%lf", 1, header[0].bscale); 35 gfits_modify (header, "BZERO", "%lf", 1, header[0].bzero); 36 36 } 37 37 … … 40 40 41 41 /*********************** fits create table header *********************************/ 42 int fits_create_table_header (Header *header, char *type, char *extname) {42 int gfits_create_table_header (Header *header, char *type, char *extname) { 43 43 44 44 int i, valid; … … 71 71 72 72 /* required keywords */ 73 fits_modify (header, "XTENSION", "%s", 1, type);74 fits_modify (header, "BITPIX", "%d", 1, header[0].bitpix);75 fits_modify (header, "NAXIS", "%d", 1, header[0].Naxes);73 gfits_modify (header, "XTENSION", "%s", 1, type); 74 gfits_modify (header, "BITPIX", "%d", 1, header[0].bitpix); 75 gfits_modify (header, "NAXIS", "%d", 1, header[0].Naxes); 76 76 77 77 for (i = 0; i < header[0].Naxes; i++) { 78 78 sprintf (axis, "NAXIS%d", i + 1); 79 fits_modify (header, axis, "%d", 1, header[0].Naxis[i], 1);79 gfits_modify (header, axis, "%d", 1, header[0].Naxis[i], 1); 80 80 } 81 81 82 82 /* PCOUNT & GCOUNT are not implemented, but they are required to be here */ 83 fits_modify (header, "PCOUNT", "%d", 1, 0);84 fits_modify (header, "GCOUNT", "%d", 1, 1);83 gfits_modify (header, "PCOUNT", "%d", 1, 0); 84 gfits_modify (header, "GCOUNT", "%d", 1, 1); 85 85 if (!strcmp (type, "IMAGE")) { 86 fits_modify (header, "BSCALE", "%lf", 1, header[0].bscale);87 fits_modify (header, "BZERO", "%lf", 1, header[0].bzero);86 gfits_modify (header, "BSCALE", "%lf", 1, header[0].bscale); 87 gfits_modify (header, "BZERO", "%lf", 1, header[0].bzero); 88 88 } 89 89 90 fits_modify (header, "TFIELDS", "%d", 1, 0);91 fits_modify (header, "EXTNAME", "%s", 1, extname);90 gfits_modify (header, "TFIELDS", "%d", 1, 0); 91 gfits_modify (header, "EXTNAME", "%s", 1, extname); 92 92 93 93 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.
