hput.c Subroutines to set FITS header parameter values

hput.c

WCSTools subroutines to insert values for parameters into a FITS header string

Subroutines

  • hputi2 (hstring,keyword,ival) sets integer*2 ival
  • hputi4 (hstring,keyword,ival) sets int ival
  • hputr4 (hstring,keyword,rval) sets real*4 rval
  • hputr8 (hstring,keyword,dval) sets real*8 dval
  • hputnr8 (hstring,keyword,ndec,dval) sets real*8 dval
  • hputra (hstring,keyword,lval) sets right ascnesion as string
  • hputdec (hstring,keyword,lval) sets declination as string
  • hputl (hstring,keyword,lval) sets logical lval
  • hputs (hstring,keyword,cval) sets character string adding ''
  • hputc (hstring,keyword,cval) sets character string cval
  • hdel (hstring,keyword) deletes entry for keyword keyword
  • hadd (hplace,keyword) adds entry for keyword keyword at hplace
  • hchange (hstring,keyword1,keyword2) changes keyword for entry
  • hputcom (hstring,keyword,comment) sets comment for parameter keyword
  • ra2str (out, ra, ndec) converts RA from degrees to string
  • dec2str (out, dec, ndec) converts Dec from degrees to string
  • deg2str (out, deg, ndec) converts degrees to string
  • num2str (out, num, field, ndec) converts number to string
  • getltime () returns current local time in ISO-style string
  • getutime () returns current UT in ISO string

    hputi4 (char *hstring, char *keyword, int *ival)

    Set int keyword = ival in FITS header string
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword for which to set the value. The first 8 characters must be unique.
    ival
    int number to replace value of keyword

    hputi2 char *(hstring, char *keyword, int ival)

    Set short keyword = ival in FITS header string
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword for which to set the value. The first 8 characters must be unique.
    ival
    int number to replace value of keyword

    hputr4 (char *hstring, char *keyword, float rval)

    Set float keyword = rval in FITS header string
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword for which to set the value. The first 8 characters must be unique.
    rval
    float number to replace value of keyword

    hputr8 (char *hstring, char *keyword, double *dval)

    Set double keyword = dval in FITS header string
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword for which to set the value. The first 8 characters must be unique.
    dval
    double number to replace value of keyword

    (char *hstring, char *keyword, int ndec, character *dval)

    Set double keyword = dval in FITS header string
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword for which to set the value. The first 8 characters must be unique.
    ndec
    Number of decimal places to print
    dval
    double number to replace value of keyword

    hputra (char *hstring, char *keyword, double *ra)

    Set double keyword = hh:mm:ss.sss in FITS header string
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword for which to set the value. The first 8 characters must be unique.
    ra
    Right ascension in degrees

    hputdec (char *hstring, char *keyword, real *dec)

    Set double keyword = dd:mm:ss.sss in FITS header string
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword for which to set the value. The first 8 characters must be unique.
    dec
    Declination in degrees as dd.ddddddd or dd:mm:ss.ssss

    hputl (char *hstring, char *keyword, int lval)

    Set keyword = F if lval=0, else T, in FITS header string
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword for which to set the value. The first 8 characters must be unique.
    lval
    logical variable (0=false, else true)

    hputs (char *hstring, char *keyword, char *cval)

    Set character string keyword = 'cval' in FITS header string
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword for which to set the value. The first 8 characters must be unique.
    cval
    character string containing the value for variable keyword. Trailing and leading blanks are removed.

    hputc (char *hstring, char *keyword, char *value)

    Set character string keyword = value in FITS header string
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword for which to set the value. The first 8 characters must be unique.
    value
    character string containing the value for variable keyword. Trailing and leading blanks are removed.

    hputcom (char *hstring, char *keyword, char *comment)

    Set comment for keyword or on line in FITS header string
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword for which to set the value. The first 8 characters must be unique. If the keyword is COMMENT or HISTORY, a new line is added at the end of the header.
    comment
    character string containing comment or history statement. Trailing and leading blanks are removed.

    hdel (char *hstring, char *keyword)

    Delete keyword = value entry from a FITS header string. 1 is returned if the entry is deleted, else 0.
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword the entry for which is to be deleted.

    hadd (char *hplace, char *keyword)

    Insert a keyword entry into a specified place in a FITS header string. 1 is returned if the entry is added, else 0. One of the hput subroutines should be run after this to insert a value for the keyword.
    hplace
    pointer into a character string containing FITS header information in the format keyword= value [/comment]
    keyword
    Character string containing the name of the header keyword the entry for which is to be added.

    hchange (char *hstring, char *keyword1, char *keyword2)

    Change keyword for entry from keyword1 to keyword2 in a FITS header string Return 1 if entry is changed, else 0.
    hstring
    character string containing FITS header information in the format keyword= value [/comment]
    keyword1
    Character string containing the name of the header keyword to be changed.
    keyword2
    Character string containing the new name of the keyword to be changed.

    ra2str (char *string, double ra, int ndec)

    Convert right ascension ra from degrees to sexagesimal form (hh:mm:ss.sss) with ndec decimal places in string
    string
    Character string (hh:mm:ss.sss) (returned)
    ra
    Right ascension in degrees
    ndec
    Number of decimal places in seconds in string

    dec2str (char *string, double dec, int ndec)

    Convert declination dec from degrees to sexagesimal form (dd:mm:ss.sss) with ndec decimal places in string
    string
    Character string (hh:mm:ss.sss) (returned)
    dec
    Declination in degrees
    ndec
    Number of decimal places in seconds in string

    deg2str (char *string, double deg, int ndec)

    Convert from angle in degrees to string with ndec decimal places
    string
    Character string (dd.dddddd) (returned)
    deg
    Angle in degrees
    ndec
    Number of decimal places in degrees in string

    num2str (char *string, double deg, int field, int ndec)

    Convert from a number to field-character string with ndec decimal places. If field is zero, use however many characters are needed.
    string
    Character string (nn.nnnnnn) (returned)
    num
    Any double precision number
    field
    Number of characters in output field (0=any)
    ndec
    Number of decimal places in returned string

    getltime ()

    Return a character string containing the current local time in the format yyyy-mm-dd hh:mm:ss (Added in version 2.5)

    getutime ()

    Return a character string containing the current universal time (UT) in the format yyyy-mm-ddThh:mm:ss specified by the revised FITS standard. (Added in version 2.5)

    Last updated 15 September 1998 by Doug Mink dmink@cfa.harvard.edu

    Telescope Data Center [WCSTools] [WCSTools Subroutines] [WCS Subroutines]