summaryrefslogtreecommitdiffstats
path: root/funtools/fitsy/doc/cardfind.wu
blob: b854c3d2085acb969b147609d0027c2eafdd3111 (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
Title: cardfind


NAME
====
 ft_cardfind,ft_cardfindidx,ft_cardfindseq -Fitsy FITS card find routines.

SYNOPSIS
========
 

-
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);


-
PARAMETERS
==========
  * #"FITSHead fits" - The FITS header to look in.
  * #"FITSCard key" - The card keyword to lookup.
  * #"int add" - If add is true the card will
      be added to the header if it is
      not found.
  * #"int *match" - Returns true if the card found is
      an exact match for the keyword requested.

DESCRIPTION
===========
 Routines to find FITS cards in a FITS headers data structure.

 ft_cardfind
 -----------
 Find a FITS card in the header.
 
 #cardfind will use the index if is has been created otherwise
 it searches sequentially through the header to find the card.

 ft_cardfindidx
 --------------
 Find a FITS card in the header using an index.
 
 If the header is not indexed an index is created for it.

 ft_cardfindseq
 --------------
 Find a card in the FITS header using sequential search.
 
 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.

EXAMPLES
========

+

		/* Declair some fitsy types.
		 *-/
		#FITSHead	fits;
		#FITSCard	foo;
		#FITSCard	goo;
		#FITSBuff	key;

	/* Look up a card using sequential search.
	 *-/
	#ft_cardkey(key, "FOO");
	foo = #ft_cardfind(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.
	 *-/
	#ft_cardkey(key, "FOO");
	foo = #ft_cardfind(fits, key, 1);

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

+