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 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995
|
<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 table 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">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__table.html#ga0">qfits_is_table</a> (const char *filename, int xtnum)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Identify a file as containing a FITS table in extension. <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__table.html#ga1">qfits_table_prim_header_default</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Generate a default primary header to store tables. <a href="#ga1"></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__table.html#ga2">qfits_table_ext_header_default</a> (const qfits_table *t)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Generate a default extension header to store tables. <a href="#ga2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">qfits_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__table.html#ga3">qfits_table_new</a> (const char *filename, int table_type, int table_width, int nb_cols, int nb_raws)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Table object constructor. <a href="#ga3"></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__table.html#ga4">qfits_col_fill</a> (qfits_col *qc, int atom_nb, int atom_dec_nb, int atom_size, tfits_type atom_type, const char *label, const char *unit, const char *nullval, const char *disp, int zero_present, float zero, int scale_present, float scale, int offset_beg)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Fill a column object with some provided informations. <a href="#ga4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">qfits_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__table.html#ga5">qfits_table_open</a> (const char *filename, int xtnum)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Read a FITS extension. <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__table.html#ga6">qfits_table_close</a> (qfits_table *t)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Free a FITS table and associated pointers. <a href="#ga6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__table.html#ga7">qfits_query_column</a> (const qfits_table *th, int colnum, const int *selection)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract data from a column in a FITS table. <a href="#ga7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__qfits__table.html#ga8">qfits_query_column_seq</a> (const qfits_table *th, int colnum, int start_ind, int nb_rows)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract consequtive values from a column in a FITS table. <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__table.html#ga9">qfits_query_column_data</a> (const qfits_table *th, int colnum, const int *selection, const void *null_value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract binary data from a column in a FITS table. <a href="#ga9"></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__table.html#ga10">qfits_query_column_seq_data</a> (const qfits_table *th, int colnum, int start_ind, int nb_rows, const void *null_value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract binary data from a column in a FITS table. <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__table.html#ga11">qfits_query_column_nulls</a> (const qfits_table *th, int colnum, const int *selection, int *nb_vals, int *nb_nulls)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Detect NULL values in a column. <a href="#ga11"></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__table.html#ga12">qfits_save_table_hdrdump</a> (const void **array, const qfits_table *table, const qfits_header *fh)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a table to a FITS file with a given FITS header. <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__table.html#ga13">qfits_table_append_xtension</a> (FILE *outfile, const qfits_table *t, const void **data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Appends a std extension header + data to a FITS table file. <a href="#ga13"></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__table.html#ga14">qfits_table_append_xtension_hdr</a> (FILE *outfile, const qfits_table *t, const void **data, const qfits_header *hdr)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Appends a specified extension header + data to a FITS table file. <a href="#ga14"></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__table.html#ga15">qfits_table_field_to_string</a> (const qfits_table *table, int col_id, int row_id, int use_zero_scale)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">given a col and a row, find out the string to write for display <a href="#ga15"></a><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga4" doxytag="qfits_table.c::qfits_col_fill"></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_col_fill </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">qfits_col * </td>
<td class="mdname" nowrap> <em>qc</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>atom_nb</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>atom_dec_nb</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>atom_size</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>tfits_type </td>
<td class="mdname" nowrap> <em>atom_type</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>label</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>unit</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>nullval</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>disp</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>zero_present</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float </td>
<td class="mdname" nowrap> <em>zero</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>scale_present</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float </td>
<td class="mdname" nowrap> <em>scale</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>offset_beg</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>
Fill a column object with some provided informations.
<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>qc</em> </td><td>Pointer to the column that has to be filled </td></tr>
<tr><td valign="top"></td><td valign="top"><em>unit</em> </td><td>Unit of the data </td></tr>
<tr><td valign="top"></td><td valign="top"><em>label</em> </td><td>Label of the column </td></tr>
<tr><td valign="top"></td><td valign="top"><em>disp</em> </td><td>Way to display the data </td></tr>
<tr><td valign="top"></td><td valign="top"><em>nullval</em> </td><td>Null value </td></tr>
<tr><td valign="top"></td><td valign="top"><em>atom_nb</em> </td><td>Number of atoms per field. According to the type, an atom is a double, an int, a char, ... </td></tr>
<tr><td valign="top"></td><td valign="top"><em>atom_dec_nb</em> </td><td>Number of decimals as specified in TFORM </td></tr>
<tr><td valign="top"></td><td valign="top"><em>atom_size</em> </td><td>Size in bytes of the field for ASCII tables, and of an atom for BIN tables. ASCII tables only contain 1 atom per field (except for A type where you can of course have more than one char per field) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>atom_type</em> </td><td>Type of data (11 types for BIN, 5 for ASCII) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>zero_present</em> </td><td>Flag to use or not zero </td></tr>
<tr><td valign="top"></td><td valign="top"><em>zero</em> </td><td>Zero value </td></tr>
<tr><td valign="top"></td><td valign="top"><em>scale_present</em> </td><td>Flag to use or not scale </td></tr>
<tr><td valign="top"></td><td valign="top"><em>scale</em> </td><td>Scale value </td></tr>
<tr><td valign="top"></td><td valign="top"><em>offset_beg</em> </td><td>Gives the position of the column </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>-1 in error case, 0 otherwise </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga0" doxytag="qfits_table.c::qfits_is_table"></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_is_table </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const char * </td>
<td class="mdname" nowrap> <em>filename</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>xtnum</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>
Identify a file as containing a FITS table in extension.
<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>filename</em> </td><td>Name of the FITS file to examine. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>xtnum</em> </td><td>Extension number to check (starting from 1). </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>int 1 if the extension contains a table, 0 else. Examines the requested extension and identifies the presence of a FITS table. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga7" doxytag="qfits_table.c::qfits_query_column"></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">unsigned char* qfits_query_column </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_table * </td>
<td class="mdname" nowrap> <em>th</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>colnum</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const int * </td>
<td class="mdname" nowrap> <em>selection</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>
Extract data from a column in a FITS table.
<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>th</em> </td><td>Allocated qfits_table </td></tr>
<tr><td valign="top"></td><td valign="top"><em>colnum</em> </td><td>Number of the column to extract (from 0 to colnum-1) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>selection</em> </td><td>boolean array to define the selected rows </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>unsigned char array</dd></dl>
If selection is NULL, select the complete column.<p>
Extract a column from a FITS table and return the data as a bytes array. The returned array type and size are determined by the column object in the qfits_table and by the selection parameter.<p>
Returned array size in bytes is: nbselected * col->natoms * col->atom_size<p>
Numeric types are correctly understood and byte-swapped if needed, to be converted to the local machine type.<p>
NULL values have to be handled by the caller.<p>
The returned object must be deallocated with qfits_free(). </td>
</tr>
</table>
<a class="anchor" name="ga9" doxytag="qfits_table.c::qfits_query_column_data"></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_query_column_data </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_table * </td>
<td class="mdname" nowrap> <em>th</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>colnum</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const int * </td>
<td class="mdname" nowrap> <em>selection</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const void * </td>
<td class="mdname" nowrap> <em>null_value</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>
Extract binary data from a column in a FITS table.
<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>th</em> </td><td>Allocated qfits_table </td></tr>
<tr><td valign="top"></td><td valign="top"><em>colnum</em> </td><td>Number of the column to extract (from 0 to colnum-1) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>selection</em> </td><td>bollean array to identify selected rows </td></tr>
<tr><td valign="top"></td><td valign="top"><em>null_value</em> </td><td>Value to return when a NULL value comes </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Pointer to void *</dd></dl>
Extract a column from a FITS table and return the data as a generic void* array. The returned array type and size are determined by the column object in the qfits_table.<p>
Returned array size in bytes is: nb_selected * col->atom_nb * col->atom_size<p>
NULL values are recognized and replaced by the specified value. The returned object must be deallocated with qfits_free(). </td>
</tr>
</table>
<a class="anchor" name="ga11" doxytag="qfits_table.c::qfits_query_column_nulls"></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_query_column_nulls </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_table * </td>
<td class="mdname" nowrap> <em>th</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>colnum</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const int * </td>
<td class="mdname" nowrap> <em>selection</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>nb_vals</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>nb_nulls</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>
Detect NULL values in a column.
<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>th</em> </td><td>Allocated qfits_table </td></tr>
<tr><td valign="top"></td><td valign="top"><em>colnum</em> </td><td>Number of the column to check (from 0 to colnum-1) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>selection</em> </td><td>Array to identify selected rows </td></tr>
<tr><td valign="top"></td><td valign="top"><em>nb_vals</em> </td><td>Gives the size of the output array </td></tr>
<tr><td valign="top"></td><td valign="top"><em>nb_nulls</em> </td><td>Gives the number of detected null values </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>array with 1 for NULLs and 0 for non-NULLs The returned object must be deallocated with qfits_free(). </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga8" doxytag="qfits_table.c::qfits_query_column_seq"></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">unsigned char* qfits_query_column_seq </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_table * </td>
<td class="mdname" nowrap> <em>th</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>colnum</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>start_ind</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>nb_rows</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>
Extract consequtive values from a column in a FITS table.
<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>th</em> </td><td>Allocated qfits_table </td></tr>
<tr><td valign="top"></td><td valign="top"><em>colnum</em> </td><td>Number of the column to extract (from 0 to colnum-1) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>start_ind</em> </td><td>Index of the first row (0 for the first) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>nb_rows</em> </td><td>Number of rows to extract </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>unsigned char array Does the same as <a class="el" href="group__qfits__table.html#ga7">qfits_query_column()</a> but on a consequtive sequence of rows Spares the overhead of the selection object allocation The returned object must be deallocated with qfits_free(). </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga10" doxytag="qfits_table.c::qfits_query_column_seq_data"></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_query_column_seq_data </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_table * </td>
<td class="mdname" nowrap> <em>th</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>colnum</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>start_ind</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>nb_rows</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const void * </td>
<td class="mdname" nowrap> <em>null_value</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>
Extract binary data from a column in a FITS table.
<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>th</em> </td><td>Allocated qfits_table </td></tr>
<tr><td valign="top"></td><td valign="top"><em>colnum</em> </td><td>Number of the column to extract (from 0 to colnum-1) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>start_ind</em> </td><td>Index of the first row (0 for the first) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>nb_rows</em> </td><td>Number of rows to extract </td></tr>
<tr><td valign="top"></td><td valign="top"><em>null_value</em> </td><td>Value to return when a NULL value comes </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Pointer to void * Does the same as <a class="el" href="group__qfits__table.html#ga9">qfits_query_column_data()</a> but on a consequtive sequence of rows. Spares the overhead of the selection object allocation The returned object must be deallocated with qfits_free(). </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga12" doxytag="qfits_table.c::qfits_save_table_hdrdump"></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_save_table_hdrdump </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const void ** </td>
<td class="mdname" nowrap> <em>array</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const qfits_table * </td>
<td class="mdname" nowrap> <em>table</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const qfits_header * </td>
<td class="mdname" nowrap> <em>fh</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>
Save a table to a FITS file with a given 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>array</em> </td><td>Data array. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>table</em> </td><td>table </td></tr>
<tr><td valign="top"></td><td valign="top"><em>fh</em> </td><td>FITS header to insert in the output file. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>-1 in error case, 0 otherwise </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga13" doxytag="qfits_table.c::qfits_table_append_xtension"></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_table_append_xtension </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">FILE * </td>
<td class="mdname" nowrap> <em>outfile</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const qfits_table * </td>
<td class="mdname" nowrap> <em>t</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const void ** </td>
<td class="mdname" nowrap> <em>data</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>
Appends a std extension header + data to a FITS table 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>outfile</em> </td><td>Pointer to (opened) file ready for writing. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>t</em> </td><td>Pointer to qfits_table </td></tr>
<tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>Table data to write </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>int 0 if Ok, -1 otherwise</dd></dl>
Dumps a FITS table to a file. The whole table described by qfits_table, and the data arrays contained in 'data' are dumped to the file. An extension header is produced with all keywords needed to describe the table, then the data is dumped to the file. The output is then padded to reach a multiple of 2880 bytes in size. Notice that no main header is produced, only the extension part. </td>
</tr>
</table>
<a class="anchor" name="ga14" doxytag="qfits_table.c::qfits_table_append_xtension_hdr"></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_table_append_xtension_hdr </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">FILE * </td>
<td class="mdname" nowrap> <em>outfile</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const qfits_table * </td>
<td class="mdname" nowrap> <em>t</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const void ** </td>
<td class="mdname" nowrap> <em>data</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const qfits_header * </td>
<td class="mdname" nowrap> <em>hdr</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>
Appends a specified extension header + data to a FITS table 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>outfile</em> </td><td>Pointer to (opened) file ready for writing. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>t</em> </td><td>Pointer to qfits_table </td></tr>
<tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>Table data to write </td></tr>
<tr><td valign="top"></td><td valign="top"><em>hdr</em> </td><td>Specified extension header </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>int 0 if Ok, -1 otherwise</dd></dl>
Dumps a FITS table to a file. The whole table described by qfits_table, and the data arrays contained in 'data' are dumped to the file following the specified fits header. The output is then padded to reach a multiple of 2880 bytes in size. Notice that no main header is produced, only the extension part. </td>
</tr>
</table>
<a class="anchor" name="ga6" doxytag="qfits_table.c::qfits_table_close"></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_table_close </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">qfits_table * </td>
<td class="mdname1" valign="top" nowrap> <em>t</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>
Free a FITS table and associated pointers.
<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>t</em> </td><td>qfits_table to free </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>void Frees all memory associated to a qfits_table structure. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga2" doxytag="qfits_table.c::qfits_table_ext_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_table_ext_header_default </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_table * </td>
<td class="mdname1" valign="top" nowrap> <em>t</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>
Generate a default extension header to store tables.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>the header object </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga15" doxytag="qfits_table.c::qfits_table_field_to_string"></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_table_field_to_string </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const qfits_table * </td>
<td class="mdname" nowrap> <em>table</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>col_id</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>row_id</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>use_zero_scale</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>
given a col and a row, find out the string to write for display
<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>table</em> </td><td>table structure </td></tr>
<tr><td valign="top"></td><td valign="top"><em>col_id</em> </td><td>col id (0 -> nbcol-1) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>row_id</em> </td><td>row id (0 -> nrow-1) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>use_zero_scale</em> </td><td>Flag to use or not zero and scale </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>the string</dd></dl>
This function is highly inefficient, it should not be used in loops to display a complete table. It is more to get one field from time to time, or for debugging puposes. The returned object must be deallocated with qfits_free(). </td>
</tr>
</table>
<a class="anchor" name="ga3" doxytag="qfits_table.c::qfits_table_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_table* qfits_table_new </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const char * </td>
<td class="mdname" nowrap> <em>filename</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>table_type</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>table_width</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>nb_cols</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>nb_raws</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>
Table object constructor.
<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>filename</em> </td><td>Name of the FITS file associated to the table </td></tr>
<tr><td valign="top"></td><td valign="top"><em>table_type</em> </td><td>Type of the table (QFITS_ASCIITABLE or QFITS_BINTABLE) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>table_width</em> </td><td>Width in bytes of the table </td></tr>
<tr><td valign="top"></td><td valign="top"><em>nb_cols</em> </td><td>Number of columns </td></tr>
<tr><td valign="top"></td><td valign="top"><em>nb_raws</em> </td><td>Number of raws </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The table object The columns are also allocated. The object has to be deallocated with <a class="el" href="group__qfits__table.html#ga6">qfits_table_close()</a> </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga5" doxytag="qfits_table.c::qfits_table_open"></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_table* qfits_table_open </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const char * </td>
<td class="mdname" nowrap> <em>filename</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>xtnum</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>
Read a FITS extension.
<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>filename</em> </td><td>Name of the FITS file to examine. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>xtnum</em> </td><td>Extension number to read (starting from 1). </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Pointer to newly allocated qfits_table structure.</dd></dl>
Read a FITS table from a given file name and extension, and return a newly allocated qfits_table structure. </td>
</tr>
</table>
<a class="anchor" name="ga1" doxytag="qfits_table.c::qfits_table_prim_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_table_prim_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>
Generate a default primary header to store tables.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>the header object </dd></dl>
</td>
</tr>
</table>
</body>
</html>
|