Changeset 7080 for trunk/Ohana/src/imregister/imphot/dumpfits.c
- Timestamp:
- May 5, 2006, 5:44:26 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/imregister/imphot/dumpfits.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/imregister/imphot/dumpfits.c
r5014 r7080 27 27 28 28 /* create primary header */ 29 fits_init_header (&header);29 gfits_init_header (&header); 30 30 header.extend = TRUE; 31 fits_create_header (&header);32 fits_create_matrix (&header, &matrix);33 fits_print (&header, "NEXTEND", "%d", 1, 1);31 gfits_create_header (&header); 32 gfits_create_matrix (&header, &matrix); 33 gfits_print (&header, "NEXTEND", "%d", 1, 1); 34 34 35 35 ftable.header = &theader; 36 fits_table_set_Image (&ftable, subset, Nmatch);36 gfits_table_set_Image (&ftable, subset, Nmatch); 37 37 38 fits_fwrite_header (f, &header);39 fits_fwrite_matrix (f, &matrix);40 fits_fwrite_Theader (f, &theader);41 fits_fwrite_table (f, &ftable);38 gfits_fwrite_header (f, &header); 39 gfits_fwrite_matrix (f, &matrix); 40 gfits_fwrite_Theader (f, &theader); 41 gfits_fwrite_table (f, &ftable); 42 42 fclose (f); 43 43 exit (0); … … 58 58 59 59 /* create primary header */ 60 fits_init_header (&header);60 gfits_init_header (&header); 61 61 header.extend = TRUE; 62 fits_create_header (&header);63 fits_create_matrix (&header, &matrix);64 fits_print (&header, "NEXTEND", "%d", 1, 1);62 gfits_create_header (&header); 63 gfits_create_matrix (&header, &matrix); 64 gfits_print (&header, "NEXTEND", "%d", 1, 1); 65 65 66 66 /* the ASCII table is always a little harder than the binary: … … 69 69 70 70 /* create table header */ 71 fits_create_table_header (&theader, "TABLE", "ZPTS");71 gfits_create_table_header (&theader, "TABLE", "ZPTS"); 72 72 73 73 /* add current date/time to header */ 74 74 str_to_time ("now", &tsecond); 75 75 datestr = sec_to_date (tsecond); 76 fits_modify (&header, "DATE", "%s", 1, datestr);77 fits_modify (&theader, "DATE", "%s", 1, datestr);76 gfits_modify (&header, "DATE", "%s", 1, datestr); 77 gfits_modify (&theader, "DATE", "%s", 1, datestr); 78 78 79 79 /* define table layout */ 80 fits_define_table_column (&theader, "A20", "START_TIME", "start time of measurement", "yyyy/mm/dd,hh:mm:ss");81 fits_define_table_column (&theader, "A10", "FILTER", "filter and camera name", "");82 fits_define_table_column (&theader, "F8.4", "ZP_OBS", "measured zero point", "mag");83 fits_define_table_column (&theader, "F7.4", "ZP_ERR", "error on zero point", "mag");84 fits_define_table_column (&theader, "F11.6", "RA", "RA (J2000)", "dec. degrees");85 fits_define_table_column (&theader, "F11.6", "DEC", "DEC (J2000)", "dec. degrees");86 fits_define_table_column (&theader, "F7.3", "C_AIRMASS", "airmass coeff", "mag per airmass");87 fits_define_table_column (&theader, "F7.1", "SKY", "median sky flux", "counts");88 fits_define_table_column (&theader, "I6", "NSTAR", "Number of stars in image", "stars");80 gfits_define_table_column (&theader, "A20", "START_TIME", "start time of measurement", "yyyy/mm/dd,hh:mm:ss"); 81 gfits_define_table_column (&theader, "A10", "FILTER", "filter and camera name", ""); 82 gfits_define_table_column (&theader, "F8.4", "ZP_OBS", "measured zero point", "mag"); 83 gfits_define_table_column (&theader, "F7.4", "ZP_ERR", "error on zero point", "mag"); 84 gfits_define_table_column (&theader, "F11.6", "RA", "RA (J2000)", "dec. degrees"); 85 gfits_define_table_column (&theader, "F11.6", "DEC", "DEC (J2000)", "dec. degrees"); 86 gfits_define_table_column (&theader, "F7.3", "C_AIRMASS", "airmass coeff", "mag per airmass"); 87 gfits_define_table_column (&theader, "F7.1", "SKY", "median sky flux", "counts"); 88 gfits_define_table_column (&theader, "I6", "NSTAR", "Number of stars in image", "stars"); 89 89 90 90 /* define TNULL, TNVAL values */ 91 fits_modify (&theader, "TNULL1", "%s", 1, "NULL"); /* START_TIME */92 fits_modify (&theader, "TNULL2", "%s", 1, "NULL"); /* FILTER */93 fits_modify (&theader, "TNULL3", "%s", 1, "NaN"); /* ZP_OBS */94 fits_modify (&theader, "TNULL4", "%s", 1, "NaN"); /* ZP_ERR */95 fits_modify (&theader, "TNULL5", "%s", 1, "NaN"); /* RA */96 fits_modify (&theader, "TNULL6", "%s", 1, "NaN"); /* DEC */97 fits_modify (&theader, "TNULL7", "%s", 1, "NaN"); /* C_AIRMASS */98 fits_modify (&theader, "TNULL8", "%s", 1, "NaN"); /* SKY */99 fits_modify (&theader, "TNULL9", "%s", 1, "-1"); /* NSTAR */91 gfits_modify (&theader, "TNULL1", "%s", 1, "NULL"); /* START_TIME */ 92 gfits_modify (&theader, "TNULL2", "%s", 1, "NULL"); /* FILTER */ 93 gfits_modify (&theader, "TNULL3", "%s", 1, "NaN"); /* ZP_OBS */ 94 gfits_modify (&theader, "TNULL4", "%s", 1, "NaN"); /* ZP_ERR */ 95 gfits_modify (&theader, "TNULL5", "%s", 1, "NaN"); /* RA */ 96 gfits_modify (&theader, "TNULL6", "%s", 1, "NaN"); /* DEC */ 97 gfits_modify (&theader, "TNULL7", "%s", 1, "NaN"); /* C_AIRMASS */ 98 gfits_modify (&theader, "TNULL8", "%s", 1, "NaN"); /* SKY */ 99 gfits_modify (&theader, "TNULL9", "%s", 1, "-1"); /* NSTAR */ 100 100 101 fits_modify (&theader, "TNVAL1", "%s", 1, "NA"); /* START_TIME */102 fits_modify (&theader, "TNVAL2", "%s", 1, "NA"); /* FILTER */103 fits_modify (&theader, "TNVAL3", "%s", 1, "Inf"); /* ZP_OBS */104 fits_modify (&theader, "TNVAL4", "%s", 1, "Inf"); /* ZP_ERR */105 fits_modify (&theader, "TNVAL5", "%s", 1, "Inf"); /* RA */106 fits_modify (&theader, "TNVAL6", "%s", 1, "Inf"); /* DEC */107 fits_modify (&theader, "TNVAL7", "%s", 1, "Inf"); /* C_AIRMASS */108 fits_modify (&theader, "TNVAL8", "%s", 1, "Inf"); /* SKY */109 fits_modify (&theader, "TNVAL9", "%s", 1, "-2"); /* NSTAR */101 gfits_modify (&theader, "TNVAL1", "%s", 1, "NA"); /* START_TIME */ 102 gfits_modify (&theader, "TNVAL2", "%s", 1, "NA"); /* FILTER */ 103 gfits_modify (&theader, "TNVAL3", "%s", 1, "Inf"); /* ZP_OBS */ 104 gfits_modify (&theader, "TNVAL4", "%s", 1, "Inf"); /* ZP_ERR */ 105 gfits_modify (&theader, "TNVAL5", "%s", 1, "Inf"); /* RA */ 106 gfits_modify (&theader, "TNVAL6", "%s", 1, "Inf"); /* DEC */ 107 gfits_modify (&theader, "TNVAL7", "%s", 1, "Inf"); /* C_AIRMASS */ 108 gfits_modify (&theader, "TNVAL8", "%s", 1, "Inf"); /* SKY */ 109 gfits_modify (&theader, "TNVAL9", "%s", 1, "-2"); /* NSTAR */ 110 110 111 111 /* add data to table */ … … 121 121 122 122 /* we should get an error here if we don't construct this line correctly */ 123 line = fits_table_print (&ftable, startstr, filtstr, zp, dzp, ra, dec, airmass, sky, subset[0].nstar);124 fits_add_rows (&ftable, line, 1, strlen(line));123 line = gfits_table_print (&ftable, startstr, filtstr, zp, dzp, ra, dec, airmass, sky, subset[0].nstar); 124 gfits_add_rows (&ftable, line, 1, strlen(line)); 125 125 free (line); 126 126 free (startstr); … … 133 133 exit (1); 134 134 } 135 fits_fwrite_header (f, &header);136 fits_fwrite_matrix (f, &matrix);137 fits_fwrite_Theader (f, &theader);138 fits_fwrite_table (f, &ftable);135 gfits_fwrite_header (f, &header); 136 gfits_fwrite_matrix (f, &matrix); 137 gfits_fwrite_Theader (f, &theader); 138 gfits_fwrite_table (f, &ftable); 139 139 fclose (f); 140 140 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.
