37    int p = s.find_first_not_of( 
" \t\n\t" );
 
   44    p = s.find_last_not_of( 
" \t\n\t" );
 
   53    while( s[p] == 
' ' && p >= 0 )
 
 
   65    memset( headStr, 
' ', 80 );
 
   70    if( strlen( keyword ) > 8 )
 
   72        rpos += snprintf( headStr, 81, 
"HIERARCH " );
 
   74        rpos += snprintf( headStr + rpos, 81 - rpos, 
"%s =", keyword );
 
   78        rpos += snprintf( headStr, 81, 
"%-8s=", keyword );
 
   85        rpos += snprintf( headStr + rpos, 81 - rpos, fstr, value );
 
   89        rpos += snprintf( headStr + rpos, 81 - rpos, 
"%s", value );
 
  101    snprintf( headStr + rpos, 81 - rpos, 
"%s", comment );
 
 
  105int fits_write_key<char *>( fitsfile *fptr, 
char *keyword, 
void *value, 
char *comment )
 
  109    fits_write_key_longwarn( fptr, &fstatus );
 
  111    fits_write_key_longstr( fptr, keyword, (
const char *)value, comment, &fstatus );
 
  117int fits_write_key<std::string>( fitsfile *fptr, 
char *keyword, 
void *value, 
char *comment )
 
  119    return fits_write_key<char *>( fptr, keyword, value, comment );
 
  125    unsigned char bc = *( (
bool *)value );
 
  129    fits_write_key( fptr, fitsType<unsigned char>(), keyword, &bc, comment, &fstatus );
 
 
  135int fits_write_key<fitsUnknownType>( fitsfile *fptr, 
char *keyword, 
void *value, 
char *comment )
 
  140    char *vstr = (
char *)value;
 
  147    fits_write_record( fptr, headStr, &fstatus );
 
  151int fits_write_comment( fitsfile *fptr, 
char *comment )
 
  155    fits_write_comment( fptr, comment, &fstatus );
 
  160int fits_write_history( fitsfile *fptr, 
char *history )
 
  164    fits_write_history( fptr, history, &fstatus );
 
  169void fitsErrText( std::string &explan, 
const std::string &filename, 
int fstatus )
 
  173    fits_get_errstatus( fstatus, emnem );
 
  177    explan += 
". CFITSIO: ";
 
 
Declares and defines utilities to work with FITS files.
#define stdValWidth
The standard width of the value entry in a header card.
int fitsStripApost(std::string &s)
Strip the apostrophes from a FITS value string.
void fitsErrText(std::string &explan, const std::string &filename, int fstatus)
Generate a rich error meesage from a FITS status code.
int fits_write_key(fitsfile *fptr, char *keyword, void *value, char *comment)
Write a header card to a file.
void fitsPopulateCard(char headStr[81], char *keyword, char *value, char *comment)
Populate a fits header card with the value string copied verbatim.
int fits_write_key< bool >(fitsfile *fptr, char *keyword, void *value, char *comment)
Specialization to handle the case bool.
std::string convertToString(const typeT &value, int precision=0)
Convert a numerical value to a string.