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 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948
|
<html>
<head>
<meta name="keywords" content="eso, FITS format, C library">
<link href="doxygen.css" rel="stylesheet" type="text/css">
<title>QFITS Reference Manual 6.2.0</title>
</head>
<body text="#000000" bgcolor="#ffffff">
<!-- Generated by Doxygen 1.4.1 -->
<h1>FITS header handling</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">qfits_header * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga0">qfits_header_new</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">FITS header constructor. <a href="#ga0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">qfits_header * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga1">qfits_header_default</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">FITS header default constructor. <a href="#ga1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga2">qfits_header_add</a> (qfits_header *hdr, const char *key, const char *val, const char *com, const char *lin)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a new card to a FITS header. <a href="#ga2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga3">qfits_header_add_after</a> (qfits_header *hdr, const char *after, const char *key, const char *val, const char *com, const char *lin)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">add a new card to a FITS header <a href="#ga3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga4">qfits_header_append</a> (qfits_header *hdr, const char *key, const char *val, const char *com, const char *lin)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Append a new card to a FITS header. <a href="#ga4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga5">qfits_header_del</a> (qfits_header *hdr, const char *key)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a card in a FITS header. <a href="#ga5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga6">qfits_header_mod</a> (qfits_header *hdr, const char *key, const char *val, const char *com)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Modifies a FITS card. <a href="#ga6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga7">qfits_header_sort</a> (qfits_header **hdr)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sort a FITS header. <a href="#ga7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">qfits_header * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga8">qfits_header_copy</a> (const qfits_header *src)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy a FITS header. <a href="#ga8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga9">qfits_header_destroy</a> (qfits_header *hdr)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">qfits_header destructor <a href="#ga9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga10">qfits_header_getstr</a> (const qfits_header *hdr, const char *key)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value associated to a key, as a string. <a href="#ga10"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga11">qfits_header_getitem</a> (const qfits_header *hdr, int idx, char *key, char *val, char *com, char *lin)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the i-th key/val/com/line tuple in a header. <a href="#ga11"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga12">qfits_header_getcom</a> (const qfits_header *hdr, const char *key)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the comment associated to a key, as a string. <a href="#ga12"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga13">qfits_header_getint</a> (const qfits_header *hdr, const char *key, int errval)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value associated to a key, as an int. <a href="#ga13"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga14">qfits_header_getdouble</a> (const qfits_header *hdr, const char *key, double errval)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value associated to a key, as a double. <a href="#ga14"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga15">qfits_header_getboolean</a> (const qfits_header *hdr, const char *key, int errval)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value associated to a key, as a boolean (int). <a href="#ga15"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__header.html#ga16">qfits_header_dump</a> (const qfits_header *hdr, FILE *out)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Dump a FITS header to an opened file. <a href="#ga16"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This file contains definition and related methods for the FITS header structure. This structure is meant to remain opaque to the user, who only accesses it through the dedicated functions.<p>
The 'keytuple' type is strictly internal to this module. It describes FITS cards as tuples (key,value,comment,line), where key is always a non-NULL character string, value and comment are allowed to be NULL. 'line' is a string containing the line as it has been read from the input FITS file (raw). It is set to NULL if the card is modified later. This allows in output two options: either reconstruct the FITS lines by printing key = value / comment in a FITS-compliant way, or output the lines as they were found in input, except for the modified ones.<p>
The following functions are associated methods to this data structure:<p>
<ul>
<li>keytuple_new() constructor</li><li>keytuple_del() destructor</li><li>keytuple_dmp() dumps a keytuple to stdout </li></ul>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga2" doxytag="qfits_header.c::qfits_header_add"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void qfits_header_add </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>val</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>com</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>lin</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Add a new card to a FITS header.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>qfits_header object to modify </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>FITS key </td></tr>
<tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>FITS value </td></tr>
<tr><td valign="top"></td><td valign="top"><em>com</em> </td><td>FITS comment </td></tr>
<tr><td valign="top"></td><td valign="top"><em>lin</em> </td><td>FITS original line if exists </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
This function adds a new card into a header, at the one-before-last position, i.e. the entry just before the END entry if it is there. The key must always be a non-NULL string, all other input parameters are allowed to get NULL values. </td>
</tr>
</table>
<a class="anchor" name="ga3" doxytag="qfits_header.c::qfits_header_add_after"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void qfits_header_add_after </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>after</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>val</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>com</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>lin</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
add a new card to a FITS header
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>qfits_header object to modify </td></tr>
<tr><td valign="top"></td><td valign="top"><em>after</em> </td><td>Key to specify insertion place </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>FITS key </td></tr>
<tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>FITS value </td></tr>
<tr><td valign="top"></td><td valign="top"><em>com</em> </td><td>FITS comment </td></tr>
<tr><td valign="top"></td><td valign="top"><em>lin</em> </td><td>FITS original line if exists </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
Adds a new card to a FITS header, after the specified key. Nothing happens if the specified key is not found in the header. All fields can be NULL, except after and key. </td>
</tr>
</table>
<a class="anchor" name="ga4" doxytag="qfits_header.c::qfits_header_append"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void qfits_header_append </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>val</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>com</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>lin</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Append a new card to a FITS header.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>qfits_header object to modify </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>FITS key </td></tr>
<tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>FITS value </td></tr>
<tr><td valign="top"></td><td valign="top"><em>com</em> </td><td>FITS comment </td></tr>
<tr><td valign="top"></td><td valign="top"><em>lin</em> </td><td>FITS original line if exists </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
Adds a new card in a FITS header as the last one. All fields can be NULL except key. </td>
</tr>
</table>
<a class="anchor" name="ga8" doxytag="qfits_header.c::qfits_header_copy"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">qfits_header* qfits_header_copy </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_header * </td>
<td class="mdname1" valign="top" nowrap> <em>src</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Copy a FITS header.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>src</em> </td><td>Header to replicate </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Pointer to newly allocated qfits_header object.</dd></dl>
Makes a strict copy of all information contained in the source header. The returned header must be freed using qfits_header_destroy. </td>
</tr>
</table>
<a class="anchor" name="ga1" doxytag="qfits_header.c::qfits_header_default"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">qfits_header* qfits_header_default </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
FITS header default constructor.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>1 newly allocated qfits_header object.</dd></dl>
This is a secondary constructor for a qfits_header object. It returns an allocated linked-list handler containing two cards: the first one (SIMPLE=T) and the last one (END). </td>
</tr>
</table>
<a class="anchor" name="ga5" doxytag="qfits_header.c::qfits_header_del"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void qfits_header_del </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>key</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Delete a card in a FITS header.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>qfits_header to modify </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>specifies which card to remove </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
Removes a card from a FITS header. The first found card that matches the key is removed. </td>
</tr>
</table>
<a class="anchor" name="ga9" doxytag="qfits_header.c::qfits_header_destroy"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void qfits_header_destroy </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">qfits_header * </td>
<td class="mdname1" valign="top" nowrap> <em>hdr</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
qfits_header destructor
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>qfits_header to deallocate </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
Frees all memory associated to a given qfits_header object. </td>
</tr>
</table>
<a class="anchor" name="ga16" doxytag="qfits_header.c::qfits_header_dump"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int qfits_header_dump </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>FILE * </td>
<td class="mdname" nowrap> <em>out</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Dump a FITS header to an opened file.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>FITS header to dump </td></tr>
<tr><td valign="top"></td><td valign="top"><em>out</em> </td><td>Opened file pointer </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>int 0 if Ok, -1 otherwise Dumps a FITS header to an opened file pointer. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga15" doxytag="qfits_header.c::qfits_header_getboolean"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int qfits_header_getboolean </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>errval</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Return the value associated to a key, as a boolean (int).
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>qfits_header to parse </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>key to find </td></tr>
<tr><td valign="top"></td><td valign="top"><em>errval</em> </td><td>default value to return if nothing is found </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>int</dd></dl>
Finds the value associated to the given key and return it as a boolean. Returns errval if no matching key is found or no value is attached. A boolean is here understood as an int taking the value 0 or 1. errval can be set to any other integer value to reflect that nothing was found.<p>
errval is returned if no matching key is found or no value is attached.<p>
A true value is any character string beginning with a 'y' (yes), a 't' (true) or the digit '1'. A false value is any character string beginning with a 'n' (no), a 'f' (false) or the digit '0'. </td>
</tr>
</table>
<a class="anchor" name="ga12" doxytag="qfits_header.c::qfits_header_getcom"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">char* qfits_header_getcom </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>key</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Return the comment associated to a key, as a string.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>qfits_header to parse </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>key to find </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>pointer to statically allocated string</dd></dl>
Finds the comment associated to the given key and return it as a string. The returned pointer is statically allocated, so do not modify its contents or try to free it.<p>
Returns NULL if no matching key is found or no comment is attached. </td>
</tr>
</table>
<a class="anchor" name="ga14" doxytag="qfits_header.c::qfits_header_getdouble"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">double qfits_header_getdouble </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>double </td>
<td class="mdname" nowrap> <em>errval</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Return the value associated to a key, as a double.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>qfits_header to parse </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>key to find </td></tr>
<tr><td valign="top"></td><td valign="top"><em>errval</em> </td><td>default value to return if nothing is found </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>double</dd></dl>
Finds the value associated to the given key and return it as a double. Returns errval if no matching key is found or no value is attached. </td>
</tr>
</table>
<a class="anchor" name="ga13" doxytag="qfits_header.c::qfits_header_getint"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int qfits_header_getint </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>errval</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Return the value associated to a key, as an int.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>qfits_header to parse </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>key to find </td></tr>
<tr><td valign="top"></td><td valign="top"><em>errval</em> </td><td>default value to return if nothing is found </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>int</dd></dl>
Finds the value associated to the given key and return it as an int. Returns errval if no matching key is found or no value is attached. </td>
</tr>
</table>
<a class="anchor" name="ga11" doxytag="qfits_header.c::qfits_header_getitem"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int qfits_header_getitem </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>idx</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>char * </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>char * </td>
<td class="mdname" nowrap> <em>val</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>char * </td>
<td class="mdname" nowrap> <em>com</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>char * </td>
<td class="mdname" nowrap> <em>lin</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Return the i-th key/val/com/line tuple in a header.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>Header to consider </td></tr>
<tr><td valign="top"></td><td valign="top"><em>idx</em> </td><td>Index of the requested card </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>Output key </td></tr>
<tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>Output value </td></tr>
<tr><td valign="top"></td><td valign="top"><em>com</em> </td><td>Output comment </td></tr>
<tr><td valign="top"></td><td valign="top"><em>lin</em> </td><td>Output initial line </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>int 0 if Ok, -1 if error occurred.</dd></dl>
This function is useful to browse a FITS header object card by card. By iterating on the number of cards (available in the 'n' field of the qfits_header struct), you can retrieve the FITS lines and their components one by one. Indexes run from 0 to n-1. You can pass NULL values for key, val, com or lin if you are not interested in a given field.<p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">int</span> i ;
<span class="keywordtype">char</span> key[FITS_LINESZ+1] ;
<span class="keywordtype">char</span> val[FITS_LINESZ+1] ;
<span class="keywordtype">char</span> com[FITS_LINESZ+1] ;
<span class="keywordtype">char</span> lin[FITS_LINESZ+1] ;
<span class="keywordflow">for</span> (i=0 ; i<hdr->n ; i++) {
<a class="code" href="group__qfits__header.html#ga11">qfits_header_getitem</a>(hdr, i, key, val, com, lin);
printf(<span class="stringliteral">"card[%d] key[%s] val[%s] com[%s]\n"</span>, i, key, val, com);
}
</pre></div><p>
This function has primarily been written to interface a qfits_header object to other languages (C++/Python). If you are working within a C program, you should use the other header manipulation routines available in this module. </td>
</tr>
</table>
<a class="anchor" name="ga10" doxytag="qfits_header.c::qfits_header_getstr"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">char* qfits_header_getstr </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>key</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Return the value associated to a key, as a string.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>qfits_header to parse </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>key to find </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>pointer to statically allocated string</dd></dl>
Finds the value associated to the given key and return it as a string. The returned pointer is statically allocated, so do not modify its contents or try to free it.<p>
Returns NULL if no matching key is found or no value is attached. </td>
</tr>
</table>
<a class="anchor" name="ga6" doxytag="qfits_header.c::qfits_header_mod"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void qfits_header_mod </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>val</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>com</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Modifies a FITS card.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>qfits_header to modify </td></tr>
<tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>FITS key </td></tr>
<tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>FITS value </td></tr>
<tr><td valign="top"></td><td valign="top"><em>com</em> </td><td>FITS comment </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>void</dd></dl>
Finds the first card in the header matching 'key', and replaces its value and comment fields by the provided values. The initial FITS line is set to NULL in the card. </td>
</tr>
</table>
<a class="anchor" name="ga0" doxytag="qfits_header.c::qfits_header_new"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">qfits_header* qfits_header_new </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
FITS header constructor.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>1 newly allocated (empty) qfits_header object.</dd></dl>
This is the main constructor for a qfits_header object. It returns an allocated linked-list handler with an empty card list. </td>
</tr>
</table>
<a class="anchor" name="ga7" doxytag="qfits_header.c::qfits_header_sort"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int qfits_header_sort </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">qfits_header ** </td>
<td class="mdname1" valign="top" nowrap> <em>hdr</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Sort a FITS header.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>Header to sort (modified) </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>-1 in error case, 0 otherwise </dd></dl>
</td>
</tr>
</table>
</body>
</html>
|