summaryrefslogtreecommitdiffstats
path: root/funtools/fitsy/doc/cardfind.html
blob: 4562c29a98deb4b42761fa5de8de30d47c6366e3 (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
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> cardfind
</TITLE>
<p>
<!-- pnuts --> <a href="cardfmt.html">[Previous]</a> <a href="cardins.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_cardfind,ft_cardfindidx,ft_cardfindseq -Fitsy FITS card find routines.

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

 

<PRE>
FITSCard ft_cardfind(FITSHead fits, FITSCard key, int add);
FITSCard ft_cardfindidx(FITSHead fits, FITSCard key, int *match);
FITSCard ft_cardfindseq(FITSHead fits, FITSCard key, int *match);


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

<UL>
<P>
  <LI> <B>FITSHead fits</B> - The FITS header to look in.
  <LI> <B>FITSCard key</B> - The card keyword to lookup.
  <LI> <B>int add</B> - If add is true the card will
      be added to the header if it is
      not found.
  <LI> <B>int *match</B> - Returns true if the card found is
      an exact match for the keyword requested.

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

<P>
 Routines to find FITS cards in a FITS headers data structure.

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

<P>
 Find a FITS card in the header.
 
<P>
 <B>cardfind</B> will use the index if is has been created otherwise
 it searches sequentially through the header to find the card.

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

<P>
 Find a FITS card in the header using an index.
 
<P>
 If the header is not indexed an index is created for it.

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

<P>
 Find a card in the FITS header using sequential search.
 
<P>
 If the requested card is a FITS indexed keyword and an exact match
 is not found, the last card of that type is returned and
 match is set to 0.

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


<PRE>

                /* Declair some fitsy types.
                 */
                <B>FITSHead</B>       fits;
                <B>FITSCard</B>       foo;
                <B>FITSCard</B>       goo;
                <B>FITSBuff</B>       key;

        /* Look up a card using sequential search.
         */
        <B>ft_cardkey</B>(key, "FOO");
        foo = <B>ft_cardfind</B>(fits, key, 0);

        /* This is the same thing.  But the card is added to the header
           if it isn't found.  This will also invalidate the index if
           there is one.
         */
        <B>ft_cardkey</B>(key, "FOO");
        foo = <B>ft_cardfind</B>(fits, key, 1);

        /* Now index the header so that searches are faster.  <B>ft_cardfind</B>
           will automatically use the index if its valid.
         */
        <B>ft_index</B>(fits);
        <B>ft_cardkey</B>(key, "GOO", 0);
        goo = <B>ft_cardfind</B>(fits, key, 0);

<P>
</PRE>

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