summaryrefslogtreecommitdiffstats
path: root/funtools/fitsy/doc/cardfmt.html
blob: 0ab1cd603f220d6619d8dae9c2f359bf9f7560cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> cardfmt
</TITLE>
<p>
<!-- pnuts --> <a href="cardpar.html">[Previous]</a> <a href="cardfind.html">[Next]</a> <a href="fitsy.html">[Up]</a> <a href="../mmtilib.html">[Top]</a>
<META NAME="generator" CONTENT="txt2html v1.3">
</HEAD>
<BODY>


<A NAME="section-1.1.1"><H3>NAME</H3></A>

<P>
 ft_cardfmt,ft_cardkey,ft_cardset,ft_cardsetl,ft_cardseti,ft_cardsetr,ft_cardsets,ft_cardclr,ft_cardcpy
- Fitsy FITS card set routines.

<A NAME="section-1.1.2"><H3>SYNOPSIS</H3></A>

 

<PRE>
FITSCard ft_cardfmt(FITSCard card, char *name, int n, FITSType type, void *value, int prec, char *comm);
FITSCard ft_cardkey(FITSCard card, char *name, int n);
FITSCard ft_cardset(FITSCard card, FITSType type, void *value, int prec, char *comm);
FITSCard ft_cardsetl(FITSCard card, int lvalue, char *comm);
FITSCard ft_cardseti(FITSCard card, int ivalue, char *comm);
FITSCard ft_cardsetr(FITSCard card, double rvalue, int prec, char *comm);
FITSCard ft_cardsets(FITSCard card, char *svalue, char *comm);
FITSCard ft_cardclr(FITSCard card, int ncards);
FITSCard ft_cardcpy(FITSCard card1, FITSCard card2);


<P>
</PRE>
<A NAME="section-1.1.3"><H3>PARAMETERS</H3></A>

<UL>
<P>
  <LI> <B>FITSCard card</B> - FITS card to format.
  <LI> <B>char *name</B> - keyword name.
  <LI> <B>int n</B> - keyword index number, if is zero no
      index number is appended to the
      keyword.
  <LI> <B>FITSType type</B> - type of the card.

<P>
       Possible values for a <B>FITSType</B> are as follows:
  <UL>
<P>
    <LI> <B>FT_COMMENT</B>
    <LI> <B>FT_LOGICAL</B>
    <LI> <B>FT_INTEGER</B>
    <LI> <B>FT_STRING</B>
    <LI> <B>FT_VALUE</B>
    <LI> <B>FT_REAL</B>
    <LI> <B>FT_COMPLEX</B>

  </UL>
<P>
  <LI> <B>void *value</B> - pointer to the value to format. The
      pointer must be of the apropriate type.
  <LI> <B>int prec</B> - If type is FT_REAL the value is formatted
      at this precision. Otherwise this parameter
      is ignored.
  <LI> <B>char *comm</B> - Comment for the card.
  <LI> <B>int lvalue</B> - Logical to format as a FITS value.
  <LI> <B>int ivalue</B> - Integer to format as a FITS value.
  <LI> <B>double rvalue</B> - Double to format as a FITS value.
  <LI> <B>char *svalue</B> - String to format as a FITS value.
  <LI> <B>int ncards</B> - Number of 80 character FITS cards to clear
  <LI> <B>FITSCard card1</B> - Destination card
  <LI> <B>FITSCard card2</B> - Source card

</UL>
<A NAME="section-1.1.4"><H3>DESCRIPTION</H3></A>


<A NAME="section-1.1.4.1"><H4>ft_cardfmt</H4></A>

<P>
 Format a FITS card with the supplied values.

<A NAME="section-1.1.4.2"><H4>ft_cardkey</H4></A>

<P>
 Format a keyword into a FITS card.

<A NAME="section-1.1.4.3"><H4>ft_cardset</H4></A>

<P>
 Format a value into a FITS card.

<A NAME="section-1.1.4.4"><H4>ft_cardsetl</H4></A>

<P>
 Format a logical value into a FITS card.

<A NAME="section-1.1.4.5"><H4>ft_cardseti</H4></A>

<P>
 Format an integer value into a FITS card.

<A NAME="section-1.1.4.6"><H4>ft_cardsetr</H4></A>

<P>
 Format a real value into a FITS card.

<A NAME="section-1.1.4.7"><H4>ft_cardsets</H4></A>

<P>
 Format a string value into a FITS card.

<A NAME="section-1.1.4.8"><H4>ft_cardclr</H4></A>

<P>
 Clear FITS cards by writing space into them.

<A NAME="section-1.1.4.9"><H4>ft_cardcpy</H4></A>

<P>
 Copy a FITS card.

<A NAME="section-1.1.5"><H3>EXAMPLES</H3></A>

<P>
 Format the keyword part of a card:

<PRE>

                FITSHead        fits;
                FITSBuff        card;
                FITSCard        here;

        <B>ft_cardclr</B>(&amp;card, 1);                  /* Clear out the card first             */

        <B>ft_cardkey</B>(&amp;card, "RA");                       /* Set the keyword              */
        <B>ft_cardsetr</B>(&amp;card, 14.789, 3, "OBS RA");       /* Set the value of RA.         */

        here = <B>ft_cardapp</B>(fits, &amp;card);                /* Put the new card into a header*/

        <B>ft_cardsetr</B>(here, 15.567, 3, FT_Comment);      /* Set a new value after it's in 
                                                           the header and reuse the existing
                                                           comment */

<P>
</PRE>
 
<P>
 Format the value part of a card:

<PRE>
                int     l = 1;
                int     i = 15;
                double  d = 34.7;
                char   *c = "Shutter";

                FITSHead        fits;
                FITSCard        card;

        /* Get a card pointer from the header
         */
        card = <B>ft_cardfind</B>(fits, "Keyword", 0);

        <B>ft_cardsetl</B>(card, l, "A true value");
        <B>ft_cardseti</B>(card, i, "15 is the number");
        <B>ft_cardsetr</B>(card, d, 4, "Four digits of precision here");

        /* In this example the special pointer <B>FT_Comment</B> is used to 
           use the existing comment in the card.
         */
        <B>ft_cardsets</B>(card, c, FT_Comment);

<P>
</PRE>

<p>
<!-- pnuts --> <a href="cardpar.html">[Previous]</a> <a href="cardfind.html">[Next]</a> <a href="fitsy.html">[Up]</a> <a href="../mmtilib.html">[Top]</a>
</BODY>
</HTML>