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
|
Title: cardfmt
NAME
====
ft_cardfmt,ft_cardkey,ft_cardset,ft_cardsetl,ft_cardseti,ft_cardsetr,ft_cardsets,ft_cardclr,ft_cardcpy
- Fitsy FITS card set routines.
SYNOPSIS
========
-
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);
-
PARAMETERS
==========
* #"FITSCard card" - FITS card to format.
* #"char *name" - keyword name.
* #"int n" - keyword index number, if is zero no
index number is appended to the
keyword.
* #"FITSType type" - type of the card.
Possible values for a #FITSType are as follows:
* #"FT_COMMENT"
* #"FT_LOGICAL"
* #"FT_INTEGER"
* #"FT_STRING"
* #"FT_VALUE"
* #"FT_REAL"
* #"FT_COMPLEX"
* #"void *value" - pointer to the value to format. The
pointer must be of the apropriate type.
* #"int prec" - If type is FT_REAL the value is formatted
at this precision. Otherwise this parameter
is ignored.
* #"char *comm" - Comment for the card.
* #"int lvalue" - Logical to format as a FITS value.
* #"int ivalue" - Integer to format as a FITS value.
* #"double rvalue" - Double to format as a FITS value.
* #"char *svalue" - String to format as a FITS value.
* #"int ncards" - Number of 80 character FITS cards to clear
* #"FITSCard card1" - Destination card
* #"FITSCard card2" - Source card
DESCRIPTION
===========
ft_cardfmt
----------
Format a FITS card with the supplied values.
ft_cardkey
----------
Format a keyword into a FITS card.
ft_cardset
----------
Format a value into a FITS card.
ft_cardsetl
-----------
Format a logical value into a FITS card.
ft_cardseti
-----------
Format an integer value into a FITS card.
ft_cardsetr
-----------
Format a real value into a FITS card.
ft_cardsets
-----------
Format a string value into a FITS card.
ft_cardclr
----------
Clear FITS cards by writing space into them.
ft_cardcpy
----------
Copy a FITS card.
EXAMPLES
========
Format the keyword part of a card:
+
FITSHead fits;
FITSBuff card;
FITSCard here;
#ft_cardclr(&card, 1); /* Clear out the card first *-/
#ft_cardkey(&card, "RA"); /* Set the keyword *-/
#ft_cardsetr(&card, 14.789, 3, "OBS RA"); /* Set the value of RA. *-/
here = #ft_cardapp(fits, &card); /* Put the new card into a header*-/
#ft_cardsetr(here, 15.567, 3, FT_Comment); /* Set a new value after it's in
the header and reuse the existing
comment *-/
+
Format the value part of a card:
+
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 = #ft_cardfind(fits, "Keyword", 0);
#ft_cardsetl(card, l, "A true value");
#ft_cardseti(card, i, "15 is the number");
#ft_cardsetr(card, d, 4, "Four digits of precision here");
/* In this example the special pointer #FT_Comment is used to
use the existing comment in the card.
*-/
#ft_cardsets(card, c, FT_Comment);
+
|